summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul J Stevens <paul@nfg.nl>2008-12-29 19:41:36 +0100
committerPaul J Stevens <paul@nfg.nl>2008-12-29 19:41:36 +0100
commite5a4c589c39812446af2524fd93a4b856bece9e0 (patch)
treec2ebccb01a84ade1f20396985b3433db78b73c9a /test
parent206100f91a63913cd2399faa42cd0d5e09a13785 (diff)
refactor base64 fix
Diffstat (limited to 'test')
-rw-r--r--test/check_dbmail_imapd.c2
-rw-r--r--test/check_dbmail_misc.c19
2 files changed, 21 insertions, 0 deletions
diff --git a/test/check_dbmail_imapd.c b/test/check_dbmail_imapd.c
index 72f8b94f..c759ffd0 100644
--- a/test/check_dbmail_imapd.c
+++ b/test/check_dbmail_imapd.c
@@ -487,6 +487,8 @@ START_TEST(test_imap_cleanup_address)
F("\"First Address\" <first@foo.com>, =?iso-8859-1?Q?::_=5B_Arrty_=5D_::_=5B_Roy_=28L=29_St=E8phanie_=5D?= <over.there@hotmail.com>",
"\"First Address\" <first@foo.com>, \"=?iso-8859-1?Q?::_=5B_Arrty_=5D_::_=5B_Roy_=28L=29_St=E8phanie_=5D?=\" <over.there@hotmail.com>");
+ printf("[%s]\n", imap_cleanup_address("pr.latinnet <pr.latinnet@gmail.com>"));
+
}
END_TEST
diff --git a/test/check_dbmail_misc.c b/test/check_dbmail_misc.c
index beffd445..aa1e7e35 100644
--- a/test/check_dbmail_misc.c
+++ b/test/check_dbmail_misc.c
@@ -288,6 +288,24 @@ START_TEST(test_dm_strtoull)
}
END_TEST
+START_TEST(test_base64_decode)
+{
+ int i;
+ size_t l;
+ char *result;
+ const char *in = "123456123456";
+ gchar *out = g_base64_encode((const guchar *)in,16);
+ for (i=0; i<100; i++) {
+ result = dm_base64_decode(out, &l);
+ fail_unless(strncmp(in, result, l)==0);
+ g_free(result);
+ }
+
+ g_free(out);
+
+}
+END_TEST
+
START_TEST(test_base64_decodev)
{
int i;
@@ -381,6 +399,7 @@ Suite *dbmail_misc_suite(void)
tcase_add_test(tc_misc, test_create_unique_id);
tcase_add_test(tc_misc, test_g_list_merge);
tcase_add_test(tc_misc, test_dm_strtoull);
+ tcase_add_test(tc_misc, test_base64_decode);
tcase_add_test(tc_misc, test_base64_decodev);
tcase_add_test(tc_misc, test_sha1);
tcase_add_test(tc_misc, test_sha256);