Sat, 18 Feb 2012 15:50:43 +0100
added test framework and foreach macro
| 9 | 1 | /* |
| 2 | * tests of list implementation | |
| 3 | */ | |
| 4 | ||
| 5 | #include <stdio.h> | |
| 6 | #include <stdlib.h> | |
| 7 | ||
| 8 | #include "ucx/list.h" | |
| 9 | #include "ucx/dlist.h" | |
| 10 | ||
|
24
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
11 | struct foreach_testdata { |
| 9 | 12 | int values[3]; |
| 13 | int i; | |
| 14 | }; | |
| 15 | ||
|
24
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
16 | void* int_cpy(void* source, void* data) { |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
17 | void *dest = malloc(sizeof(int)); |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
18 | if (dest != NULL) { |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
19 | *((int*)dest) = *((int*)source); |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
20 | } |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
21 | return dest; |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
22 | } |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
23 | |
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
24 | int int_cmp(void* e1, void *e2, void *data) { |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
25 | if (e1 == NULL || e2 == NULL) return (e1 == e2) ? 0 : -1; |
|
24
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
26 | |
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
27 | int *i1 = (int*)e1, *i2 = (int*)e2; |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
28 | int r = (*i1) - (*i2); |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
29 | return (r < 0) ? -1 : (r == 0 ? 0 : 1); |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
30 | } |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
31 | |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
32 | int dlist_tests_foreach(void *v, void *custom) { |
| 9 | 33 | UcxDlist *dl = (UcxDlist*)v; |
|
24
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
34 | struct foreach_testdata *tdata = (struct foreach_testdata*)custom; |
| 9 | 35 | |
| 36 | tdata->values[tdata->i] = *(int*)dl->data; | |
| 37 | tdata->i++; | |
|
24
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
38 | |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
39 | return 0; |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
40 | } |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
41 | |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
42 | int dlist_free_content(void *v, void *custom) { |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
43 | UcxDlist *dl = (UcxDlist*)v; |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
44 | free(dl->data); |
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
45 | return 0; |
| 9 | 46 | } |
| 47 | ||
| 11 | 48 | int dlist_tests() { |
| 9 | 49 | int r = 0; |
| 50 | int v[8]; | |
| 51 | UcxDlist *dl = NULL; | |
| 52 | // build list 0,1,2,3,4,5,6,7 | |
| 11 | 53 | printf(" Test ucx_dlist_append\n"); |
| 54 | fflush(stdout); | |
| 9 | 55 | for(int i=0;i<8;i++) { |
| 56 | v[i] = i; | |
| 57 | dl = ucx_dlist_append(dl, &v[i]); | |
| 58 | } | |
| 59 | ||
| 11 | 60 | printf(" Test ucx_dlist_get\n"); |
| 61 | fflush(stdout); | |
| 9 | 62 | for(int i=0;i<8;i++) { |
| 63 | UcxDlist *elm = ucx_dlist_get(dl, i); | |
| 64 | if(elm == NULL) { | |
| 65 | fprintf(stderr, "ucx_dlist_get failed: element is NULL\n"); | |
| 11 | 66 | r--; |
|
24
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
67 | } else if(elm->data == NULL) { |
| 9 | 68 | fprintf(stderr, "ucx_dlist_get failed: data is NULL\n"); |
| 11 | 69 | r--; |
|
24
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
70 | } else { |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
71 | int *data = (int*)elm->data; |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
72 | if(*data != i) { |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
73 | fprintf(stderr, "ucx_dlist_get failed with index %d\n", i); |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
74 | r--; |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
75 | } |
| 9 | 76 | } |
| 77 | } | |
| 78 | ||
| 11 | 79 | printf(" Test ucx_dlist_free\n"); |
| 80 | fflush(stdout); | |
| 81 | ucx_dlist_free(dl); | |
| 82 | ||
| 9 | 83 | dl = NULL; |
| 84 | // build list 4,0,4 | |
| 11 | 85 | printf(" Test ucx_dlist_prepend\n"); |
| 9 | 86 | dl = ucx_dlist_prepend(dl, &v[0]); |
| 11 | 87 | dl = ucx_dlist_prepend(dl, &v[4]); |
| 88 | dl = ucx_dlist_append(dl, &v[4]); | |
| 9 | 89 | |
|
24
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
90 | struct foreach_testdata tdata; |
| 9 | 91 | tdata.i = 0; |
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
92 | ucx_dlist_foreach(dl, dlist_tests_foreach, &tdata); |
| 9 | 93 | |
| 94 | if(tdata.values[0] != 4 || tdata.values[1] != 0 || tdata.values[2] != 4) { | |
| 95 | fprintf(stderr, "prepend/append test failed\n"); | |
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
96 | fprintf(stderr, "content: [%d, %d, %d]\n", |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
97 | tdata.values[0], tdata.values[1], tdata.values[2]); |
| 11 | 98 | r--; |
| 9 | 99 | } |
| 100 | ||
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
101 | printf(" Test ucx_dlist_equals\n"); |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
102 | UcxDlist *dl2 = NULL; |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
103 | dl2 = ucx_dlist_append(dl2, &v[4]); |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
104 | dl2 = ucx_dlist_append(dl2, &v[0]); |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
105 | dl2 = ucx_dlist_append(dl2, &v[4]); |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
106 | if (!ucx_dlist_equals(dl, dl2, NULL, NULL)) { |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
107 | fprintf(stderr, "ucx_dlist_equals failed (false negative)\n"); |
|
19
cdd7a3173249
Removed linked list from tests (assume that they are correct if the dlist tests are correct)
Mike Becker <universe@uap-core.de>
parents:
18
diff
changeset
|
108 | r--; |
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
109 | } |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
110 | dl2->next->data = NULL; |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
111 | if (ucx_dlist_equals(dl, dl2, NULL, NULL)) { |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
112 | fprintf(stderr, "ucx_dlist_equals failed (false positive)\n"); |
|
19
cdd7a3173249
Removed linked list from tests (assume that they are correct if the dlist tests are correct)
Mike Becker <universe@uap-core.de>
parents:
18
diff
changeset
|
113 | r--; |
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
114 | } |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
115 | dl2->next->data = &(tdata.values[1]); |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
116 | if (!ucx_dlist_equals(dl, dl2, int_cmp, NULL)) { |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
117 | fprintf(stderr, "ucx_dlist_equals failed (cmp_func false negative)\n"); |
|
19
cdd7a3173249
Removed linked list from tests (assume that they are correct if the dlist tests are correct)
Mike Becker <universe@uap-core.de>
parents:
18
diff
changeset
|
118 | r--; |
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
119 | } |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
120 | if (ucx_dlist_equals(dl, dl2, NULL, NULL)) { |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
121 | fprintf(stderr, "ucx_dlist_equals failed (cmp_func false positive)\n"); |
|
19
cdd7a3173249
Removed linked list from tests (assume that they are correct if the dlist tests are correct)
Mike Becker <universe@uap-core.de>
parents:
18
diff
changeset
|
122 | r--; |
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
123 | } |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
124 | ucx_dlist_free(dl2); |
|
24
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
125 | |
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
126 | printf(" Test ucx_dlist_clone\n"); |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
127 | dl2 = ucx_dlist_clone(dl, NULL, NULL); |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
128 | if (!ucx_dlist_equals(dl, dl2, NULL, NULL)) { |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
129 | fprintf(stderr, "ucx_dlist_clone (without copy) failed\n"); |
|
19
cdd7a3173249
Removed linked list from tests (assume that they are correct if the dlist tests are correct)
Mike Becker <universe@uap-core.de>
parents:
18
diff
changeset
|
130 | r--; |
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
131 | } |
|
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
132 | ucx_dlist_free(dl2); |
|
24
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
133 | |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
134 | printf(" Test ucx_dlist_clone with copy\n"); |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
135 | dl2 = ucx_dlist_clone(dl, int_cpy, NULL); |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
136 | if (!ucx_dlist_equals(dl, dl2, NULL, NULL)) { |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
137 | if (!ucx_dlist_equals(dl, dl2, int_cmp, NULL)) { |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
138 | fprintf(stderr, "ucx_dlist_clone (with copy) failed (compare)\n"); |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
139 | r--; |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
140 | } |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
141 | } else { |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
142 | fprintf(stderr, "ucx_dlist_clone (with copy) failed (identity)\n"); |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
143 | r--; |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
144 | } |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
145 | ucx_dlist_foreach(dl, dlist_free_content, NULL); |
|
e04822101291
changed make clean + added dlist_clone with copy test + added va_end statements to string.c
Mike Becker <universe@uap-core.de>
parents:
22
diff
changeset
|
146 | ucx_dlist_free(dl2); |
|
18
69636f81db31
added clone and equals to lists
Mike Becker <universe@uap-core.de>
parents:
11
diff
changeset
|
147 | |
|
22
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
148 | ucx_dlist_free(dl); |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
149 | |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
150 | dl = NULL; |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
151 | printf(" Test ucx_dlist_remove\n"); |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
152 | dl = ucx_dlist_append(dl, &v[4]); |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
153 | dl = ucx_dlist_append(dl, &v[0]); |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
154 | dl = ucx_dlist_append(dl, &v[3]); |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
155 | dl = ucx_dlist_remove(dl, dl->next); |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
156 | if (ucx_dlist_size(dl) == 2) { |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
157 | if ((*((int*)(dl->data)) != 4) || (*((int*)(dl->next->data)) != 3)) { |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
158 | fprintf(stderr, "ucx_dlist_remove failed (wrong data)\n"); |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
159 | r--; |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
160 | } |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
161 | } else { |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
162 | fprintf(stderr, "ucx_dlist_remove failed (wrong size)\n"); |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
163 | r--; |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
164 | } |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
165 | dl = ucx_dlist_remove(dl, dl); |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
166 | if (ucx_dlist_size(dl) == 1) { |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
167 | if ((*((int*)(dl->data)) != 3)) { |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
168 | fprintf(stderr, "ucx_dlist_remove first failed (wrong data)\n"); |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
169 | r--; |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
170 | } |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
171 | } else { |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
172 | fprintf(stderr, "ucx_dlist_remove first failed (wrong size)\n"); |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
173 | r--; |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
174 | } |
|
76cdd8209f1f
added ucx_dlist_remove and tests + fixed makefile error
Mike Becker <universe@uap-core.de>
parents:
19
diff
changeset
|
175 | |
| 9 | 176 | return r; |
| 177 | } | |
| 11 | 178 |