test/string_tests.c

changeset 233
bd58fdde142d
parent 232
5f2d650eade7
child 236
ffc6d0910342
equal deleted inserted replaced
232:5f2d650eade7 233:bd58fdde142d
297 sstr_t ewdebtest = ST("a,b,c,"); 297 sstr_t ewdebtest = ST("a,b,c,");
298 list = sstrsplit(ewdebtest, S(","), &n); 298 list = sstrsplit(ewdebtest, S(","), &n);
299 UCX_TEST_ASSERT(n == 3, "ewdeb, list length must be 3"); 299 UCX_TEST_ASSERT(n == 3, "ewdeb, list length must be 3");
300 UCX_TEST_ASSERT(strcmp(list[0].ptr, "a") == 0, "ewdeb, fst item corrupt"); 300 UCX_TEST_ASSERT(strcmp(list[0].ptr, "a") == 0, "ewdeb, fst item corrupt");
301 UCX_TEST_ASSERT(strcmp(list[1].ptr, "b") == 0, "ewdeb, snd item corrupt"); 301 UCX_TEST_ASSERT(strcmp(list[1].ptr, "b") == 0, "ewdeb, snd item corrupt");
302 UCX_TEST_ASSERT(strcmp(list[2].ptr, "c") == 0, "ewdeb, trd item corrupt"); 302 UCX_TEST_ASSERT(strcmp(list[2].ptr, "c,") == 0, "ewdeb, trd item corrupt");
303 for(int i=0;i<n;i++) { 303 for(int i=0;i<n;i++) {
304 free(list[i].ptr); 304 free(list[i].ptr);
305 } 305 }
306 free(list); 306 free(list);
307 307

mercurial