7 #include "mock_prefs_common_get_use_shred.h"
8 #include "mock_prefs_common_get_flush_metadata.h"
11 gchar
*pre
; /* Input string */
12 gchar
*post
; /* Expected output */
15 struct td from_utf8_empty
= { "", "" };
16 /* TODO: more tests */
18 struct td to_utf8_empty
= { "", "" };
19 /* TODO: more tests */
22 test_filename_from_utf8_null()
24 if (!g_test_undefined())
27 if (g_test_subprocess()) {
30 out
= conv_filename_from_utf8(NULL
);
35 g_test_trap_subprocess(NULL
, 0, 0);
36 g_test_trap_assert_stdout("*Condition*failed*");
37 g_test_trap_assert_passed();
41 test_filename_from_utf8(gconstpointer user_data
)
43 struct td
*data
= (struct td
*)user_data
;
45 if (!g_test_undefined())
48 if (g_test_subprocess()) {
51 out
= conv_filename_from_utf8(data
->pre
);
52 g_assert_cmpstr(out
, ==, data
->post
);
58 g_test_trap_subprocess(NULL
, 0, 0);
59 g_test_trap_assert_passed();
63 test_filename_to_utf8(gconstpointer user_data
)
65 struct td
*data
= (struct td
*)user_data
;
67 if (!g_test_undefined())
70 if (g_test_subprocess()) {
73 out
= conv_filename_to_utf8(data
->pre
);
74 g_assert_cmpstr(out
, ==, data
->post
);
80 g_test_trap_subprocess(NULL
, 0, 0);
81 g_test_trap_assert_passed();
85 main(int argc
, char *argv
[])
87 g_test_init(&argc
, &argv
, NULL
);
89 g_test_add_func("/common/codeconv/filename_from_utf8/null",
90 test_filename_from_utf8_null
);
91 g_test_add_data_func("/common/codeconv/filename_from_utf8/empty",
93 test_filename_from_utf8
);
95 g_test_add_func("/common/codeconv/filename_to_utf8/null",
96 test_filename_from_utf8_null
);
97 g_test_add_data_func("/common/codeconv/filename_to_utf8/empty",
99 test_filename_to_utf8
);
101 /* TODO: more tests */