test/main.c

Thu, 28 Feb 2013 08:50:24 +0100

author
Mike Becker <universe@uap-core.de>
date
Thu, 28 Feb 2013 08:50:24 +0100
changeset 103
08018864fb91
parent 97
499e1b465d77
child 108
d2b1e67b2b48
permissions
-rw-r--r--

added license and copyright notice to all files

0
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
103
08018864fb91 added license and copyright notice to all files
Mike Becker <universe@uap-core.de>
parents: 97
diff changeset
4 * Copyright 2013 Olaf Wintermann. All rights reserved.
0
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #include <stdio.h>
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 #include <stdlib.h>
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31
26
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
32 #include "ucx/test.h"
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
33
27
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
34 #include "main.h"
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
35
54
f634f790661a added logging API
Mike Becker <universe@uap-core.de>
parents: 53
diff changeset
36 #include "logging_tests.h"
9
013c5c4b7e44 Added dlist tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
37 #include "list_tests.h"
27
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
38 #include "dlist_tests.h"
39
bf8ab7bb74ff added sstrsplit function
Mike Becker <universe@uap-core.de>
parents: 36
diff changeset
39 #include "string_tests.h"
13
98ac89e3aa37 Added mempool
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
40 #include "mpool_tests.h"
20
db7d9860dbbd added some map functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
41 #include "map_tests.h"
60
abae4669fba7 renamed UcxMemstream to UcxBuffer
Mike Becker <universe@uap-core.de>
parents: 58
diff changeset
42 #include "buffer_tests.h"
9
013c5c4b7e44 Added dlist tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
43
33
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
44 UCX_TEST_IMPLEMENT(testTestSuitePositive) {
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
45 UCX_TEST_BEGIN
40
583718dd4cf3 added semicolons to assert makros
Mike Becker <universe@uap-core.de>
parents: 39
diff changeset
46 UCX_TEST_ASSERT(2*2 == 4, "the test framework fails");
26
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
47 UCX_TEST_END
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
48 }
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
49
33
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
50 UCX_TEST_IMPLEMENT(testTestSuiteNegative) {
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
51 UCX_TEST_BEGIN
40
583718dd4cf3 added semicolons to assert makros
Mike Becker <universe@uap-core.de>
parents: 39
diff changeset
52 UCX_TEST_ASSERT(2*(-2) == 4, "the test framework works");
26
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
53 UCX_TEST_END
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
54 }
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
55
88
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
56 UCX_TEST_SUBROUTINE(testTestSuiteRoutineRoutine, float f) {
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
57 UCX_TEST_ASSERT(f == 3.14f, "calling routine in a routine fails");
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
58 }
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
59
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
60 UCX_TEST_SUBROUTINE(testTestSuiteRoutine2Param, int i, float f) {
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
61 UCX_TEST_ASSERT(i == 42, "two parameter routine fails");
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
62 UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineRoutine, f);
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
63 }
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
64
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
65 UCX_TEST_SUBROUTINE(testTestSuiteRoutineSuccess, int* i) {
33
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
66 *i += 2;
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
67 UCX_TEST_ASSERT(*i==4, "the test framework fails");
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
68 }
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
69
88
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
70 UCX_TEST_SUBROUTINE(testTestSuiteRoutineFailure, int* i) {
33
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
71 *i += 2;
88
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
72 // Next test shall fail!
33
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
73 UCX_TEST_ASSERT(*i==4, "the test framework works");
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
74 }
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
75
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
76 UCX_TEST_IMPLEMENT(testTestSuiteRoutinePositive) {
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
77 int i = 2;
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
78 UCX_TEST_BEGIN
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
79 UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineSuccess, &i);
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
80 UCX_TEST_ASSERT(i==4, "the test framework fails");
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
81 UCX_TEST_END
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
82 }
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
83
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
84 UCX_TEST_IMPLEMENT(testTestSuiteRoutineNegative) {
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
85 int i = 0;
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
86 UCX_TEST_BEGIN
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
87 UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineFailure, &i);
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
88 UCX_TEST_ASSERT(1, "the test framework fails");
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
89 UCX_TEST_END
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
90 }
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
91
88
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
92 UCX_TEST_IMPLEMENT(testTestSuiteRoutineMultiparam) {
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
93 UCX_TEST_BEGIN
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
94 UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutine2Param, 42, 3.14f);
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
95 UCX_TEST_END
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
96 }
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
97
0
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98 int main(int argc, char **argv) {
13
98ac89e3aa37 Added mempool
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
99 printf("UCX Tests\n---------\n");
9
013c5c4b7e44 Added dlist tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
100
33
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
101 printf("\nUcxTestSuite tests (2 failures are intended!)\n");
26
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
102 UcxTestSuite* suite = ucx_test_suite_new();
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
103 ucx_test_register(suite, testTestSuitePositive);
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
104 ucx_test_register(suite, testTestSuiteNegative);
33
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
105 ucx_test_register(suite, testTestSuiteRoutinePositive);
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
106 ucx_test_register(suite, testTestSuiteRoutineNegative);
88
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
107 ucx_test_register(suite, testTestSuiteRoutineMultiparam);
26
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
108 ucx_test_run(suite, stdout);
88
18823857ce79 variadic test subroutines
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
109 if (suite->failure == 2 && suite->success == 3) {
26
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
110 ucx_test_suite_free(suite);
27
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
111
28
1666cbeb1db8 new mempool tests
Mike Becker <universe@uap-core.de>
parents: 27
diff changeset
112 printf("\nLibrary function tests\n");
27
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
113 suite = ucx_test_suite_new();
97
499e1b465d77 fixed execution order of tests + added test for sstrtrim
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
114 /* sstring Tests */
499e1b465d77 fixed execution order of tests + added test for sstrtrim
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
115 ucx_test_register(suite, test_sstr);
499e1b465d77 fixed execution order of tests + added test for sstrtrim
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
116 ucx_test_register(suite, test_sstr_len_cat);
499e1b465d77 fixed execution order of tests + added test for sstrtrim
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
117 ucx_test_register(suite, test_sstrsplit);
499e1b465d77 fixed execution order of tests + added test for sstrtrim
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
118 ucx_test_register(suite, test_sstrtrim);
499e1b465d77 fixed execution order of tests + added test for sstrtrim
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
119
54
f634f790661a added logging API
Mike Becker <universe@uap-core.de>
parents: 53
diff changeset
120 /* UcxLogger Tests */
f634f790661a added logging API
Mike Becker <universe@uap-core.de>
parents: 53
diff changeset
121 ucx_test_register(suite, test_ucx_logger_log);
f634f790661a added logging API
Mike Becker <universe@uap-core.de>
parents: 53
diff changeset
122
27
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
123 /* UcxList Tests */
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
124 ucx_test_register(suite, test_ucx_list_append);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
125 ucx_test_register(suite, test_ucx_list_prepend);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
126 ucx_test_register(suite, test_ucx_list_equals);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
127 ucx_test_register(suite, test_ucx_list_concat);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
128 ucx_test_register(suite, test_ucx_list_size);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
129 ucx_test_register(suite, test_ucx_list_last);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
130 ucx_test_register(suite, test_ucx_list_get);
90
ef3163857e88 added tests for ucx_(d)list_contains
Mike Becker <universe@uap-core.de>
parents: 89
diff changeset
131 ucx_test_register(suite, test_ucx_list_contains);
27
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
132 ucx_test_register(suite, test_ucx_list_remove);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
133 ucx_test_register(suite, test_ucx_list_clone);
36
a9d656e4f7ce changed API of sort algorithms (no further hint for the algorithms used in preparation for the upcomming change from qsort to natural merge sort)
Mike Becker <universe@uap-core.de>
parents: 35
diff changeset
134 ucx_test_register(suite, test_ucx_list_sort);
27
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
135
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
136 /* UcxDlist Tests */
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
137 ucx_test_register(suite, test_ucx_dlist_append);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
138 ucx_test_register(suite, test_ucx_dlist_prepend);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
139 ucx_test_register(suite, test_ucx_dlist_equals);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
140 ucx_test_register(suite, test_ucx_dlist_concat);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
141 ucx_test_register(suite, test_ucx_dlist_size);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
142 ucx_test_register(suite, test_ucx_dlist_first);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
143 ucx_test_register(suite, test_ucx_dlist_last);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
144 ucx_test_register(suite, test_ucx_dlist_get);
90
ef3163857e88 added tests for ucx_(d)list_contains
Mike Becker <universe@uap-core.de>
parents: 89
diff changeset
145 ucx_test_register(suite, test_ucx_dlist_contains);
27
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
146 ucx_test_register(suite, test_ucx_dlist_remove);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
147 ucx_test_register(suite, test_ucx_dlist_clone);
36
a9d656e4f7ce changed API of sort algorithms (no further hint for the algorithms used in preparation for the upcomming change from qsort to natural merge sort)
Mike Becker <universe@uap-core.de>
parents: 35
diff changeset
148 ucx_test_register(suite, test_ucx_dlist_sort);
27
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
149
28
1666cbeb1db8 new mempool tests
Mike Becker <universe@uap-core.de>
parents: 27
diff changeset
150 /* UcxMemPool Tests */
1666cbeb1db8 new mempool tests
Mike Becker <universe@uap-core.de>
parents: 27
diff changeset
151 ucx_test_register(suite, test_ucx_mempool_new);
1666cbeb1db8 new mempool tests
Mike Becker <universe@uap-core.de>
parents: 27
diff changeset
152 ucx_test_register(suite, test_ucx_mempool_malloc);
1666cbeb1db8 new mempool tests
Mike Becker <universe@uap-core.de>
parents: 27
diff changeset
153 ucx_test_register(suite, test_ucx_mempool_malloc_with_chcap);
1666cbeb1db8 new mempool tests
Mike Becker <universe@uap-core.de>
parents: 27
diff changeset
154 ucx_test_register(suite, test_ucx_mempool_calloc);
1666cbeb1db8 new mempool tests
Mike Becker <universe@uap-core.de>
parents: 27
diff changeset
155 ucx_test_register(suite, test_ucx_mempool_set_destr);
1666cbeb1db8 new mempool tests
Mike Becker <universe@uap-core.de>
parents: 27
diff changeset
156 ucx_test_register(suite, test_ucx_mempool_reg_destr);
1666cbeb1db8 new mempool tests
Mike Becker <universe@uap-core.de>
parents: 27
diff changeset
157 ucx_test_register(suite, test_ucx_mempool_realloc);
20
db7d9860dbbd added some map functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
158
29
bce0d7f2912b fixed map with the help of new tests
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
159 /* UcxMap Tests */
bce0d7f2912b fixed map with the help of new tests
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
160 ucx_test_register(suite, test_ucx_map_new);
bce0d7f2912b fixed map with the help of new tests
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
161 ucx_test_register(suite, test_ucx_key);
bce0d7f2912b fixed map with the help of new tests
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
162 ucx_test_register(suite, test_ucx_map_put);
bce0d7f2912b fixed map with the help of new tests
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
163 ucx_test_register(suite, test_ucx_map_get);
53
e533c170bfb8 added ucx_map_remove
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
164 ucx_test_register(suite, test_ucx_map_remove);
31
91ac86557290 added map iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
165 ucx_test_register(suite, test_ucx_map_iterator);
33
9c219a62070d major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents: 31
diff changeset
166 ucx_test_register(suite, test_ucx_map_iterator_chain);
42
ff3dd1ee7dee (broken-commit) - added load and store functions, tests failing
Mike Becker <universe@uap-core.de>
parents: 40
diff changeset
167 ucx_test_register(suite, test_ucx_map_store_load);
48
621a4430c404 map can now load values from file into pooled memory
Mike Becker <universe@uap-core.de>
parents: 44
diff changeset
168 ucx_test_register(suite, test_ucx_map_store_load_with_mempool);
44
46356d74e873 added map clone
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 42
diff changeset
169 ucx_test_register(suite, test_ucx_map_clone);
51
1c78cd19fb6b added rehashing to maps by using clone function
Mike Becker <universe@uap-core.de>
parents: 49
diff changeset
170 ucx_test_register(suite, test_ucx_map_rehash);
39
bf8ab7bb74ff added sstrsplit function
Mike Becker <universe@uap-core.de>
parents: 36
diff changeset
171
56
76caac0da4a0 added memstream to ucx - still little work to do
Mike Becker <universe@uap-core.de>
parents: 55
diff changeset
172 /* UcxMemstream Tests */
60
abae4669fba7 renamed UcxMemstream to UcxBuffer
Mike Becker <universe@uap-core.de>
parents: 58
diff changeset
173 ucx_test_register(suite, test_ucx_buffer_seektell);
abae4669fba7 renamed UcxMemstream to UcxBuffer
Mike Becker <universe@uap-core.de>
parents: 58
diff changeset
174 ucx_test_register(suite, test_ucx_buffer_putc);
76
655020a30e77 fixed buffer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
175 ucx_test_register(suite, test_ucx_buffer_putc_ax);
60
abae4669fba7 renamed UcxMemstream to UcxBuffer
Mike Becker <universe@uap-core.de>
parents: 58
diff changeset
176 ucx_test_register(suite, test_ucx_buffer_getc);
abae4669fba7 renamed UcxMemstream to UcxBuffer
Mike Becker <universe@uap-core.de>
parents: 58
diff changeset
177 ucx_test_register(suite, test_ucx_buffer_write);
64
16590c9c497c added autoextend feature to buffer
Mike Becker <universe@uap-core.de>
parents: 62
diff changeset
178 ucx_test_register(suite, test_ucx_buffer_write_ax);
60
abae4669fba7 renamed UcxMemstream to UcxBuffer
Mike Becker <universe@uap-core.de>
parents: 58
diff changeset
179 ucx_test_register(suite, test_ucx_buffer_read);
62
6814aea8462d added extract function
Mike Becker <universe@uap-core.de>
parents: 60
diff changeset
180 ucx_test_register(suite, test_ucx_buffer_extract);
76
655020a30e77 fixed buffer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
181 ucx_test_register(suite, test_ucx_buffer_generic_copy);
56
76caac0da4a0 added memstream to ucx - still little work to do
Mike Becker <universe@uap-core.de>
parents: 55
diff changeset
182
27
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
183 ucx_test_run(suite, stdout);
55
180bc6b18fec fixed map tests + used tmpfiles in tests
Mike Becker <universe@uap-core.de>
parents: 54
diff changeset
184 fflush(stdout);
27
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
185 ucx_test_suite_free(suite);
22644e2572bc removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
186
26
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
187 return EXIT_SUCCESS;
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
188 } else {
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
189 ucx_test_suite_free(suite);
59f147baea31 added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
190 return EXIT_FAILURE;
20
db7d9860dbbd added some map functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
191 }
0
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
192 }
1e4522fddff0 Added makefiles
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
193

mercurial