7 #include "quoted-printable.h"
9 #include "mock_prefs_common_get_use_shred.h"
10 #include "mock_prefs_common_get_flush_metadata.h"
14 gchar
*expected_output
;
17 struct td td_rfc2047_space1
= {
18 "(=?ISO-8859-1?Q?a?=)",
21 struct td td_rfc2047_space2
= {
22 "(=?ISO-8859-1?Q?a?= b)",
25 struct td td_rfc2047_space3
= {
26 "(=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)",
29 struct td td_rfc2047_space4
= {
30 "(=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)",
33 struct td td_rfc2047_space5
= {
34 "(=?ISO-8859-1?Q?a?=\r\n =?ISO-8859-1?Q?b?=)",
37 struct td td_rfc2047_space6
= {
38 "(=?ISO-8859-1?Q?a_b?=)",
41 struct td td_rfc2047_space7
= {
42 "(=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)",
47 test_unmime_header_null()
49 if (!g_test_undefined())
52 if (g_test_subprocess()) {
55 out
= unmime_header(NULL
, FALSE
);
60 g_test_trap_subprocess(NULL
, 0, 0);
61 g_test_trap_assert_stdout("*Condition*failed*");
62 g_test_trap_assert_passed();
66 test_unmime_header(gconstpointer user_data
)
68 struct td
*data
= (struct td
*)user_data
;
69 gchar
*out
= unmime_header(data
->input
, FALSE
);
71 g_assert_nonnull(out
);
72 g_assert_cmpstr(out
, ==, data
->expected_output
);
76 main(int argc
, char *argv
[])
78 g_test_init(&argc
, &argv
, NULL
);
80 g_test_add_func("/common/unmime/null",
81 test_unmime_header_null
);
83 g_test_add_data_func("/common/unmime/rfc2047_space1",
86 g_test_add_data_func("/common/unmime/rfc2047_space2",
89 g_test_add_data_func("/common/unmime/rfc2047_space3",
92 g_test_add_data_func("/common/unmime/rfc2047_space4",
95 g_test_add_data_func("/common/unmime/rfc2047_space5",
98 g_test_add_data_func("/common/unmime/rfc2047_space6",
101 g_test_add_data_func("/common/unmime/rfc2047_space7",