# HG changeset patch # User Mike Becker # Date 1736965973 -3600 # Node ID 20c9212b3a4736a59e3e592c918d58b3a8282f00 # Parent 6090c455b8df57b0244c9374add74d66ee1c78be fix mistake string test: CX_STR should be used for initializers only diff -r 6090c455b8df -r 20c9212b3a47 tests/test_string.c --- a/tests/test_string.c Tue Jan 14 21:40:29 2025 +0100 +++ b/tests/test_string.c Wed Jan 15 19:32:53 2025 +0100 @@ -120,26 +120,26 @@ CX_TEST_ASSERT(0 == cx_strcmp(sub, str)); sub = cx_strsubs(str, 2); - CX_TEST_ASSERT(0 == cx_strcmp(sub, CX_STR("test string"))); + CX_TEST_ASSERT(0 == cx_strcmp(sub, cx_str("test string"))); sub = cx_strsubs(str, 7); - CX_TEST_ASSERT(0 == cx_strcmp(sub, CX_STR("string"))); + CX_TEST_ASSERT(0 == cx_strcmp(sub, cx_str("string"))); sub = cx_strsubs(str, 15); - CX_TEST_ASSERT(0 == cx_strcmp(sub, CX_STR(""))); + CX_TEST_ASSERT(0 == cx_strcmp(sub, cx_str(""))); sub = cx_strsubsl(str, 2, 4); - CX_TEST_ASSERT(0 == cx_strcmp(sub, CX_STR("test"))); + CX_TEST_ASSERT(0 == cx_strcmp(sub, cx_str("test"))); sub = cx_strsubsl(str, 7, 3); - CX_TEST_ASSERT(0 == cx_strcmp(sub, CX_STR("str"))); + CX_TEST_ASSERT(0 == cx_strcmp(sub, cx_str("str"))); sub = cx_strsubsl(str, 7, 20); - CX_TEST_ASSERT(0 == cx_strcmp(sub, CX_STR("string"))); + CX_TEST_ASSERT(0 == cx_strcmp(sub, cx_str("string"))); // just for coverage, call the _m variant cxmutstr m = cx_strsubs_m(cx_mutstrn(NULL, 0), 0); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(m), CX_STR(""))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(m), cx_str(""))); } } @@ -156,7 +156,7 @@ // just for coverage, call the _m variant cxmutstr m = cx_strchr_m(cx_mutstrn(NULL, 0), 'a'); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(m), CX_STR(""))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(m), cx_str(""))); } } @@ -173,7 +173,7 @@ // just for coverage, call the _m variant cxmutstr m = cx_strrchr_m(cx_mutstrn(NULL, 0), 'a'); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(m), CX_STR(""))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(m), cx_str(""))); } } @@ -215,14 +215,14 @@ cxmutstr longstrresult = cx_mutstrn(longstrc+256, longstrlen-256); CX_TEST_DO { - cxstring notfound = cx_strstr(str, CX_STR("no match")); + cxstring notfound = cx_strstr(str, cx_str("no match")); CX_TEST_ASSERT(notfound.length == 0); - cxstring result = cx_strstr(str, CX_STR("match")); + cxstring result = cx_strstr(str, cx_str("match")); CX_TEST_ASSERT(result.length == 20); CX_TEST_ASSERT(0 == strcmp(result.ptr, "match in this string")); - result = cx_strstr(str, CX_STR("")); + result = cx_strstr(str, cx_str("")); CX_TEST_ASSERT(result.length == str.length); CX_TEST_ASSERT(0 == strcmp(result.ptr, str.ptr)); @@ -238,18 +238,18 @@ CX_TEST(test_strcmp) { cxstring str = CX_STR("compare this"); CX_TEST_DO { - CX_TEST_ASSERT(0 == cx_strcmp(CX_STR(""), CX_STR(""))); - CX_TEST_ASSERT(0 < cx_strcmp(str, CX_STR(""))); - CX_TEST_ASSERT(0 == cx_strcmp(str, CX_STR("compare this"))); - CX_TEST_ASSERT(0 != cx_strcmp(str, CX_STR("Compare This"))); - CX_TEST_ASSERT(0 > cx_strcmp(str, CX_STR("compare tool"))); - CX_TEST_ASSERT(0 < cx_strcmp(str, CX_STR("compare shit"))); - CX_TEST_ASSERT(0 > cx_strcmp(str, CX_STR("compare this not"))); - CX_TEST_ASSERT(0 < cx_strcmp(str, CX_STR("compare"))); - CX_TEST_ASSERT(0 > cx_strcmp(str, CX_STR("lex"))); - CX_TEST_ASSERT(0 < cx_strcmp(str, CX_STR("another lex test"))); - CX_TEST_ASSERT(0 < cx_strcmp(str, CX_STR("Lex"))); - CX_TEST_ASSERT(0 < cx_strcmp(str, CX_STR("Another lex test"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_str(""), cx_str(""))); + CX_TEST_ASSERT(0 < cx_strcmp(str, cx_str(""))); + CX_TEST_ASSERT(0 == cx_strcmp(str, cx_str("compare this"))); + CX_TEST_ASSERT(0 != cx_strcmp(str, cx_str("Compare This"))); + CX_TEST_ASSERT(0 > cx_strcmp(str, cx_str("compare tool"))); + CX_TEST_ASSERT(0 < cx_strcmp(str, cx_str("compare shit"))); + CX_TEST_ASSERT(0 > cx_strcmp(str, cx_str("compare this not"))); + CX_TEST_ASSERT(0 < cx_strcmp(str, cx_str("compare"))); + CX_TEST_ASSERT(0 > cx_strcmp(str, cx_str("lex"))); + CX_TEST_ASSERT(0 < cx_strcmp(str, cx_str("another lex test"))); + CX_TEST_ASSERT(0 < cx_strcmp(str, cx_str("Lex"))); + CX_TEST_ASSERT(0 < cx_strcmp(str, cx_str("Another lex test"))); cxstring str2 = CX_STR("Compare This"); CX_TEST_ASSERT(0 != cx_strcmp_p(&str, &str2)); @@ -261,18 +261,18 @@ CX_TEST(test_strcasecmp) { cxstring str = CX_STR("compare this"); CX_TEST_DO { - CX_TEST_ASSERT(0 == cx_strcasecmp(CX_STR(""), CX_STR(""))); - CX_TEST_ASSERT(0 < cx_strcasecmp(str, CX_STR(""))); - CX_TEST_ASSERT(0 == cx_strcasecmp(str, CX_STR("compare this"))); - CX_TEST_ASSERT(0 == cx_strcasecmp(str, CX_STR("Compare This"))); - CX_TEST_ASSERT(0 > cx_strcasecmp(str, CX_STR("compare tool"))); - CX_TEST_ASSERT(0 < cx_strcasecmp(str, CX_STR("compare shit"))); - CX_TEST_ASSERT(0 > cx_strcasecmp(str, CX_STR("compare this not"))); - CX_TEST_ASSERT(0 < cx_strcasecmp(str, CX_STR("compare"))); - CX_TEST_ASSERT(0 > cx_strcasecmp(str, CX_STR("lex"))); - CX_TEST_ASSERT(0 < cx_strcasecmp(str, CX_STR("another lex test"))); - CX_TEST_ASSERT(0 > cx_strcasecmp(str, CX_STR("Lex"))); - CX_TEST_ASSERT(0 < cx_strcasecmp(str, CX_STR("Another lex test"))); + CX_TEST_ASSERT(0 == cx_strcasecmp(cx_str(""), cx_str(""))); + CX_TEST_ASSERT(0 < cx_strcasecmp(str, cx_str(""))); + CX_TEST_ASSERT(0 == cx_strcasecmp(str, cx_str("compare this"))); + CX_TEST_ASSERT(0 == cx_strcasecmp(str, cx_str("Compare This"))); + CX_TEST_ASSERT(0 > cx_strcasecmp(str, cx_str("compare tool"))); + CX_TEST_ASSERT(0 < cx_strcasecmp(str, cx_str("compare shit"))); + CX_TEST_ASSERT(0 > cx_strcasecmp(str, cx_str("compare this not"))); + CX_TEST_ASSERT(0 < cx_strcasecmp(str, cx_str("compare"))); + CX_TEST_ASSERT(0 > cx_strcasecmp(str, cx_str("lex"))); + CX_TEST_ASSERT(0 < cx_strcasecmp(str, cx_str("another lex test"))); + CX_TEST_ASSERT(0 > cx_strcasecmp(str, cx_str("Lex"))); + CX_TEST_ASSERT(0 < cx_strcasecmp(str, cx_str("Another lex test"))); cxstring str2 = CX_STR("Compare This"); CX_TEST_ASSERT(0 == cx_strcasecmp_p(&str, &str2)); @@ -293,22 +293,22 @@ CX_TEST_DO { cxmutstr t1 = cx_strcat_a(alloc, 2, s1, s2); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(t1), CX_STR("1234"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(t1), cx_str("1234"))); ASSERT_ZERO_TERMINATED(t1); cx_strfree_a(alloc, &t1); cxmutstr t2 = cx_strcat_a(alloc, 3, s1, s2, s3); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(t2), CX_STR("123456"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(t2), cx_str("123456"))); ASSERT_ZERO_TERMINATED(t2); cx_strfree_a(alloc, &t2); cxmutstr t3 = cx_strcat_a(alloc, 6, s1, sn, s2, sn, s3, sn); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(t3), CX_STR("123456"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(t3), cx_str("123456"))); ASSERT_ZERO_TERMINATED(t3); cx_strfree_a(alloc, &t3); cxmutstr t4 = cx_strcat_a(alloc, 2, sn, sn); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(t4), CX_STR(""))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(t4), cx_str(""))); ASSERT_ZERO_TERMINATED(t4); cx_strfree_a(alloc, &t4); @@ -316,14 +316,14 @@ // use the macro cxmutstr t5 = cx_strcat(3, s3, s1, s2); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(t5), CX_STR("561234"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(t5), cx_str("561234"))); ASSERT_ZERO_TERMINATED(t5); cx_strfree(&t5); // use an initial string - cxmutstr t6 = cx_strdup(CX_STR("Hello")); - t6 = cx_strcat_m(t6, 2, CX_STR(", "), CX_STR("World!")); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(t6), CX_STR("Hello, World!"))); + cxmutstr t6 = cx_strdup(cx_str("Hello")); + t6 = cx_strcat_m(t6, 2, cx_str(", "), cx_str("World!")); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(t6), cx_str("Hello, World!"))); ASSERT_ZERO_TERMINATED(t6); cx_strfree(&t6); } @@ -343,7 +343,7 @@ CX_TEST_DO { cxmutstr r = cx_strcat(9, s1, s2, s3, s4, s5, s6, s7, s8, s9); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(r), CX_STR("123456789abcdef0xy"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(r), cx_str("123456789abcdef0xy"))); ASSERT_ZERO_TERMINATED(r); cx_strfree(&r); } @@ -356,95 +356,95 @@ size_t n; CX_TEST_DO { // special case: empty string - n = cx_strsplit(test, CX_STR(""), capa, list); + n = cx_strsplit(test, cx_str(""), capa, list); CX_TEST_ASSERT(n == 1); CX_TEST_ASSERT(0 == cx_strcmp(list[0], test)); // no delimiter occurrence - n = cx_strsplit(test, CX_STR("z"), capa, list); + n = cx_strsplit(test, cx_str("z"), capa, list); CX_TEST_ASSERT(n == 1); CX_TEST_ASSERT(0 == cx_strcmp(list[0], test)); // partially matching delimiter - n = cx_strsplit(test, CX_STR("is,not"), capa, list); + n = cx_strsplit(test, cx_str("is,not"), capa, list); CX_TEST_ASSERT(n == 1); CX_TEST_ASSERT(0 == cx_strcmp(list[0], test)); // matching single-char delimiter - n = cx_strsplit(test, CX_STR(","), capa, list); + n = cx_strsplit(test, cx_str(","), capa, list); CX_TEST_ASSERT(n == 5); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("this"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR("is"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[2], CX_STR("a"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[3], CX_STR("csv"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[4], CX_STR("string"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("this"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str("is"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[2], cx_str("a"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[3], cx_str("csv"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[4], cx_str("string"))); // matching multi-char delimiter - n = cx_strsplit(test, CX_STR("is"), capa, list); + n = cx_strsplit(test, cx_str("is"), capa, list); CX_TEST_ASSERT(n == 3); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("th"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR(","))); - CX_TEST_ASSERT(0 == cx_strcmp(list[2], CX_STR(",a,csv,string"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("th"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str(","))); + CX_TEST_ASSERT(0 == cx_strcmp(list[2], cx_str(",a,csv,string"))); // bounded list using single-char delimiter - n = cx_strsplit(test, CX_STR(","), 3, list); + n = cx_strsplit(test, cx_str(","), 3, list); CX_TEST_ASSERT(n == 3); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("this"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR("is"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[2], CX_STR("a,csv,string"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("this"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str("is"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[2], cx_str("a,csv,string"))); // bounded list using multi-char delimiter - n = cx_strsplit(test, CX_STR("is"), 2, list); + n = cx_strsplit(test, cx_str("is"), 2, list); CX_TEST_ASSERT(n == 2); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("th"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR(",is,a,csv,string"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("th"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str(",is,a,csv,string"))); // start with delimiter - n = cx_strsplit(test, CX_STR("this"), capa, list); + n = cx_strsplit(test, cx_str("this"), capa, list); CX_TEST_ASSERT(n == 2); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR(""))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR(",is,a,csv,string"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str(""))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str(",is,a,csv,string"))); // end with delimiter - n = cx_strsplit(test, CX_STR("string"), capa, list); + n = cx_strsplit(test, cx_str("string"), capa, list); CX_TEST_ASSERT(n == 2); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("this,is,a,csv,"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR(""))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("this,is,a,csv,"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str(""))); // end with delimiter exceed bound - n = cx_strsplit(CX_STR("a,b,c,"), CX_STR(","), 3, list); + n = cx_strsplit(cx_str("a,b,c,"), cx_str(","), 3, list); CX_TEST_ASSERT(n == 3); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("a"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR("b"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[2], CX_STR("c,"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("a"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str("b"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[2], cx_str("c,"))); // exact match - n = cx_strsplit(test, CX_STR("this,is,a,csv,string"), capa, list); + n = cx_strsplit(test, cx_str("this,is,a,csv,string"), capa, list); CX_TEST_ASSERT(n == 2); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR(""))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR(""))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str(""))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str(""))); // string to be split is only substring - n = cx_strsplit(test, CX_STR("this,is,a,csv,string,with,extension"), capa, list); + n = cx_strsplit(test, cx_str("this,is,a,csv,string,with,extension"), capa, list); CX_TEST_ASSERT(n == 1); CX_TEST_ASSERT(0 == cx_strcmp(list[0], test)); // subsequent encounter of delimiter (the string between is empty) - n = cx_strsplit(test, CX_STR("is,"), capa, list); + n = cx_strsplit(test, cx_str("is,"), capa, list); CX_TEST_ASSERT(n == 3); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("th"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR(""))); - CX_TEST_ASSERT(0 == cx_strcmp(list[2], CX_STR("a,csv,string"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("th"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str(""))); + CX_TEST_ASSERT(0 == cx_strcmp(list[2], cx_str("a,csv,string"))); // call the _m variant just for coverage cxmutstr mtest = cx_strdup(test); cxmutstr mlist[4]; - n = cx_strsplit_m(mtest, CX_STR("is,"), 4, mlist); + n = cx_strsplit_m(mtest, cx_str("is,"), 4, mlist); CX_TEST_ASSERT(n == 3); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(mlist[0]), CX_STR("th"))); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(mlist[1]), CX_STR(""))); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(mlist[2]), CX_STR("a,csv,string"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(mlist[0]), cx_str("th"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(mlist[1]), cx_str(""))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(mlist[2]), cx_str("a,csv,string"))); cx_strfree(&mtest); } } @@ -460,107 +460,107 @@ size_t n; CX_TEST_DO { // special case: empty string - n = cx_strsplit_a(alloc, test, CX_STR(""), capa, &list); + n = cx_strsplit_a(alloc, test, cx_str(""), capa, &list); CX_TEST_ASSERT(n == 1); CX_TEST_ASSERT(0 == cx_strcmp(list[0], test)); cxFree(alloc, list); // no delimiter occurrence - n = cx_strsplit_a(alloc, test, CX_STR("z"), capa, &list); + n = cx_strsplit_a(alloc, test, cx_str("z"), capa, &list); CX_TEST_ASSERT(n == 1); CX_TEST_ASSERT(0 == cx_strcmp(list[0], test)); cxFree(alloc, list); // partially matching delimiter - n = cx_strsplit_a(alloc, test, CX_STR("is,not"), capa, &list); + n = cx_strsplit_a(alloc, test, cx_str("is,not"), capa, &list); CX_TEST_ASSERT(n == 1); CX_TEST_ASSERT(0 == cx_strcmp(list[0], test)); cxFree(alloc, list); // matching single-char delimiter - n = cx_strsplit_a(alloc, test, CX_STR(","), capa, &list); + n = cx_strsplit_a(alloc, test, cx_str(","), capa, &list); CX_TEST_ASSERT(n == 5); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("this"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR("is"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[2], CX_STR("a"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[3], CX_STR("csv"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[4], CX_STR("string"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("this"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str("is"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[2], cx_str("a"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[3], cx_str("csv"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[4], cx_str("string"))); cxFree(alloc, list); // matching multi-char delimiter - n = cx_strsplit_a(alloc, test, CX_STR("is"), capa, &list); + n = cx_strsplit_a(alloc, test, cx_str("is"), capa, &list); CX_TEST_ASSERT(n == 3); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("th"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR(","))); - CX_TEST_ASSERT(0 == cx_strcmp(list[2], CX_STR(",a,csv,string"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("th"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str(","))); + CX_TEST_ASSERT(0 == cx_strcmp(list[2], cx_str(",a,csv,string"))); cxFree(alloc, list); // bounded list using single-char delimiter - n = cx_strsplit_a(alloc, test, CX_STR(","), 3, &list); + n = cx_strsplit_a(alloc, test, cx_str(","), 3, &list); CX_TEST_ASSERT(n == 3); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("this"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR("is"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[2], CX_STR("a,csv,string"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("this"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str("is"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[2], cx_str("a,csv,string"))); cxFree(alloc, list); // bounded list using multi-char delimiter - n = cx_strsplit_a(alloc, test, CX_STR("is"), 2, &list); + n = cx_strsplit_a(alloc, test, cx_str("is"), 2, &list); CX_TEST_ASSERT(n == 2); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("th"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR(",is,a,csv,string"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("th"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str(",is,a,csv,string"))); cxFree(alloc, list); // start with delimiter - n = cx_strsplit_a(alloc, test, CX_STR("this"), capa, &list); + n = cx_strsplit_a(alloc, test, cx_str("this"), capa, &list); CX_TEST_ASSERT(n == 2); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR(""))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR(",is,a,csv,string"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str(""))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str(",is,a,csv,string"))); cxFree(alloc, list); // end with delimiter - n = cx_strsplit_a(alloc, test, CX_STR("string"), capa, &list); + n = cx_strsplit_a(alloc, test, cx_str("string"), capa, &list); CX_TEST_ASSERT(n == 2); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("this,is,a,csv,"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR(""))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("this,is,a,csv,"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str(""))); cxFree(alloc, list); // end with delimiter exceed bound - n = cx_strsplit_a(alloc, CX_STR("a,b,c,"), CX_STR(","), 3, &list); + n = cx_strsplit_a(alloc, cx_str("a,b,c,"), cx_str(","), 3, &list); CX_TEST_ASSERT(n == 3); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("a"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR("b"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[2], CX_STR("c,"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("a"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str("b"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[2], cx_str("c,"))); cxFree(alloc, list); // exact match - n = cx_strsplit_a(alloc, test, CX_STR("this,is,a,csv,string"), capa, &list); + n = cx_strsplit_a(alloc, test, cx_str("this,is,a,csv,string"), capa, &list); CX_TEST_ASSERT(n == 2); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR(""))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR(""))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str(""))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str(""))); cxFree(alloc, list); // string to be split is only substring - n = cx_strsplit_a(alloc, test, CX_STR("this,is,a,csv,string,with,extension"), capa, &list); + n = cx_strsplit_a(alloc, test, cx_str("this,is,a,csv,string,with,extension"), capa, &list); CX_TEST_ASSERT(n == 1); CX_TEST_ASSERT(0 == cx_strcmp(list[0], test)); cxFree(alloc, list); // subsequent encounter of delimiter (the string between is empty) - n = cx_strsplit_a(alloc, test, CX_STR("is,"), capa, &list); + n = cx_strsplit_a(alloc, test, cx_str("is,"), capa, &list); CX_TEST_ASSERT(n == 3); - CX_TEST_ASSERT(0 == cx_strcmp(list[0], CX_STR("th"))); - CX_TEST_ASSERT(0 == cx_strcmp(list[1], CX_STR(""))); - CX_TEST_ASSERT(0 == cx_strcmp(list[2], CX_STR("a,csv,string"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[0], cx_str("th"))); + CX_TEST_ASSERT(0 == cx_strcmp(list[1], cx_str(""))); + CX_TEST_ASSERT(0 == cx_strcmp(list[2], cx_str("a,csv,string"))); cxFree(alloc, list); // call the _m variant just for coverage cxmutstr mtest = cx_strdup(test); cxmutstr *mlist; - n = cx_strsplit_ma(alloc, mtest, CX_STR("is,"), 4, &mlist); + n = cx_strsplit_ma(alloc, mtest, cx_str("is,"), 4, &mlist); CX_TEST_ASSERT(n == 3); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(mlist[0]), CX_STR("th"))); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(mlist[1]), CX_STR(""))); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(mlist[2]), CX_STR("a,csv,string"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(mlist[0]), cx_str("th"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(mlist[1]), cx_str(""))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(mlist[2]), cx_str("a,csv,string"))); cxFree(alloc, mlist); cx_strfree(&mtest); @@ -570,24 +570,24 @@ } CX_TEST(test_strtrim) { - cxstring t1 = cx_strtrim(CX_STR(" ein test \t ")); - cxstring t2 = cx_strtrim(CX_STR("abc")); - cxstring t3 = cx_strtrim(CX_STR(" 123")); - cxstring t4 = cx_strtrim(CX_STR("xyz ")); - cxstring t5 = cx_strtrim(CX_STR(" ")); - cxstring empty = cx_strtrim(CX_STR("")); + cxstring t1 = cx_strtrim(cx_str(" ein test \t ")); + cxstring t2 = cx_strtrim(cx_str("abc")); + cxstring t3 = cx_strtrim(cx_str(" 123")); + cxstring t4 = cx_strtrim(cx_str("xyz ")); + cxstring t5 = cx_strtrim(cx_str(" ")); + cxstring empty = cx_strtrim(cx_str("")); CX_TEST_DO { - CX_TEST_ASSERT(0 == cx_strcmp(t1, CX_STR("ein test"))); - CX_TEST_ASSERT(0 == cx_strcmp(t2, CX_STR("abc"))); - CX_TEST_ASSERT(0 == cx_strcmp(t3, CX_STR("123"))); - CX_TEST_ASSERT(0 == cx_strcmp(t4, CX_STR("xyz"))); - CX_TEST_ASSERT(0 == cx_strcmp(t5, CX_STR(""))); - CX_TEST_ASSERT(0 == cx_strcmp(empty, CX_STR(""))); + CX_TEST_ASSERT(0 == cx_strcmp(t1, cx_str("ein test"))); + CX_TEST_ASSERT(0 == cx_strcmp(t2, cx_str("abc"))); + CX_TEST_ASSERT(0 == cx_strcmp(t3, cx_str("123"))); + CX_TEST_ASSERT(0 == cx_strcmp(t4, cx_str("xyz"))); + CX_TEST_ASSERT(0 == cx_strcmp(t5, cx_str(""))); + CX_TEST_ASSERT(0 == cx_strcmp(empty, cx_str(""))); // call the _m variant just for coverage cxmutstr m1 = cx_strtrim_m(cx_mutstr((char *) " ein test \t ")); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(m1), CX_STR("ein test"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(m1), cx_str("ein test"))); } } @@ -595,11 +595,11 @@ cxstring str = CX_STR("test my prefix and my suffix"); cxstring empty = CX_STR(""); CX_TEST_DO { - CX_TEST_ASSERT(!cx_strprefix(empty, CX_STR("pref"))); + CX_TEST_ASSERT(!cx_strprefix(empty, cx_str("pref"))); CX_TEST_ASSERT(cx_strprefix(str, empty)); CX_TEST_ASSERT(cx_strprefix(empty, empty)); - CX_TEST_ASSERT(cx_strprefix(str, CX_STR("test "))); - CX_TEST_ASSERT(!cx_strprefix(str, CX_STR("8-) fsck "))); + CX_TEST_ASSERT(cx_strprefix(str, cx_str("test "))); + CX_TEST_ASSERT(!cx_strprefix(str, cx_str("8-) fsck "))); } } @@ -607,11 +607,11 @@ cxstring str = CX_STR("test my prefix and my suffix"); cxstring empty = CX_STR(""); CX_TEST_DO { - CX_TEST_ASSERT(!cx_strsuffix(empty, CX_STR("suf"))); + CX_TEST_ASSERT(!cx_strsuffix(empty, cx_str("suf"))); CX_TEST_ASSERT(cx_strsuffix(str, empty)); CX_TEST_ASSERT(cx_strsuffix(empty, empty)); - CX_TEST_ASSERT(cx_strsuffix(str, CX_STR("fix"))); - CX_TEST_ASSERT(!cx_strsuffix(str, CX_STR("fox"))); + CX_TEST_ASSERT(cx_strsuffix(str, cx_str("fix"))); + CX_TEST_ASSERT(!cx_strsuffix(str, cx_str("fox"))); } } @@ -619,11 +619,11 @@ cxstring str = CX_STR("test my prefix and my suffix"); cxstring empty = CX_STR(""); CX_TEST_DO { - CX_TEST_ASSERT(!cx_strcaseprefix(empty, CX_STR("pREf"))); + CX_TEST_ASSERT(!cx_strcaseprefix(empty, cx_str("pREf"))); CX_TEST_ASSERT(cx_strcaseprefix(str, empty)); CX_TEST_ASSERT(cx_strcaseprefix(empty, empty)); - CX_TEST_ASSERT(cx_strcaseprefix(str, CX_STR("TEST "))); - CX_TEST_ASSERT(!cx_strcaseprefix(str, CX_STR("8-) fsck "))); + CX_TEST_ASSERT(cx_strcaseprefix(str, cx_str("TEST "))); + CX_TEST_ASSERT(!cx_strcaseprefix(str, cx_str("8-) fsck "))); } } @@ -631,11 +631,11 @@ cxstring str = CX_STR("test my prefix and my suffix"); cxstring empty = CX_STR(""); CX_TEST_DO { - CX_TEST_ASSERT(!cx_strcasesuffix(empty, CX_STR("sUf"))); + CX_TEST_ASSERT(!cx_strcasesuffix(empty, cx_str("sUf"))); CX_TEST_ASSERT(cx_strcasesuffix(str, empty)); CX_TEST_ASSERT(cx_strcasesuffix(empty, empty)); - CX_TEST_ASSERT(cx_strcasesuffix(str, CX_STR("FIX"))); - CX_TEST_ASSERT(!cx_strcasesuffix(str, CX_STR("fox"))); + CX_TEST_ASSERT(cx_strcasesuffix(str, cx_str("FIX"))); + CX_TEST_ASSERT(!cx_strcasesuffix(str, cx_str("fox"))); } } @@ -652,45 +652,45 @@ cxstring astr = CX_STR("aaaaaaaaaa"); cxstring csstr = CX_STR("test AB ab TEST xyz"); - cxmutstr repl = cx_strreplace(str, CX_STR("abab"), CX_STR("muchlonger")); + cxmutstr repl = cx_strreplace(str, cx_str("abab"), cx_str("muchlonger")); const char *expected = "test muchlongerab string aba"; - cxmutstr repln = cx_strreplacen(str, CX_STR("ab"), CX_STR("c"), 2); + cxmutstr repln = cx_strreplacen(str, cx_str("ab"), cx_str("c"), 2); const char *expectedn = "test ccab string aba"; - cxmutstr longrepl = cx_strreplace(longstr, CX_STR("a"), CX_STR("z")); + cxmutstr longrepl = cx_strreplace(longstr, cx_str("a"), cx_str("z")); const char *longexpect = "xyzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzcd"; - cxmutstr replnotrail = cx_strreplace(notrail, CX_STR("ab"), CX_STR("z")); + cxmutstr replnotrail = cx_strreplace(notrail, cx_str("ab"), cx_str("z")); const char *notrailexpect = "test zz"; - cxmutstr repleq = cx_strreplace(str, str, CX_STR("hello")); + cxmutstr repleq = cx_strreplace(str, str, cx_str("hello")); const char *eqexpect = "hello"; - cxmutstr replempty1 = cx_strreplace(empty, CX_STR("ab"), CX_STR("c")); // expect: empty - cxmutstr replempty2 = cx_strreplace(str, CX_STR("abab"), empty); + cxmutstr replempty1 = cx_strreplace(empty, cx_str("ab"), cx_str("c")); // expect: empty + cxmutstr replempty2 = cx_strreplace(str, cx_str("abab"), empty); const char *emptyexpect2 = "test ab string aba"; - cxmutstr replpre = cx_strreplace(str, CX_STR("test "), CX_STR("TEST ")); + cxmutstr replpre = cx_strreplace(str, cx_str("test "), cx_str("TEST ")); const char *preexpected = "TEST ababab string aba"; - cxmutstr replan1 = cx_strreplacen(astr, CX_STR("a"), CX_STR("x"), 1); + cxmutstr replan1 = cx_strreplacen(astr, cx_str("a"), cx_str("x"), 1); const char *an1expected = "xaaaaaaaaa"; - cxmutstr replan4 = cx_strreplacen(astr, CX_STR("a"), CX_STR("x"), 4); + cxmutstr replan4 = cx_strreplacen(astr, cx_str("a"), cx_str("x"), 4); const char *an4expected = "xxxxaaaaaa"; - cxmutstr replan9 = cx_strreplacen(astr, CX_STR("a"), CX_STR("x"), 9); + cxmutstr replan9 = cx_strreplacen(astr, cx_str("a"), cx_str("x"), 9); const char *an9expected = "xxxxxxxxxa"; - cxmutstr replan10 = cx_strreplacen(astr, CX_STR("a"), CX_STR("x"), 10); + cxmutstr replan10 = cx_strreplacen(astr, cx_str("a"), cx_str("x"), 10); const char *an10expected = "xxxxxxxxxx"; CX_TEST_DO { - cxmutstr repl1_a = cx_strreplace_a(alloc, csstr, CX_STR("AB"), CX_STR("*")); + cxmutstr repl1_a = cx_strreplace_a(alloc, csstr, cx_str("AB"), cx_str("*")); const char *expeced1_a = "test * ab TEST xyz"; - cxmutstr repl2_a = cx_strreplace_a(alloc, csstr, CX_STR("test"), CX_STR("TEST")); + cxmutstr repl2_a = cx_strreplace_a(alloc, csstr, cx_str("test"), cx_str("TEST")); const char *expected2_a = "TEST AB ab TEST xyz"; CX_TEST_ASSERT(repl.ptr != str.ptr); @@ -744,7 +744,7 @@ } CX_TEST(test_strupper) { - cxmutstr str = cx_strdup(CX_STR("thIs 1s @ Te$t")); + cxmutstr str = cx_strdup(cx_str("thIs 1s @ Te$t")); CX_TEST_DO { cx_strupper(str); CX_TEST_ASSERT(0 == strcmp(str.ptr, "THIS 1S @ TE$T")); @@ -753,7 +753,7 @@ } CX_TEST(test_strlower) { - cxmutstr str = cx_strdup(CX_STR("thIs 1s @ Te$t")); + cxmutstr str = cx_strdup(cx_str("thIs 1s @ Te$t")); CX_TEST_DO { cx_strlower(str); CX_TEST_ASSERT(0 == strcmp(str.ptr, "this 1s @ te$t")); @@ -780,7 +780,7 @@ } CX_TEST(test_strtok_m) { - cxmutstr str = cx_strdup(CX_STR("a,comma,separated,string")); + cxmutstr str = cx_strdup(cx_str("a,comma,separated,string")); cxstring delim = CX_STR(","); CX_TEST_DO { CxStrtokCtx ctx = cx_strtok_m(str, delim, 3); @@ -828,7 +828,7 @@ ret = cx_strtok_next(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(tok, CX_STR("a"))); + CX_TEST_ASSERT(0 == cx_strcmp(tok, cx_str("a"))); CX_TEST_ASSERT(ctx.pos == 0); CX_TEST_ASSERT(ctx.next_pos == 2); CX_TEST_ASSERT(ctx.delim_pos == 1); @@ -836,7 +836,7 @@ ret = cx_strtok_next(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(tok, CX_STR("comma"))); + CX_TEST_ASSERT(0 == cx_strcmp(tok, cx_str("comma"))); CX_TEST_ASSERT(ctx.pos == 2); CX_TEST_ASSERT(ctx.next_pos == 8); CX_TEST_ASSERT(ctx.delim_pos == 7); @@ -844,7 +844,7 @@ ret = cx_strtok_next(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(tok, CX_STR("separated"))); + CX_TEST_ASSERT(0 == cx_strcmp(tok, cx_str("separated"))); CX_TEST_ASSERT(ctx.pos == 8); CX_TEST_ASSERT(ctx.next_pos == 18); CX_TEST_ASSERT(ctx.delim_pos == 17); @@ -869,7 +869,7 @@ ret = cx_strtok_next(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(tok, CX_STR("some"))); + CX_TEST_ASSERT(0 == cx_strcmp(tok, cx_str("some"))); CX_TEST_ASSERT(ctx.pos == 0); CX_TEST_ASSERT(ctx.next_pos == 7); CX_TEST_ASSERT(ctx.delim_pos == 4); @@ -877,7 +877,7 @@ ret = cx_strtok_next(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(tok, CX_STR("otherwise"))); + CX_TEST_ASSERT(0 == cx_strcmp(tok, cx_str("otherwise"))); CX_TEST_ASSERT(ctx.pos == 7); CX_TEST_ASSERT(ctx.next_pos == 19); CX_TEST_ASSERT(ctx.delim_pos == 16); @@ -885,7 +885,7 @@ ret = cx_strtok_next(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(tok, CX_STR("separated"))); + CX_TEST_ASSERT(0 == cx_strcmp(tok, cx_str("separated"))); CX_TEST_ASSERT(ctx.pos == 19); CX_TEST_ASSERT(ctx.next_pos == 31); CX_TEST_ASSERT(ctx.delim_pos == 28); @@ -893,7 +893,7 @@ ret = cx_strtok_next(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(tok, CX_STR("string"))); + CX_TEST_ASSERT(0 == cx_strcmp(tok, cx_str("string"))); CX_TEST_ASSERT(ctx.pos == 31); CX_TEST_ASSERT(ctx.next_pos == 40); CX_TEST_ASSERT(ctx.delim_pos == 37); @@ -901,7 +901,7 @@ ret = cx_strtok_next(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(tok, CX_STR(""))); + CX_TEST_ASSERT(0 == cx_strcmp(tok, cx_str(""))); CX_TEST_ASSERT(ctx.pos == 40); CX_TEST_ASSERT(ctx.next_pos == 40); CX_TEST_ASSERT(ctx.delim_pos == 40); @@ -916,7 +916,7 @@ } CX_TEST(test_strtok_next_advanced) { - cxmutstr str = cx_strdup(CX_STR("an,arbitrarily;||separated;string")); + cxmutstr str = cx_strdup(cx_str("an,arbitrarily;||separated;string")); cxstring delim = CX_STR(","); cxstring delim_more[2] = {CX_STR("||"), CX_STR(";")}; CX_TEST_DO { @@ -927,7 +927,7 @@ ret = cx_strtok_next_m(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(tok), CX_STR("an"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(tok), cx_str("an"))); CX_TEST_ASSERT(ctx.pos == 0); CX_TEST_ASSERT(ctx.next_pos == 3); CX_TEST_ASSERT(ctx.delim_pos == 2); @@ -936,7 +936,7 @@ ret = cx_strtok_next_m(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(tok), CX_STR("arbitrarily"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(tok), cx_str("arbitrarily"))); CX_TEST_ASSERT(ctx.pos == 3); CX_TEST_ASSERT(ctx.next_pos == 15); CX_TEST_ASSERT(ctx.delim_pos == 14); @@ -945,7 +945,7 @@ ret = cx_strtok_next_m(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(tok), CX_STR(""))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(tok), cx_str(""))); CX_TEST_ASSERT(ctx.pos == 15); CX_TEST_ASSERT(ctx.next_pos == 17); CX_TEST_ASSERT(ctx.delim_pos == 15); @@ -954,7 +954,7 @@ ret = cx_strtok_next_m(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(tok), CX_STR("separated"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(tok), cx_str("separated"))); CX_TEST_ASSERT(ctx.pos == 17); CX_TEST_ASSERT(ctx.next_pos == 27); CX_TEST_ASSERT(ctx.delim_pos == 26); @@ -963,7 +963,7 @@ ret = cx_strtok_next_m(&ctx, &tok); CX_TEST_ASSERT(ret); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(tok), CX_STR("string"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(tok), cx_str("string"))); CX_TEST_ASSERT(ctx.pos == 27); CX_TEST_ASSERT(ctx.next_pos == 33); CX_TEST_ASSERT(ctx.delim_pos == 33); @@ -977,7 +977,7 @@ CX_TEST_ASSERT(ctx.delim_pos == 33); CX_TEST_ASSERT(ctx.found == 5); - CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(str), CX_STR("AN,ARBITRARILY;||SEPARATED;STRING"))); + CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(str), cx_str("AN,ARBITRARILY;||SEPARATED;STRING"))); } cx_strfree(&str); }