gui/window: Add unit test

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-12-26 18:05:59 -05:00
parent 684d52c522
commit 29985d2a69
3 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,4 @@
builder
settings
window
audio

View File

@ -26,6 +26,7 @@ def GuiTest(name):
env.UsePackage("gmodule-export-2.0")
res += [ GuiTest("builder") ]
res += [ GuiTest("settings") ]
res += [ GuiTest("window") ]
res += [ GuiTest("audio") ]
ignore.close()

30
tests/gui/window.c Normal file
View File

@ -0,0 +1,30 @@
/*
* Copyright 2015 (c) Anna Schumaker.
*/
#include <gui/builder.h>
#include <gui/window.h>
#include <tests/test.h>
void __audio_can_accel() {}
void __audio_pause_count() {}
void __audio_pause_enabled() {}
void __audio_seek() {}
static void test_window()
{
GtkWindow *window;
int argc = 0;
gtk_init(&argc, NULL);
gui_builder_init("share/ocarina/ocarina6.glade");
gui_window_init("share/ocarina/ocarina.png");
window = GTK_WINDOW(gui_builder_widget("o_window"));
test_equal(gtk_window_get_title(window), "Ocarina " CONFIG_VERSION);
gui_builder_deinit();
}
DECLARE_UNIT_TESTS(
UNIT_TEST("GUI Window", test_window),
);