summaryrefslogtreecommitdiffstats
path: root/subprojects/libhandy/tests/test-preferences-window.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 14:36:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 14:36:24 +0000
commit9b6d8e63db85c30007b463e91f91a791969fa83f (patch)
tree0899af51d73c1bf986f73ae39a03c4436083018a /subprojects/libhandy/tests/test-preferences-window.c
parentInitial commit. (diff)
downloadgnome-control-center-9b6d8e63db85c30007b463e91f91a791969fa83f.tar.xz
gnome-control-center-9b6d8e63db85c30007b463e91f91a791969fa83f.zip
Adding upstream version 1:3.38.4.upstream/1%3.38.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--subprojects/libhandy/tests/test-preferences-window.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/subprojects/libhandy/tests/test-preferences-window.c b/subprojects/libhandy/tests/test-preferences-window.c
new file mode 100644
index 0000000..32a0f8d
--- /dev/null
+++ b/subprojects/libhandy/tests/test-preferences-window.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2019 Purism SPC
+ *
+ * SPDX-License-Identifier: LGPL-2.1+
+ */
+
+#include <handy.h>
+
+
+static void
+test_hdy_preferences_window_add (void)
+{
+ g_autoptr (HdyPreferencesWindow) window = NULL;
+ HdyPreferencesPage *page;
+ GtkWidget *widget;
+
+ window = g_object_ref_sink (HDY_PREFERENCES_WINDOW (hdy_preferences_window_new ()));
+ g_assert_nonnull (window);
+
+ page = HDY_PREFERENCES_PAGE (hdy_preferences_page_new ());
+ g_assert_nonnull (page);
+ gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (page));
+
+ widget = gtk_switch_new ();
+ g_assert_nonnull (widget);
+ g_test_expect_message (HDY_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Can't add children of type GtkSwitch to HdyPreferencesWindow");
+ gtk_container_add (GTK_CONTAINER (window), widget);
+ g_test_assert_expected_messages ();
+}
+
+
+gint
+main (gint argc,
+ gchar *argv[])
+{
+ gtk_test_init (&argc, &argv, NULL);
+ hdy_init ();
+
+ g_test_add_func("/Handy/PreferencesWindow/add", test_hdy_preferences_window_add);
+
+ return g_test_run();
+}