X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=tests%2Fcheck_text-utils.c;h=e60fdeb8994640888976b5107df71970219a9d72;hp=76013b6ca070ae1e84ddd4f899304816686d6db9;hb=aab537f6ce755830767baa7260d7879449ceeb38;hpb=ea021abcd97d636fac9ff6769afad9e66e4edfad diff --git a/tests/check_text-utils.c b/tests/check_text-utils.c index 76013b6..e60fdeb 100644 --- a/tests/check_text-utils.c +++ b/tests/check_text-utils.c @@ -30,6 +30,7 @@ #include #include #include +#include #include typedef struct { @@ -47,7 +48,7 @@ typedef struct { * - Test 4: Check issues in tests 1, 2 and 3 together * - Test 5: Check with an empty address */ -START_TEST (test_display_address_regular) +START_TEST (test_get_display_address_regular) { gint i; const StringPair tests[] = { @@ -76,7 +77,7 @@ END_TEST * Test invalid usage of modest_text_utils_get_display_address * - Test 1: Check with NULL address (should return NULL) */ -START_TEST (test_display_address_invalid) +START_TEST (test_get_display_address_invalid) { /* Test 1 */ fail_unless (modest_text_utils_get_display_address (NULL) == NULL, @@ -164,7 +165,7 @@ START_TEST (test_quote_regular) text = g_strdup (tests[i].original); expected_quoted_text = g_strdup (tests[i].expected); quoted_text = modest_text_utils_quote (text, "text/plain", "foo@bar", 0, 15); - fail_unless (quoted_text && !strcmp (expected_quoted_text, quoted_text), + fail_unless (quoted_text && strcmp(expected_quoted_text, quoted_text)==0, "modest_text_utils_quote failed:\nOriginal text:\n\"%s\"\n" \ "Expected quotation:\n\"%s\"\nQuoted text:\n\"%s\"", text, expected_quoted_text, quoted_text); @@ -636,7 +637,7 @@ START_TEST (test_remove_address_limits) gchar *list = NULL; gchar *new_list = NULL; gchar *expected_list = NULL; - gchar *address = NULL; + //gchar *address = NULL; gint i; const StringPair tests[] = { @@ -706,6 +707,8 @@ START_TEST (test_convert_to_html_regular) gchar *html_end = NULL; gchar *html = NULL; gint bytes; + int i; + const StringPair tests[] = { { "This is some text.", "This is some text." }, @@ -765,8 +768,8 @@ text_utils_suite (void) /* Tests case for "display adress" */ tc = tcase_create ("display_adress"); - tcase_add_test (tc, test_display_address_regular); - tcase_add_test (tc, test_display_address_invalid); + tcase_add_test (tc, test_get_display_address_regular); + tcase_add_test (tc, test_get_display_address_invalid); suite_add_tcase (suite, tc); /* Test case for "derived subject" */ @@ -822,7 +825,7 @@ main () suite = text_utils_suite (); srunner = srunner_create (suite); - + srunner_run_all (srunner, CK_ENV); failures = srunner_ntests_failed (srunner); srunner_free (srunner);