Home | History | Annotate | Download | only in tests

Lines Matching defs:CHECK

11 #define  CHECK(x) \
17 CHECK( ! VG_STREQ(NULL, NULL) ); // Nb: strcmp() considers these equal
18 CHECK( ! VG_STREQ(NULL, "ab") ); // Nb: strcmp() seg faults on this
19 CHECK( ! VG_STREQ("ab", NULL) ); // Nb: strcmp() seg faults on this
20 CHECK( ! VG_STREQ("", "a") );
21 CHECK( ! VG_STREQ("a", "") );
22 CHECK( ! VG_STREQ("abc", "abcd"));
23 CHECK( ! VG_STREQ("abcd", "abc") );
24 CHECK( ! VG_STREQ("Abcd", "abcd"));
25 CHECK( ! VG_STREQ("abcd", "Abcd"));
27 CHECK( VG_STREQ("", "") );
28 CHECK( VG_STREQ("a", "a") );
29 CHECK( VG_STREQ("abcd", "abcd") );
34 CHECK( ! VG_STREQN(0, NULL, NULL) );
35 CHECK( ! VG_STREQN(5, NULL, NULL) );
36 CHECK( ! VG_STREQN(0, NULL, "ab") );
37 CHECK( ! VG_STREQN(5, NULL, "ab") );
38 CHECK( ! VG_STREQN(0, "ab", NULL) );
39 CHECK( ! VG_STREQN(1, "", "a") );
40 CHECK( ! VG_STREQN(1, "a", "") );
41 CHECK( ! VG_STREQN(4, "abc", "abcd"));
42 CHECK( ! VG_STREQN(4, "abcd", "abc") );
43 CHECK( ! VG_STREQN(1, "Abcd", "abcd"));
44 CHECK( ! VG_STREQN(4, "Abcd", "abcd"));
45 CHECK( ! VG_STREQN(4, "abcd", "abce"));
46 CHECK( ! VG_STREQN(9, "abcd", "abce"));
48 CHECK( VG_STREQN(0, "", "") );
49 CHECK( VG_STREQN(1, "", "") );
50 CHECK( VG_STREQN(0, "a", "a") );
51 CHECK( VG_STREQN(1, "a", "a") );
52 CHECK( VG_STREQN(2, "a", "a") );
53 CHECK( VG_STREQN(9, "a", "a") );
54 CHECK( VG_STREQN(1, "ab", "ac"));
55 CHECK( VG_STREQN(3, "abcd", "abce"));
65 CHECK( VG_IS_2_ALIGNED(0x0) );
66 CHECK( ! VG_IS_2_ALIGNED(0x1) );
67 CHECK( VG_IS_2_ALIGNED(0x2) );
68 CHECK( ! VG_IS_2_ALIGNED(0x3) );
69 CHECK( VG_IS_2_ALIGNED(0x4) );
70 CHECK( ! VG_IS_2_ALIGNED(0x5) );
71 CHECK( VG_IS_2_ALIGNED(0x6) );
72 CHECK( ! VG_IS_2_ALIGNED(0x7) );
73 CHECK( VG_IS_2_ALIGNED(0x8) );
74 CHECK( ! VG_IS_2_ALIGNED(0x9) );
75 CHECK( VG_IS_2_ALIGNED(0xa) );
76 CHECK( ! VG_IS_2_ALIGNED(0xb) );
77 CHECK( VG_IS_2_ALIGNED(0xc) );
78 CHECK( ! VG_IS_2_ALIGNED(0xd) );
79 CHECK( VG_IS_2_ALIGNED(0xe) );
80 CHECK( ! VG_IS_2_ALIGNED(0xf) );
82 CHECK( VG_IS_4_ALIGNED(0x0) );
83 CHECK( ! VG_IS_4_ALIGNED(0x1) );
84 CHECK( ! VG_IS_4_ALIGNED(0x2) );
85 CHECK( ! VG_IS_4_ALIGNED(0x3) );
86 CHECK( VG_IS_4_ALIGNED(0x4) );
87 CHECK( ! VG_IS_4_ALIGNED(0x5) );
88 CHECK( ! VG_IS_4_ALIGNED(0x6) );
89 CHECK( ! VG_IS_4_ALIGNED(0x7) );
90 CHECK( VG_IS_4_ALIGNED(0x8) );
91 CHECK( ! VG_IS_4_ALIGNED(0x9) );
92 CHECK( ! VG_IS_4_ALIGNED(0xa) );
93 CHECK( ! VG_IS_4_ALIGNED(0xb) );
94 CHECK( VG_IS_4_ALIGNED(0xc) );
95 CHECK( ! VG_IS_4_ALIGNED(0xd) );
96 CHECK( ! VG_IS_4_ALIGNED(0xe) );
97 CHECK( ! VG_IS_4_ALIGNED(0xf) );
99 CHECK( VG_IS_8_ALIGNED(0x0) );
100 CHECK( ! VG_IS_8_ALIGNED(0x1) );
101 CHECK( ! VG_IS_8_ALIGNED(0x2) );
102 CHECK( ! VG_IS_8_ALIGNED(0x3) );
103 CHECK( ! VG_IS_8_ALIGNED(0x4) );
104 CHECK( ! VG_IS_8_ALIGNED(0x5) );
105 CHECK( ! VG_IS_8_ALIGNED(0x6) );
106 CHECK( ! VG_IS_8_ALIGNED(0x7) );
107 CHECK( VG_IS_8_ALIGNED(0x8) );
108 CHECK( ! VG_IS_8_ALIGNED(0x9) );
109 CHECK( ! VG_IS_8_ALIGNED(0xa) );
110 CHECK( ! VG_IS_8_ALIGNED(0xb) );
111 CHECK( ! VG_IS_8_ALIGNED(0xc) );
112 CHECK( ! VG_IS_8_ALIGNED(0xd) );
113 CHECK( ! VG_IS_8_ALIGNED(0xe) );
114 CHECK( ! VG_IS_8_ALIGNED(0xf) );
116 CHECK( VG_IS_16_ALIGNED(0x0) );
117 CHECK( ! VG_IS_16_ALIGNED(0x1) );
118 CHECK( ! VG_IS_16_ALIGNED(0x2) );
119 CHECK( ! VG_IS_16_ALIGNED(0x3) );
120 CHECK( ! VG_IS_16_ALIGNED(0x4) );
121 CHECK( ! VG_IS_16_ALIGNED(0x5) );
122 CHECK( ! VG_IS_16_ALIGNED(0x6) );
123 CHECK( ! VG_IS_16_ALIGNED(0x7) );
124 CHECK( ! VG_IS_16_ALIGNED(0x8) );
125 CHECK( ! VG_IS_16_ALIGNED(0x9) );
126 CHECK( ! VG_IS_16_ALIGNED(0xa) );
127 CHECK( ! VG_IS_16_ALIGNED(0xb) );
128 CHECK( ! VG_IS_16_ALIGNED(0xc) );
129 CHECK( ! VG_IS_16_ALIGNED(0xd) );
130 CHECK( ! VG_IS_16_ALIGNED(0xe) );
131 CHECK( ! VG_IS_16_ALIGNED(0xf) );
133 CHECK( VG_IS_WORD_ALIGNED(0x0) );
134 CHECK( ! VG_IS_WORD_ALIGNED(0x1) );
135 CHECK( ! VG_IS_WORD_ALIGNED(0x2) );
136 CHECK( ! VG_IS_WORD_ALIGNED(0x3) );
138 CHECK( ! VG_IS_WORD_ALIGNED(0x5) );
139 CHECK( ! VG_IS_WORD_ALIGNED(0x6) );
140 CHECK( ! VG_IS_WORD_ALIGNED(0x7) );
141 CHECK( VG_IS_WORD_ALIGNED(0x8) );
142 CHECK( ! VG_IS_WORD_ALIGNED(0x9) );
143 CHECK( ! VG_IS_WORD_ALIGNED(0xa) );
144 CHECK( ! VG_IS_WORD_ALIGNED(0xb) );
146 CHECK( ! VG_IS_WORD_ALIGNED(0xd) );
147 CHECK( ! VG_IS_WORD_ALIGNED(0xe) );
148 CHECK( ! VG_IS_WORD_ALIGNED(0xf) );
150 CHECK( VG_IS_WORD_ALIGNED(0x4) );
151 CHECK( VG_IS_WORD_ALIGNED(0xc) );
153 CHECK( ! VG_IS_WORD_ALIGNED(0x4) );
154 CHECK( ! VG_IS_WORD_ALIGNED(0xc) );
159 CHECK( VG_IS_PAGE_ALIGNED(0x0) );
160 CHECK( ! VG_IS_PAGE_ALIGNED(0x1) );
161 CHECK( ! VG_IS_PAGE_ALIGNED(0x2) );
162 CHECK( ! VG_IS_PAGE_ALIGNED(0x3) );
163 CHECK( ! VG_IS_PAGE_ALIGNED(0x4) );
164 CHECK( ! VG_IS_PAGE_ALIGNED(VKI_PAGE_SIZE-1) );
165 CHECK( VG_IS_PAGE_ALIGNED(VKI_PAGE_SIZE ) );
166 CHECK( ! VG_IS_PAGE_ALIGNED(VKI_PAGE_SIZE+1) );
171 CHECK( 0 == VG_ROUNDDN(0, 1) );
172 CHECK( 1 == VG_ROUNDDN(1, 1) );
173 CHECK( 2 == VG_ROUNDDN(2, 1) );
174 CHECK( 3 == VG_ROUNDDN(3, 1) );
175 CHECK( 4 == VG_ROUNDDN(4, 1) );
176 CHECK( 5 == VG_ROUNDDN(5, 1) );
177 CHECK( 6 == VG_ROUNDDN(6, 1) );
178 CHECK( 7 == VG_ROUNDDN(7, 1) );
180 CHECK( 0 == VG_ROUNDUP(0, 1) );
181 CHECK( 1 == VG_ROUNDUP(1, 1) );
182 CHECK( 2 == VG_ROUNDUP(2, 1) );
183 CHECK( 3 == VG_ROUNDUP(3, 1) );
184 CHECK( 4 == VG_ROUNDUP(4, 1) );
185 CHECK( 5 == VG_ROUNDUP(5, 1) );
186 CHECK( 6 == VG_ROUNDUP(6, 1) );
187 CHECK( 7 == VG_ROUNDUP(7, 1) );
189 CHECK( 0 == VG_ROUNDDN(0, 2) );
190 CHECK( 0 == VG_ROUNDDN(1, 2) );
191 CHECK( 2 == VG_ROUNDDN(2, 2) );
192 CHECK( 2 == VG_ROUNDDN(3, 2) );
193 CHECK( 4 == VG_ROUNDDN(4, 2) );
194 CHECK( 4 == VG_ROUNDDN(5, 2) );
195 CHECK( 6 == VG_ROUNDDN(6, 2) );
196 CHECK( 6 == VG_ROUNDDN(7, 2) );
198 CHECK( 0 == VG_ROUNDUP(0, 2) );
199 CHECK( 2 == VG_ROUNDUP(1, 2) );
200 CHECK( 2 == VG_ROUNDUP(2, 2) );
201 CHECK( 4 == VG_ROUNDUP(3, 2) );
202 CHECK( 4 == VG_ROUNDUP(4, 2) );
203 CHECK( 6 == VG_ROUNDUP(5, 2) );
204 CHECK( 6 == VG_ROUNDUP(6, 2) );
205 CHECK( 8 == VG_ROUNDUP(7, 2) );
207 CHECK( 0 == VG_ROUNDDN(0, 4) );
208 CHECK( 0 == VG_ROUNDDN(1, 4) );
209 CHECK( 0 == VG_ROUNDDN(2, 4) );
210 CHECK( 0 == VG_ROUNDDN(3, 4) );
211 CHECK( 4 == VG_ROUNDDN(4, 4) );
212 CHECK( 4 == VG_ROUNDDN(5, 4) );
213 CHECK( 4 == VG_ROUNDDN(6, 4) );
214 CHECK( 4 == VG_ROUNDDN(7, 4) );
216 CHECK( 0 == VG_ROUNDUP(0, 4) );
217 CHECK( 4 == VG_ROUNDUP(1, 4) );
218 CHECK( 4 == VG_ROUNDUP(2, 4) );
219 CHECK( 4 == VG_ROUNDUP(3, 4) );
220 CHECK( 4 == VG_ROUNDUP(4, 4) );
221 CHECK( 8 == VG_ROUNDUP(5, 4) );
222 CHECK( 8 == VG_ROUNDUP(6, 4) );
223 CHECK( 8 == VG_ROUNDUP(7, 4) );
225 CHECK( 0 == VG_ROUNDDN(0, 8) );
226 CHECK( 0 == VG_ROUNDDN(1, 8) );
227 CHECK( 0 == VG_ROUNDDN(2, 8) );
228 CHECK( 0 == VG_ROUNDDN(3, 8) );
229 CHECK( 0 == VG_ROUNDDN(4, 8) );
230 CHECK( 0 == VG_ROUNDDN(5, 8) );
231 CHECK( 0 == VG_ROUNDDN(6, 8) );
232 CHECK( 0 == VG_ROUNDDN(7, 8) );
234 CHECK( 0 == VG_ROUNDUP(0, 8) );
235 CHECK( 8 == VG_ROUNDUP(1, 8) );
236 CHECK( 8 == VG_ROUNDUP(2, 8) );
237 CHECK( 8 == VG_ROUNDUP(3, 8) );
238 CHECK( 8 == VG_ROUNDUP(4, 8) );
239 CHECK( 8 == VG_ROUNDUP(5, 8) );
240 CHECK( 8 == VG_ROUNDUP(6, 8) );
241 CHECK( 8 == VG_ROUNDUP(7, 8) );
243 CHECK( 0 == VG_PGROUNDDN(0) );
244 CHECK( 0 == VG_PGROUNDDN(1) );
245 CHECK( 0 == VG_PGROUNDDN(2) );
246 CHECK( 0 == VG_PGROUNDDN(3) );
247 CHECK( 0 == VG_PGROUNDDN(4) );
248 CHECK( 0 == VG_PGROUNDDN(VKI_PAGE_SIZE-1) );
249 CHECK( VKI_PAGE_SIZE == VG_PGROUNDDN(VKI_PAGE_SIZE ) );
250 CHECK( VKI_PAGE_SIZE == VG_PGROUNDDN(VKI_PAGE_SIZE+1) );
252 CHECK( 0 == VG_PGROUNDUP(0) );
253 CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(1) );
254 CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(2) );
255 CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(3) );
256 CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(4) );
257 CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(VKI_PAGE_SIZE-1) );
258 CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(VKI_PAGE_SIZE ) );
259 CHECK( VKI_PAGE_SIZE*2 == VG_PGROUNDUP(VKI_PAGE_SIZE+1) );
264 CHECK( VG_(isspace)(' ') );
265 CHECK( VG_(isspace)('\n') );
266 CHECK( VG_(isspace)('\t') );
267 CHECK( ! VG_(isspace)('3') );
268 CHECK( ! VG_(isspace)('x') );
273 CHECK( VG_(isdigit)('0') );
274 CHECK( VG_(isdigit)('1') );
275 CHECK( VG_(isdigit)('5') );
276 CHECK( VG_(isdigit)('9') );
277 CHECK( ! VG_(isdigit)('a') );
278 CHECK( ! VG_(isdigit)('!') );
284 CHECK( is_dec_digit('0', &x) && 0 == x );
285 CHECK( is_dec_digit('1', &x) && 1 == x );
286 CHECK( is_dec_digit('9', &x) && 9 == x );
292 CHECK( is_hex_digit('0', &x) && 0 == x );
293 CHECK( is_hex_digit('1', &x) && 1 == x );
294 CHECK( is_hex_digit('9', &x) && 9 == x );
295 CHECK( is_hex_digit('a', &x) && 10 == x );
296 CHECK( is_hex_digit('f', &x) && 15 == x );
297 CHECK( is_hex_digit('A', &x) && 10 == x );
298 CHECK( is_hex_digit('F', &x) && 15 == x );
351 CHECK(a[i].res == res1 && a[i].endptr_val == *endptr1);
352 CHECK(res2 == res1 && *endptr2 == *endptr1);
406 CHECK(a[i].res == res1 && a[i].endptr_val == *endptr1);
407 CHECK(res2 == res1 && *endptr2 == *endptr1);
417 CHECK( -1 == VG_(log2)(0) );
418 CHECK( 0 == VG_(log2)(1) );
419 CHECK( 1 == VG_(log2)(2) );
420 CHECK( -1 == VG_(log2)(3) );
421 CHECK( 2 == VG_(log2)(4) );
422 CHECK( -1 == VG_(log2)(5) );
423 CHECK( -1 == VG_(log2)(6) );
424 CHECK( -1 == VG_(log2)(7) );
425 CHECK( 3 == VG_(log2)(8) );
427 CHECK( -1 == VG_(log2)( 15) );
428 CHECK( 4 == VG_(log2)( 16) );
429 CHECK( -1 == VG_(log2)( 17) );
431 CHECK( -1 == VG_(log2)( 63) );
432 CHECK( 6 == VG_(log2)( 64) );
433 CHECK( -1 == VG_(log2)( 65) );
435 CHECK( -1 == VG_(log2)(255) );
436 CHECK( 8 == VG_(log2)(256) );
437 CHECK( -1 == VG_(log2)(257) );
439 CHECK( -1 == VG_(log2)(65535) );
440 CHECK( 16 == VG_(log2)(65536) );
441 CHECK( -1 == VG_(log2)(65537) );
443 CHECK( -1 == VG_(log2)(16777215) );
444 CHECK( 24 == VG_(log2)(16777216) );
445 CHECK( -1 == VG_(log2)(16777217) );
447 CHECK( -1 == VG_(log2)(2147483647U) );
448 CHECK( 31 == VG_(log2)(2147483648U) );
449 CHECK
451 CHECK( -1 == VG_(log2)(4294967295U) ); // Max UInt