Changeset 1266 for pjproject/trunk/pjlib/src/pjlib-test/string.c
- Timestamp:
- May 11, 2007 3:14:34 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pjlib-test/string.c
r1235 r1266 97 97 #define STRTEST(res,S1,S2,code) \ 98 98 do { \ 99 s1.ptr=S1; s1.slen= S1?len:0; \100 s2.ptr=S2; s2.slen= S2?len:0; \99 s1.ptr=S1; s1.slen=(S1)?len:0; \ 100 s2.ptr=S2; s2.slen=(S2)?len:0; \ 101 101 pj_get_timestamp(&t1); \ 102 102 if (C(pj_stricmp(&s1,&s2),res)) return code; \ … … 124 124 pj_thread_sleep(0); 125 125 126 #define SNULL 0 127 126 128 /* Compare empty strings. */ 127 129 len=0; 128 130 STRTEST( 0, "","",-500); 129 STRTEST( 0, NULL,"",-502);130 STRTEST( 0, "", NULL,-504);131 STRTEST( 0, NULL,NULL,-506);131 STRTEST( 0, SNULL,"",-502); 132 STRTEST( 0, "",SNULL,-504); 133 STRTEST( 0, SNULL,SNULL,-506); 132 134 STRTEST( 0, "hello","world",-508); 133 135 … … 140 142 STRTEST( 0, "a",buf+1,-512); 141 143 STRTEST( -1, "O", "P", -514); 142 STRTEST(-1, NULL, "a", -516);143 STRTEST(1, "a", NULL, -518);144 STRTEST(-1, SNULL, "a", -516); 145 STRTEST(1, "a", SNULL, -518); 144 146 145 147 /* equal, length=2 … … 267 269 len=0; 268 270 STR_TEST(0, "", "", -400); 269 STR_TEST(0, NULL, "", -405);270 STR_TEST(0, "", NULL, -410);271 STR_TEST(0, NULL,NULL, -415);271 STR_TEST(0, SNULL, "", -405); 272 STR_TEST(0, "", SNULL, -410); 273 STR_TEST(0, SNULL, SNULL, -415); 272 274 STR_TEST(0, "hello", "", -420); 273 STR_TEST(0, "hello", NULL, -425);275 STR_TEST(0, "hello", SNULL, -425); 274 276 275 277 /* Test with length != 0 */ … … 278 280 STR_TEST(1, "12", "1", -435); 279 281 STR_TEST(-1, "1", "12", -440); 280 STR_TEST(-1, NULL, "12", -445);281 STR_TEST(1, "12", NULL, -450);282 STR_TEST(-1, SNULL, "12", -445); 283 STR_TEST(1, "12", SNULL, -450); 282 284 283 285 return 0; … … 296 298 int i; 297 299 298 pool = pj_pool_create(mem, NULL, 4096, 0,NULL);300 pool = pj_pool_create(mem, SNULL, 4096, 0, SNULL); 299 301 if (!pool) return -5; 300 302 … … 368 370 s5 = pj_str("123456"); 369 371 370 pj_strtoul2(&s5, NULL, 10); /* Crash test */372 pj_strtoul2(&s5, SNULL, 10); /* Crash test */ 371 373 372 374 if (pj_strtoul2(&s5, &s4, 10) != 123456UL) … … 382 384 if (s4.slen != 4) 383 385 return -294; 384 if (s4.ptr == NULL || *s4.ptr != 'A')386 if (s4.ptr == SNULL || *s4.ptr != 'A') 385 387 return -295; 386 388 if (pj_strtoul2(&s5, &s4, 16) != 0x123ABCDUL)
Note: See TracChangeset
for help on using the changeset viewer.