Changes in tests/check_util.c [d444c09:7bee5af]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/check_util.c
rd444c09 r7bee5af 104 104 END_TEST 105 105 106 struct107 {108 char *orig;109 int line_len;110 char *wrapped;111 } word_wrap_tests[] = {112 {113 "Line-wrapping is not as easy as it seems?",114 16,115 "Line-wrapping is\nnot as easy as\nit seems?"116 },117 {118 "Line-wrapping is not as easy as it seems?",119 8,120 "Line-\nwrapping\nis not\nas easy\nas it\nseems?"121 },122 {123 "Line-wrapping is\nnot as easy as it seems?",124 8,125 "Line-\nwrapping\nis\nnot as\neasy as\nit\nseems?"126 },127 {128 "a aa aaa aaaa aaaaa aaaaaa aaaaaaa aaaaaaaa",129 5,130 "a aa\naaa\naaaa\naaaaa\naaaaa\na\naaaaa\naa\naaaaa\naaa",131 },132 {133 "aaaaaaaa aaaaaaa aaaaaa aaaaa aaaa aaa aa a",134 5,135 "aaaaa\naaa\naaaaa\naa\naaaaa\na\naaaaa\naaaa\naaa\naa a",136 },137 {138 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",139 5,140 "aaaaa\naaaaa\naaaaa\naaaaa\naaaaa\naaaaa\naaaaa\na",141 },142 {143 NULL144 }145 };146 147 START_TEST(test_word_wrap)148 int i;149 150 for( i = 0; word_wrap_tests[i].orig && *word_wrap_tests[i].orig; i ++ )151 {152 char *wrapped = word_wrap( word_wrap_tests[i].orig, word_wrap_tests[i].line_len );153 154 fail_unless( strcmp( word_wrap_tests[i].wrapped, wrapped ) == 0,155 "%s (line_len = %d) should wrap to `%s', not to `%s'",156 word_wrap_tests[i].orig, word_wrap_tests[i].line_len,157 word_wrap_tests[i].wrapped, wrapped );158 159 g_free( wrapped );160 }161 END_TEST162 163 106 Suite *util_suite (void) 164 107 { … … 173 116 tcase_add_test (tc_core, test_set_url_username); 174 117 tcase_add_test (tc_core, test_set_url_username_pwd); 175 tcase_add_test (tc_core, test_word_wrap);176 118 return s; 177 119 }
Note: See TracChangeset
for help on using the changeset viewer.