Enable tests, fixing the existing ones to use the current API

This also involved building a static library for the application for
tests to link to. The main application executable also links to it.
This commit is contained in:
David Boddie
2019-07-22 15:22:17 +02:00
parent 7495ec9bbb
commit ff3a7b02b6
5 changed files with 38 additions and 10 deletions

View File

@ -30,16 +30,15 @@ test_create (void)
section = eek_keyboard_create_section (keyboard);
g_assert (EEK_IS_SECTION(section));
eek_section_add_row (section, 2, EEK_ORIENTATION_HORIZONTAL);
key0 = eek_section_create_key (section, 1, 0, 0);
key0 = eek_section_create_key (section, "key0", 1, 0, 0);
g_assert (EEK_IS_KEY(key0));
key1 = eek_section_create_key (section, 2, 1, 0);
key1 = eek_section_create_key (section, "key1", 2, 1, 0);
g_assert (EEK_IS_KEY(key1));
}
int
main (int argc, char **argv)
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/eek-simple-test/create", test_create);
return g_test_run ();

View File

@ -36,7 +36,9 @@ test_output_parse (void)
layout = eek_xml_layout_new ("us", &error);
g_assert_no_error (error);
keyboard = eek_keyboard_new (layout, 640, 480);
/* We don't need the context service to parse an XML file, so we can pass
NULL when creating a keyboard. */
keyboard = eek_keyboard_new (NULL, layout, 640, 480);
g_object_unref (layout);
g_object_unref (keyboard);
}
@ -44,7 +46,6 @@ test_output_parse (void)
int
main (int argc, char **argv)
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
gtk_init (&argc, &argv); /* for gdk_x11_display_get_xdisplay() */