summaryrefslogtreecommitdiff
path: root/test/test-window.c
diff options
context:
space:
mode:
authorP. F. Chimento <philip.chimento@gmail.com>2013-04-24 15:14:59 +0200
committerP. F. Chimento <philip.chimento@gmail.com>2013-04-25 10:45:17 +0200
commita568631122c96468601e08b59e69090e76ab3eb5 (patch)
tree08efd6e47203a281bec4534aaeb7af244e72d715 /test/test-window.c
parent5fb8eb9516b8462f4fa4acc6469cbdb868c97556 (diff)
Testing and documentation improvements for EosWindow
[#12]
Diffstat (limited to 'test/test-window.c')
-rw-r--r--test/test-window.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test-window.c b/test/test-window.c
index b08727d..9127120 100644
--- a/test/test-window.c
+++ b/test/test-window.c
@@ -6,6 +6,10 @@
#include "run-tests.h"
+#define EXPECTED_NULL_APPLICATION_ERRMSG \
+ "In order to create a window, you must have an application for it to " \
+ "connect to."
+
static void
test_assign_application (GApplication *app)
{
@@ -17,6 +21,24 @@ test_assign_application (GApplication *app)
gtk_widget_destroy (win);
}
+static void
+test_application_not_null (GApplication *app)
+{
+ GtkWidget *win;
+
+ g_test_expect_message (TEST_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
+ EXPECTED_NULL_APPLICATION_ERRMSG);
+
+ win = eos_window_new (NULL);
+
+ g_test_assert_expected_messages ();
+
+ gtk_widget_destroy (win);
+ g_application_release (app);
+ g_application_quit (app); /* Doesn't quit when win is destroyed */
+}
+
+static void
test_screen_size (GApplication *app)
{
GtkWidget *win = eos_window_new (EOS_APPLICATION (app));
@@ -54,5 +76,7 @@ void
add_window_tests (void)
{
ADD_APP_WINDOW_TEST ("/window/assign-application", test_assign_application);
+ ADD_APP_WINDOW_TEST ("/window/application-not-null",
+ test_application_not_null);
ADD_APP_WINDOW_TEST ("/window/screen-size", test_screen_size);
}