5 #include "mock_prefs_common_get_use_shred.h"
8 gchar *pre; /* Input string */
9 gchar *post; /* Expected output */
12 struct td from_utf8_empty = { "", "" };
13 /* TODO: more tests */
15 struct td to_utf8_empty = { "", "" };
16 /* TODO: more tests */
19 test_filename_from_utf8_null()
21 if (!g_test_undefined())
24 if (g_test_subprocess()) {
27 out = conv_filename_from_utf8(NULL);
32 g_test_trap_subprocess(NULL, 0, 0);
33 g_test_trap_assert_stdout("*Condition*failed*");
34 g_test_trap_assert_passed();
38 test_filename_from_utf8(gconstpointer user_data)
40 struct td *data = (struct td *)user_data;
42 if (!g_test_undefined())
45 if (g_test_subprocess()) {
48 out = conv_filename_from_utf8(data->pre);
49 g_assert_cmpstr(out, ==, data->post);
55 g_test_trap_subprocess(NULL, 0, 0);
56 g_test_trap_assert_passed();
60 test_filename_to_utf8(gconstpointer user_data)
62 struct td *data = (struct td *)user_data;
64 if (!g_test_undefined())
67 if (g_test_subprocess()) {
70 out = conv_filename_to_utf8(data->pre);
71 g_assert_cmpstr(out, ==, data->post);
77 g_test_trap_subprocess(NULL, 0, 0);
78 g_test_trap_assert_passed();
82 main(int argc, char *argv[])
84 g_test_init(&argc, &argv, NULL);
86 g_test_add_func("/common/codeconv/filename_from_utf8/null",
87 test_filename_from_utf8_null);
88 g_test_add_data_func("/common/codeconv/filename_from_utf8/empty",
90 test_filename_from_utf8);
92 g_test_add_func("/common/codeconv/filename_to_utf8/null",
93 test_filename_from_utf8_null);
94 g_test_add_data_func("/common/codeconv/filename_to_utf8/empty",
96 test_filename_to_utf8);
98 /* TODO: more tests */