19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#ifndef _WIN32
#define ZD "%zd"
#else
#define ZD "%u"
#endif
#define NUM_TESTS 23
#define SUCCESS \
{ \
printf("\r\033[1;%dmTests successful: " ZD "/%d\033[0m", \
(i == NUM_TESTS - 1 ? 32 : 33), i + 1, NUM_TESTS); \
fflush(stdout); \
}
#define FAIL \
|
|
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#ifndef _WIN32
#define ZD "%zd"
#else
#define ZD "%u"
#endif
#define NUM_TESTS 27
#define SUCCESS \
{ \
printf("\r\033[1;%dmTests successful: " ZD "/%d\033[0m", \
(i == NUM_TESTS - 1 ? 32 : 33), i + 1, NUM_TESTS); \
fflush(stdout); \
}
#define FAIL \
|
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
after: [list first]->next];
for (iter = [list first], j = 0; iter != NULL; iter = iter->next, j++)
CHECK([iter->object isEqual: strings[j]])
CHECK([list count] == 3)
list2 = [OFList list];
[list2 append: strings[0]];
[list2 append: strings[1]];
[list2 append: strings[2]];
CHECK([list2 isEqual: list]);
|
>
>
>
>
>
>
>
>
>
|
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
after: [list first]->next];
for (iter = [list first], j = 0; iter != NULL; iter = iter->next, j++)
CHECK([iter->object isEqual: strings[j]])
CHECK([list count] == 3)
list2 = [list copy];
CHECK([list2 count] == 3)
[list2 remove: [list2 last]];
CHECK([list2 count] == 2)
[list2 remove: [list2 first]->next];
CHECK([list2 count] == 1)
[list2 remove: [list2 first]];
CHECK([list2 count] == 0)
list2 = [OFList list];
[list2 append: strings[0]];
[list2 append: strings[1]];
[list2 append: strings[2]];
CHECK([list2 isEqual: list]);
|