Changeset 1fc2958 for tests/check_util.c
- Timestamp:
- 2006-06-16T12:07:51Z (17 years ago)
- Branches:
- master
- Children:
- 125b35d
- Parents:
- c2fa827
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/check_util.c
rc2fa827 r1fc2958 25 25 END_TEST 26 26 27 START_TEST(test_strip_newlines) 28 { 29 int i; 30 const char *get[] = { "Test", "Test\r\n", "Test\nX\n", NULL }; 31 const char *expected[] = { "Test", "Test ", "Test X ", NULL }; 32 33 for (i = 0; get[i]; i++) { 34 char copy[20], *ret; 35 strcpy(copy, get[i]); 36 ret = strip_newlines(copy); 37 fail_unless (strcmp(copy, expected[i]) == 0, 38 "(%d) strip_newlines broken: %s -> %s (expected: %s)", 39 i, get[i], copy, expected[i]); 40 fail_unless (copy == ret, "Original string not returned"); 41 } 42 } 43 END_TEST 44 27 45 Suite *util_suite (void) 28 46 { … … 31 49 suite_add_tcase (s, tc_core); 32 50 tcase_add_test (tc_core, test_strip_linefeed); 51 tcase_add_test (tc_core, test_strip_newlines); 33 52 return s; 34 53 }
Note: See TracChangeset
for help on using the changeset viewer.