summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorP. F. Chimento <philip.chimento@gmail.com>2013-04-29 16:22:33 +0200
committerP. F. Chimento <philip.chimento@gmail.com>2013-04-30 09:51:59 +0200
commit00a8455d3a641659333be649de00e2f1c0a3bc61 (patch)
tree97f093ec19ce53b64258ef2ea762d08896599bf3
parent06da78e1eaad8ffc4b1dfbfac1421093755e364a (diff)
Fix two-windows application test
Figured it out while testing [#42]
-rw-r--r--test/test-application.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/test/test-application.c b/test/test-application.c
index e7f3aa1..7f291b1 100644
--- a/test/test-application.c
+++ b/test/test-application.c
@@ -9,38 +9,26 @@
#define EXPECTED_TWO_WINDOW_ERRMSG "*You should not add more than one application window*"
static void
-test_undefined_two_windows (EosApplication *app)
+test_two_windows (EosApplication *app)
{
- /* Forking a test case from a signal handler is apparently not
- deterministic */
+ GtkWidget *win1 = eos_window_new (app);
-#if 0
/* Unix-only test */
if (g_test_trap_fork(0 /* timeout */, G_TEST_TRAP_SILENCE_STDERR))
{
- GtkWidget *win1, *win2;
-
- win1 = eos_window_new (app);
- win2 = eos_window_new (app);
-
- /* Destroy the windows so that the application exits */
- gtk_widget_destroy (win1);
+ GtkWidget *win2 = eos_window_new (app);
gtk_widget_destroy (win2);
-
exit (0);
}
g_test_trap_assert_failed ();
g_test_trap_assert_stderr (EXPECTED_TWO_WINDOW_ERRMSG);
- gdk_flush ();
-#endif
+
+ gtk_widget_destroy (win1);
}
void
add_application_tests (void)
{
- /* Tests for undefined behavior, i.e. programming errors */
- if (g_test_undefined ())
- ADD_APP_WINDOW_TEST ("/application/two-windows",
- test_undefined_two_windows);
+ ADD_APP_WINDOW_TEST ("/application/two-windows", test_two_windows);
}