Changeset 10446 for trunk/psLib/test/sys/tap_psStringSubstitute.c
- Timestamp:
- Dec 4, 2006, 12:15:04 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sys/tap_psStringSubstitute.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sys/tap_psStringSubstitute.c
r8841 r10446 18 18 { 19 19 psString input = psStringCopy(ORIGINAL); 20 input = psStringSubstitute(input, ",", NULL);20 psStringSubstitute(&input, ",", NULL); 21 21 ok(input && strcmp(input, ORIGINAL) == 0, "output = %s", input); 22 22 psFree(input); … … 28 28 { 29 29 psString input = psStringCopy(ORIGINAL); 30 input = psStringSubstitute(input, "XXX", "");30 psStringSubstitute(&input, "XXX", ""); 31 31 ok(input && strcmp(input, ORIGINAL) == 0, "output = %s", input); 32 32 psFree(input); … … 38 38 { 39 39 psString input = psStringCopy(ORIGINAL); 40 psString output = psStringSubstitute(input, NULL, ",");41 ok( output && strcmp(output, CORRECTED) == 0, "output = %s", output);42 psFree( output);40 psStringSubstitute(&input, NULL, ","); 41 ok(input && strcmp(input, CORRECTED) == 0, "output = %s", input); 42 psFree(input); 43 43 mem(); 44 44 } … … 47 47 { 48 48 psString input = psStringCopy(ORIGINAL); 49 psString output = psStringSubstitute(input, "", ",");50 ok( output && strcmp(output, CORRECTED) == 0, "output = %s", output);51 psFree( output);49 psStringSubstitute(&input, "", ","); 50 ok(input && strcmp(input, CORRECTED) == 0, "output = %s", input); 51 psFree(input); 52 52 mem(); 53 53 } … … 55 55 // Return NULL for NULL input 56 56 { 57 psString output= psStringSubstitute(NULL, "XXX", ",");58 ok( !output, "output = %s", output);57 int status = psStringSubstitute(NULL, "XXX", ","); 58 ok(status == 0, "status = %d", status); 59 59 mem(); 60 60 } … … 63 63 { 64 64 psString input = psStringCopy(""); 65 psString output = psStringSubstitute(input, "XXX", ",");66 ok( output && strcmp(output, input) == 0, "output = %s", output);67 psFree( output);65 psStringSubstitute(&input, "XXX", ","); 66 ok(input && strcmp(input, "") == 0, "output = %s", input); 67 psFree(input); 68 68 mem(); 69 69 } … … 72 72 { 73 73 psString input = psStringCopy(ORIGINAL); 74 psString output = psStringSubstitute(input, "!", ",");75 ok( output && strcmp(output, "This is! a! test case! to check.") == 0, "output = %s", output);76 psFree( output);74 psStringSubstitute(&input, "!", ","); 75 ok(input && strcmp(input, "This is! a! test case! to check.") == 0, "output = %s", input); 76 psFree(input); 77 77 mem(); 78 78 } … … 81 81 { 82 82 psString input = psStringCopy(ORIGINAL); 83 psString output = psStringSubstitute(input, "; This string is too long to fit in input(35 chars)", ".");84 ok( output && strcmp(output, "This is, a, test case, to check; "85 "This string is too long to fit in input(35 chars)") == 0,86 "output = %s", output);87 psFree( output);83 psStringSubstitute(&input, "; This string is too long to fit in input(35 chars)", "."); 84 ok(input && strcmp(input, "This is, a, test case, to check; " 85 "This string is too long to fit in input(35 chars)") == 0, 86 "output = %s", input); 87 psFree(input); 88 88 mem(); 89 89 }
Note:
See TracChangeset
for help on using the changeset viewer.
