Sun, 03 Nov 2019 17:03:10 +0100
fix: missing documentation for first param in ucx_array_init_a()
0 | 1 | /* |
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | |
3 | * | |
259 | 4 | * Copyright 2017 Mike Becker, Olaf Wintermann All rights reserved. |
0 | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions are met: | |
8 | * | |
9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | |
11 | * | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | |
15 | * | |
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | |
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | |
28 | ||
29 | #include <stdio.h> | |
30 | #include <stdlib.h> | |
31 | ||
251
fae240d633fc
changes source directory structure in preperation for autotools rollout
Mike Becker <universe@uap-core.de>
parents:
250
diff
changeset
|
32 | #include <ucx/test.h> |
26
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 | |
334
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
36 | #include "array_tests.h" |
164
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
37 | #include "allocator_tests.h" |
54 | 38 | #include "logging_tests.h" |
122
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
39 | #include "list_tests.h" |
39 | 40 | #include "string_tests.h" |
13 | 41 | #include "mpool_tests.h" |
185
a48428642b4e
added stack implementation + added g++ config and added some fixes for C++
Mike Becker <universe@uap-core.de>
parents:
180
diff
changeset
|
42 | #include "stack_tests.h" |
20
db7d9860dbbd
added some map functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
13
diff
changeset
|
43 | #include "map_tests.h" |
108
d2b1e67b2b48
new properties parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
103
diff
changeset
|
44 | #include "prop_tests.h" |
60
abae4669fba7
renamed UcxMemstream to UcxBuffer
Mike Becker <universe@uap-core.de>
parents:
58
diff
changeset
|
45 | #include "buffer_tests.h" |
142
ee8cb27d8b8e
added printf functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
46 | #include "utils_tests.h" |
198
b0f4fb043b47
added test for ucx_avl_put
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
192
diff
changeset
|
47 | #include "avl_tests.h" |
9
013c5c4b7e44
Added dlist tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
48 | |
254
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
49 | #ifdef __cplusplus |
253
e19825a1430a
removes unnecessary macros from ucx.h + removes the usage of restrict and _Bool completely, instead of defining macros
Mike Becker <universe@uap-core.de>
parents:
252
diff
changeset
|
50 | extern "C" { |
254
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
51 | #endif |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
52 | UCX_TEST(testTestSuitePositive) { |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
53 | UCX_TEST_BEGIN |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
54 | UCX_TEST_ASSERT(2*2 == 4, "the test framework fails"); |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
55 | UCX_TEST_END |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
56 | } |
26
59f147baea31
added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents:
21
diff
changeset
|
57 | |
254
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
58 | UCX_TEST(testTestSuiteNegative) { |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
59 | UCX_TEST_BEGIN |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
60 | UCX_TEST_ASSERT(2*(-2) == 4, "the test framework works"); |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
61 | UCX_TEST_END |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
62 | } |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
63 | |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
64 | UCX_TEST_SUBROUTINE(testTestSuiteRoutineRoutine, float f) { |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
65 | UCX_TEST_ASSERT(f == 3.14f, "calling routine in a routine fails"); |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
66 | } |
88
18823857ce79
variadic test subroutines
Mike Becker <universe@uap-core.de>
parents:
76
diff
changeset
|
67 | |
254
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
68 | UCX_TEST_SUBROUTINE(testTestSuiteRoutine2Param, int i, float f) { |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
69 | UCX_TEST_ASSERT(i == 42, "two parameter routine fails"); |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
70 | UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineRoutine, f); |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
71 | } |
88
18823857ce79
variadic test subroutines
Mike Becker <universe@uap-core.de>
parents:
76
diff
changeset
|
72 | |
254
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
73 | UCX_TEST_SUBROUTINE(testTestSuiteRoutineSuccess, int* i) { |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
74 | *i += 2; |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
75 | UCX_TEST_ASSERT(*i==4, "the test framework fails"); |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
76 | } |
33
9c219a62070d
major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents:
31
diff
changeset
|
77 | |
254
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
78 | UCX_TEST_SUBROUTINE(testTestSuiteRoutineFailure, int* i) { |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
79 | *i += 2; |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
80 | // Next test shall fail! |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
81 | UCX_TEST_ASSERT(*i==4, "the test framework works"); |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
82 | } |
253
e19825a1430a
removes unnecessary macros from ucx.h + removes the usage of restrict and _Bool completely, instead of defining macros
Mike Becker <universe@uap-core.de>
parents:
252
diff
changeset
|
83 | |
254
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
84 | UCX_TEST(testTestSuiteRoutinePositive) { |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
85 | int i = 2; |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
86 | UCX_TEST_BEGIN |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
87 | UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineSuccess, &i); |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
88 | UCX_TEST_ASSERT(i==4, "the test framework fails"); |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
89 | UCX_TEST_END |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
90 | } |
33
9c219a62070d
major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents:
31
diff
changeset
|
91 | |
254
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
92 | UCX_TEST(testTestSuiteRoutineNegative) { |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
93 | int i = 0; |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
94 | UCX_TEST_BEGIN |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
95 | UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineFailure, &i); |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
96 | UCX_TEST_ASSERT(1, "the test framework fails"); |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
97 | UCX_TEST_END |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
98 | } |
33
9c219a62070d
major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents:
31
diff
changeset
|
99 | |
254
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
100 | UCX_TEST(testTestSuiteRoutineMultiparam) { |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
101 | UCX_TEST_BEGIN |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
102 | UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutine2Param, 42, 3.14f); |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
103 | UCX_TEST_END |
88
18823857ce79
variadic test subroutines
Mike Becker <universe@uap-core.de>
parents:
76
diff
changeset
|
104 | } |
254
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
105 | #ifdef __cplusplus |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
106 | } |
c45c385ac578
fixes include path and non-cpp build for test program
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
107 | #endif |
88
18823857ce79
variadic test subroutines
Mike Becker <universe@uap-core.de>
parents:
76
diff
changeset
|
108 | |
0 | 109 | int main(int argc, char **argv) { |
13 | 110 | printf("UCX Tests\n---------\n"); |
9
013c5c4b7e44
Added dlist tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
111 | |
33
9c219a62070d
major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents:
31
diff
changeset
|
112 | 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
|
113 | UcxTestSuite* suite = ucx_test_suite_new(); |
59f147baea31
added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents:
21
diff
changeset
|
114 | ucx_test_register(suite, testTestSuitePositive); |
59f147baea31
added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents:
21
diff
changeset
|
115 | ucx_test_register(suite, testTestSuiteNegative); |
33
9c219a62070d
major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents:
31
diff
changeset
|
116 | ucx_test_register(suite, testTestSuiteRoutinePositive); |
9c219a62070d
major refactoring of test framework
Mike Becker <universe@uap-core.de>
parents:
31
diff
changeset
|
117 | ucx_test_register(suite, testTestSuiteRoutineNegative); |
88
18823857ce79
variadic test subroutines
Mike Becker <universe@uap-core.de>
parents:
76
diff
changeset
|
118 | ucx_test_register(suite, testTestSuiteRoutineMultiparam); |
26
59f147baea31
added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents:
21
diff
changeset
|
119 | ucx_test_run(suite, stdout); |
88
18823857ce79
variadic test subroutines
Mike Becker <universe@uap-core.de>
parents:
76
diff
changeset
|
120 | 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
|
121 | ucx_test_suite_free(suite); |
27
22644e2572bc
removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents:
26
diff
changeset
|
122 | |
28 | 123 | printf("\nLibrary function tests\n"); |
27
22644e2572bc
removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents:
26
diff
changeset
|
124 | suite = ucx_test_suite_new(); |
164
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
125 | /* UcxAllocator Tests */ |
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
126 | ucx_test_register(suite, test_ucx_default_allocator); |
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
127 | |
97
499e1b465d77
fixed execution order of tests + added test for sstrtrim
Mike Becker <universe@uap-core.de>
parents:
94
diff
changeset
|
128 | /* sstring Tests */ |
283
c3b6ff227481
adds more convenience macros for sstr
Mike Becker <universe@uap-core.de>
parents:
259
diff
changeset
|
129 | ucx_test_register(suite, test_sstr_macros); |
97
499e1b465d77
fixed execution order of tests + added test for sstrtrim
Mike Becker <universe@uap-core.de>
parents:
94
diff
changeset
|
130 | ucx_test_register(suite, test_sstr); |
179 | 131 | ucx_test_register(suite, test_sstr_len); |
149 | 132 | ucx_test_register(suite, test_sstrcmp); |
133 | ucx_test_register(suite, test_sstrcasecmp); | |
180
2185f19dcc45
added new sstrcat
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
179
diff
changeset
|
134 | ucx_test_register(suite, test_sstrcat); |
149 | 135 | ucx_test_register(suite, test_sstrchr_sstrrchr); |
214
2bc19726c340
added sstrstr() function + improved sstrsplit variants by using sstrprefix()
Mike Becker <universe@uap-core.de>
parents:
206
diff
changeset
|
136 | ucx_test_register(suite, test_sstrstr); |
97
499e1b465d77
fixed execution order of tests + added test for sstrtrim
Mike Becker <universe@uap-core.de>
parents:
94
diff
changeset
|
137 | 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
|
138 | ucx_test_register(suite, test_sstrtrim); |
146
aa376dba1ba8
fixed documentation for netbeans parser + added sstrprefix() and sstrsuffix()
Mike Becker <universe@uap-core.de>
parents:
142
diff
changeset
|
139 | ucx_test_register(suite, test_sstrprefixsuffix); |
364
5577d6c27a33
adds case independent versions of sstrprefix() and sstrsuffix()
Mike Becker <universe@uap-core.de>
parents:
356
diff
changeset
|
140 | ucx_test_register(suite, test_sstrcaseprefixsuffix); |
97
499e1b465d77
fixed execution order of tests + added test for sstrtrim
Mike Becker <universe@uap-core.de>
parents:
94
diff
changeset
|
141 | |
54 | 142 | /* UcxLogger Tests */ |
170 | 143 | ucx_test_register(suite, test_ucx_logger_new); |
54 | 144 | ucx_test_register(suite, test_ucx_logger_log); |
27
22644e2572bc
removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents:
26
diff
changeset
|
145 | |
334
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
146 | /* UcxArray Tests */ |
356
77efe51c6c9a
changes UcxArray from value to pointer semantics
Mike Becker <universe@uap-core.de>
parents:
355
diff
changeset
|
147 | ucx_test_register(suite, test_ucx_array_destroy); |
334
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
148 | ucx_test_register(suite, test_ucx_array_new); |
344
320b962afaf9
reverts deletion of tests for ucx_array_at()
Mike Becker <universe@uap-core.de>
parents:
342
diff
changeset
|
149 | ucx_test_register(suite, test_ucx_array_at); |
354
7fd13b9f8f60
improves array append/prepend/set interface
Mike Becker <universe@uap-core.de>
parents:
344
diff
changeset
|
150 | ucx_test_register(suite, test_ucx_array_append_from); |
7fd13b9f8f60
improves array append/prepend/set interface
Mike Becker <universe@uap-core.de>
parents:
344
diff
changeset
|
151 | ucx_test_register(suite, test_ucx_array_prepend_from); |
7fd13b9f8f60
improves array append/prepend/set interface
Mike Becker <universe@uap-core.de>
parents:
344
diff
changeset
|
152 | ucx_test_register(suite, test_ucx_array_set_from); |
334
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
153 | ucx_test_register(suite, test_ucx_array_append); |
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
154 | ucx_test_register(suite, test_ucx_array_prepend); |
337 | 155 | ucx_test_register(suite, test_ucx_array_set); |
334
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
156 | ucx_test_register(suite, test_ucx_array_autogrow); |
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
157 | ucx_test_register(suite, test_ucx_array_equals); |
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
158 | ucx_test_register(suite, test_ucx_array_concat); |
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
159 | ucx_test_register(suite, test_ucx_array_find); |
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
160 | ucx_test_register(suite, test_ucx_array_contains); |
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
161 | ucx_test_register(suite, test_ucx_array_remove); |
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
162 | ucx_test_register(suite, test_ucx_array_clone); |
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
163 | ucx_test_register(suite, test_ucx_array_sort); |
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
164 | ucx_test_register(suite, test_ucx_array_shrink); |
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
165 | ucx_test_register(suite, test_ucx_array_resize); |
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
166 | ucx_test_register(suite, test_ucx_array_reserve); |
355
d315a068235a
adds array utility functions for user defined arrays
Mike Becker <universe@uap-core.de>
parents:
354
diff
changeset
|
167 | ucx_test_register(suite, test_ucx_array_util_set); |
334
bc81faa9afda
adds array interface and tests
Mike Becker <universe@uap-core.de>
parents:
323
diff
changeset
|
168 | |
123
7fb0f74517c5
changed signature of sstrncat + some documentation for UcxList + new features for UcxList
Mike Becker <universe@uap-core.de>
parents:
122
diff
changeset
|
169 | /* UcxList Tests */ |
122
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
170 | ucx_test_register(suite, test_ucx_list_append); |
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
171 | ucx_test_register(suite, test_ucx_list_prepend); |
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
172 | ucx_test_register(suite, test_ucx_list_equals); |
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
173 | ucx_test_register(suite, test_ucx_list_concat); |
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
174 | ucx_test_register(suite, test_ucx_list_size); |
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
175 | ucx_test_register(suite, test_ucx_list_first); |
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
176 | ucx_test_register(suite, test_ucx_list_last); |
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
177 | ucx_test_register(suite, test_ucx_list_get); |
123
7fb0f74517c5
changed signature of sstrncat + some documentation for UcxList + new features for UcxList
Mike Becker <universe@uap-core.de>
parents:
122
diff
changeset
|
178 | ucx_test_register(suite, test_ucx_list_indexof); |
7fb0f74517c5
changed signature of sstrncat + some documentation for UcxList + new features for UcxList
Mike Becker <universe@uap-core.de>
parents:
122
diff
changeset
|
179 | ucx_test_register(suite, test_ucx_list_find); |
122
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
180 | ucx_test_register(suite, test_ucx_list_contains); |
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
181 | ucx_test_register(suite, test_ucx_list_remove); |
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
182 | ucx_test_register(suite, test_ucx_list_clone); |
540d99722f1f
removal of single linked list implemenation - step 2: renamed UcxDlist to UcxList (new single implementation)
Mike Becker <universe@uap-core.de>
parents:
121
diff
changeset
|
183 | 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
|
184 | |
28 | 185 | /* UcxMemPool Tests */ |
186 | ucx_test_register(suite, test_ucx_mempool_new); | |
187 | ucx_test_register(suite, test_ucx_mempool_malloc); | |
188 | ucx_test_register(suite, test_ucx_mempool_malloc_with_chcap); | |
189 | ucx_test_register(suite, test_ucx_mempool_calloc); | |
113
8693d7874773
added mempool allocator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
112
diff
changeset
|
190 | ucx_test_register(suite, test_ucx_mempool_free); |
28 | 191 | ucx_test_register(suite, test_ucx_mempool_set_destr); |
192 | ucx_test_register(suite, test_ucx_mempool_reg_destr); | |
193 | ucx_test_register(suite, test_ucx_mempool_realloc); | |
185
a48428642b4e
added stack implementation + added g++ config and added some fixes for C++
Mike Becker <universe@uap-core.de>
parents:
180
diff
changeset
|
194 | |
a48428642b4e
added stack implementation + added g++ config and added some fixes for C++
Mike Becker <universe@uap-core.de>
parents:
180
diff
changeset
|
195 | /* UcxStack Tests */ |
a48428642b4e
added stack implementation + added g++ config and added some fixes for C++
Mike Becker <universe@uap-core.de>
parents:
180
diff
changeset
|
196 | ucx_test_register(suite, test_ucx_stack_init); |
a48428642b4e
added stack implementation + added g++ config and added some fixes for C++
Mike Becker <universe@uap-core.de>
parents:
180
diff
changeset
|
197 | ucx_test_register(suite, test_ucx_stack_malloc); |
a48428642b4e
added stack implementation + added g++ config and added some fixes for C++
Mike Becker <universe@uap-core.de>
parents:
180
diff
changeset
|
198 | ucx_test_register(suite, test_ucx_stack_calloc); |
a48428642b4e
added stack implementation + added g++ config and added some fixes for C++
Mike Becker <universe@uap-core.de>
parents:
180
diff
changeset
|
199 | ucx_test_register(suite, test_ucx_stack_free); |
a48428642b4e
added stack implementation + added g++ config and added some fixes for C++
Mike Becker <universe@uap-core.de>
parents:
180
diff
changeset
|
200 | ucx_test_register(suite, test_ucx_stack_realloc); |
a48428642b4e
added stack implementation + added g++ config and added some fixes for C++
Mike Becker <universe@uap-core.de>
parents:
180
diff
changeset
|
201 | ucx_test_register(suite, test_ucx_stack_pop); |
20
db7d9860dbbd
added some map functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
13
diff
changeset
|
202 | |
29
bce0d7f2912b
fixed map with the help of new tests
Mike Becker <universe@uap-core.de>
parents:
28
diff
changeset
|
203 | /* UcxMap Tests */ |
bce0d7f2912b
fixed map with the help of new tests
Mike Becker <universe@uap-core.de>
parents:
28
diff
changeset
|
204 | 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
|
205 | 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
|
206 | 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
|
207 | ucx_test_register(suite, test_ucx_map_get); |
53 | 208 | ucx_test_register(suite, test_ucx_map_remove); |
206 | 209 | ucx_test_register(suite, test_ucx_map_clear); |
31
91ac86557290
added map iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
210 | 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
|
211 | ucx_test_register(suite, test_ucx_map_iterator_chain); |
44 | 212 | 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
|
213 | ucx_test_register(suite, test_ucx_map_rehash); |
108
d2b1e67b2b48
new properties parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
103
diff
changeset
|
214 | |
d2b1e67b2b48
new properties parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
103
diff
changeset
|
215 | /* UcxPropertiesParser Tests */ |
110
1cf71e56f01e
renamed properties functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
216 | ucx_test_register(suite, test_ucx_properties_new); |
1cf71e56f01e
renamed properties functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
217 | ucx_test_register(suite, test_ucx_properties_next); |
1cf71e56f01e
renamed properties functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
218 | ucx_test_register(suite, test_ucx_properties_next_multi); |
1cf71e56f01e
renamed properties functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
219 | ucx_test_register(suite, test_ucx_properties_next_part); |
1cf71e56f01e
renamed properties functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
220 | ucx_test_register(suite, test_ucx_properties_next_long); |
1cf71e56f01e
renamed properties functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
221 | ucx_test_register(suite, test_ucx_properties2map); |
109
75cb6590358b
added properties load/store functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
108
diff
changeset
|
222 | ucx_test_register(suite, test_ucx_properties_load); |
75cb6590358b
added properties load/store functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
108
diff
changeset
|
223 | ucx_test_register(suite, test_ucx_properties_store); |
108
d2b1e67b2b48
new properties parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
103
diff
changeset
|
224 | |
d2b1e67b2b48
new properties parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
103
diff
changeset
|
225 | /* UcxBuffer Tests */ |
166
350a0e3898bd
improved more buffer tests + some doc fixes
Mike Becker <universe@uap-core.de>
parents:
164
diff
changeset
|
226 | ucx_test_register(suite, test_ucx_buffer_new); |
350a0e3898bd
improved more buffer tests + some doc fixes
Mike Becker <universe@uap-core.de>
parents:
164
diff
changeset
|
227 | ucx_test_register(suite, test_ucx_buffer_new_prealloc); |
164
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
228 | ucx_test_register(suite, test_ucx_buffer_eof); |
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
229 | ucx_test_register(suite, test_ucx_buffer_seek_set); |
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
230 | ucx_test_register(suite, test_ucx_buffer_seek_cur); |
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
231 | ucx_test_register(suite, test_ucx_buffer_seek_end); |
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
232 | ucx_test_register(suite, test_ucx_buffer_seek_oob); |
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
233 | ucx_test_register(suite, test_ucx_buffer_seek_invalid); |
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
234 | ucx_test_register(suite, test_ucx_buffer_seek_overflow); |
60
abae4669fba7
renamed UcxMemstream to UcxBuffer
Mike Becker <universe@uap-core.de>
parents:
58
diff
changeset
|
235 | ucx_test_register(suite, test_ucx_buffer_putc); |
164
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
236 | ucx_test_register(suite, test_ucx_buffer_putc_ae); |
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
237 | ucx_test_register(suite, test_ucx_buffer_putc_oob); |
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
238 | ucx_test_register(suite, test_ucx_buffer_putc_oobae); |
1fa3f13f774c
added allocator tests + started refactoring UcxBuffer tests (HINT: don't fix issues yet, complete tests first)
Mike Becker <universe@uap-core.de>
parents:
163
diff
changeset
|
239 | ucx_test_register(suite, test_ucx_buffer_putc_size); |
60
abae4669fba7
renamed UcxMemstream to UcxBuffer
Mike Becker <universe@uap-core.de>
parents:
58
diff
changeset
|
240 | ucx_test_register(suite, test_ucx_buffer_getc); |
166
350a0e3898bd
improved more buffer tests + some doc fixes
Mike Becker <universe@uap-core.de>
parents:
164
diff
changeset
|
241 | ucx_test_register(suite, test_ucx_buffer_read); |
350a0e3898bd
improved more buffer tests + some doc fixes
Mike Becker <universe@uap-core.de>
parents:
164
diff
changeset
|
242 | ucx_test_register(suite, test_ucx_buffer_read_oob); |
167
aed60ba37acf
ucx_buffer_extract tests
Mike Becker <universe@uap-core.de>
parents:
166
diff
changeset
|
243 | ucx_test_register(suite, test_ucx_buffer_extract); |
aed60ba37acf
ucx_buffer_extract tests
Mike Becker <universe@uap-core.de>
parents:
166
diff
changeset
|
244 | ucx_test_register(suite, test_ucx_buffer_extract_oob); |
aed60ba37acf
ucx_buffer_extract tests
Mike Becker <universe@uap-core.de>
parents:
166
diff
changeset
|
245 | ucx_test_register(suite, test_ucx_buffer_extract_overflow); |
168 | 246 | ucx_test_register(suite, test_ucx_buffer_extend); |
60
abae4669fba7
renamed UcxMemstream to UcxBuffer
Mike Becker <universe@uap-core.de>
parents:
58
diff
changeset
|
247 | ucx_test_register(suite, test_ucx_buffer_write); |
168 | 248 | ucx_test_register(suite, test_ucx_buffer_write_oob); |
64
16590c9c497c
added autoextend feature to buffer
Mike Becker <universe@uap-core.de>
parents:
62
diff
changeset
|
249 | ucx_test_register(suite, test_ucx_buffer_write_ax); |
290
d5d6ab809ad3
adds new shift operations for UcxBuffer (including tests and a usage example in modules.md)
Mike Becker <universe@uap-core.de>
parents:
283
diff
changeset
|
250 | ucx_test_register(suite, test_ucx_buffer_shl); |
d5d6ab809ad3
adds new shift operations for UcxBuffer (including tests and a usage example in modules.md)
Mike Becker <universe@uap-core.de>
parents:
283
diff
changeset
|
251 | ucx_test_register(suite, test_ucx_buffer_shr); |
d5d6ab809ad3
adds new shift operations for UcxBuffer (including tests and a usage example in modules.md)
Mike Becker <universe@uap-core.de>
parents:
283
diff
changeset
|
252 | ucx_test_register(suite, test_ucx_buffer_shr_ax); |
142
ee8cb27d8b8e
added printf functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
253 | |
ee8cb27d8b8e
added printf functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
254 | /* Utils Tests*/ |
ee8cb27d8b8e
added printf functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
255 | ucx_test_register(suite, test_ucx_fprintf); |
ee8cb27d8b8e
added printf functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
256 | ucx_test_register(suite, test_ucx_asprintf); |
223
e18884bbad48
fixes ucx_sprintf macro and adds tests for sprintf and bprintf
Mike Becker <universe@uap-core.de>
parents:
214
diff
changeset
|
257 | ucx_test_register(suite, test_ucx_sprintf); |
e18884bbad48
fixes ucx_sprintf macro and adds tests for sprintf and bprintf
Mike Becker <universe@uap-core.de>
parents:
214
diff
changeset
|
258 | ucx_test_register(suite, test_ucx_bprintf); |
168 | 259 | ucx_test_register(suite, test_ucx_stream_copy); |
198
b0f4fb043b47
added test for ucx_avl_put
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
192
diff
changeset
|
260 | |
b0f4fb043b47
added test for ucx_avl_put
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
192
diff
changeset
|
261 | /* AVL Tests */ |
b0f4fb043b47
added test for ucx_avl_put
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
192
diff
changeset
|
262 | ucx_test_register(suite, test_ucx_avl_put); |
200
e3aad99d2d80
added ucx_avl_remove tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
198
diff
changeset
|
263 | ucx_test_register(suite, test_ucx_avl_remove); |
243
2e74828c5e94
adds distance function and ucx_avl_find_node()
Mike Becker <universe@uap-core.de>
parents:
229
diff
changeset
|
264 | ucx_test_register(suite, test_ucx_avl_find); |
245
db732f8c083a
adds AVL predecessor and successor functions
Mike Becker <universe@uap-core.de>
parents:
243
diff
changeset
|
265 | ucx_test_register(suite, test_ucx_avl_traverse); |
56
76caac0da4a0
added memstream to ucx - still little work to do
Mike Becker <universe@uap-core.de>
parents:
55
diff
changeset
|
266 | |
27
22644e2572bc
removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents:
26
diff
changeset
|
267 | ucx_test_run(suite, stdout); |
55
180bc6b18fec
fixed map tests + used tmpfiles in tests
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
268 | fflush(stdout); |
252
6342cbbd1922
removes custom make files and adds autoconf support
Mike Becker <universe@uap-core.de>
parents:
251
diff
changeset
|
269 | |
6342cbbd1922
removes custom make files and adds autoconf support
Mike Becker <universe@uap-core.de>
parents:
251
diff
changeset
|
270 | int exit_code = suite->failure > 0 ? EXIT_FAILURE: EXIT_SUCCESS; |
6342cbbd1922
removes custom make files and adds autoconf support
Mike Becker <universe@uap-core.de>
parents:
251
diff
changeset
|
271 | |
27
22644e2572bc
removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents:
26
diff
changeset
|
272 | ucx_test_suite_free(suite); |
22644e2572bc
removed old foreach + refactored list tests
Mike Becker <universe@uap-core.de>
parents:
26
diff
changeset
|
273 | |
252
6342cbbd1922
removes custom make files and adds autoconf support
Mike Becker <universe@uap-core.de>
parents:
251
diff
changeset
|
274 | return exit_code; |
26
59f147baea31
added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents:
21
diff
changeset
|
275 | } else { |
59f147baea31
added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents:
21
diff
changeset
|
276 | ucx_test_suite_free(suite); |
59f147baea31
added test framework and foreach macro
Mike Becker <universe@uap-core.de>
parents:
21
diff
changeset
|
277 | return EXIT_FAILURE; |
20
db7d9860dbbd
added some map functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
13
diff
changeset
|
278 | } |
0 | 279 | } |
280 |