add support for Ayatana indicator to Notification plugin
[claws.git] / src / common / tests / xml_test.c
blob288031fff383b3229bcdcda60d3ea13f1fb34257
1 #include "config.h"
3 #include <glib.h>
5 #include "xml.h"
7 #include "mock_prefs_common_get_use_shred.h"
8 #include "mock_prefs_common_get_flush_metadata.h"
10 #define DATADIR "data/"
12 static void
13 test_xml_open_file_missing(void)
15 XMLFile *xf = xml_open_file(DATADIR "missing.xml");
16 g_assert_null(xf);
19 static void
20 test_xml_open_file_empty(void)
22 XMLFile *xf = xml_open_file(DATADIR "empty.xml");
23 g_assert_nonnull(xf);
24 g_assert_nonnull(xf->buf);
25 g_assert_nonnull(xf->bufp);
26 g_assert_null(xf->dtd);
27 g_assert_null(xf->encoding);
28 g_assert_null(xf->tag_stack);
29 g_assert_cmpint(xf->level, ==, 0);
30 g_assert_false(xf->is_empty_element);
33 int
34 main(int argc, char *argv[])
36 g_test_init(&argc, &argv, NULL);
38 g_test_add_func("/common/xml_open_file_missing", test_xml_open_file_missing);
39 g_test_add_func("/common/xml_open_file_empty", test_xml_open_file_empty);
41 return g_test_run();