summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2017-06-03 09:08:44 -0400
committerMatthias Clasen <mclasen@redhat.com>2017-06-03 09:16:02 -0400
commit433082f050466abd003e3127af56148b8b44a3e6 (patch)
treefacac044ed93124f8de7ad2c3d2082f76eb267f4
parent81049ea5c5b64ecca15367cc67364b2ff4ccb119 (diff)
downloadgtk+-433082f050466abd003e3127af56148b8b44a3e6.tar.gz
Add a trivial center box test
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/meson.build2
-rw-r--r--tests/testcenterbox.c24
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1c5fc315c8..40fafa97ac 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -157,6 +157,7 @@ noinst_PROGRAMS = $(TEST_PROGS) \
testpopupat \
testgaction \
testwidgetfocus \
+ testcenterbox \
$(NULL)
if USE_X11
@@ -270,6 +271,7 @@ testtitlebar_DEPENDENCIES = $(TEST_DEPS)
testwindowsize_DEPENDENCIES = $(TEST_DEPS)
listmodel_DEPENDENCIES = $(TEST_DEPS)
testwidgetfocus_DEPENDENCIES = $(TEST_DEPS)
+testcenterbox_DEPENDENCIES = $(TEST_DEPS)
animated_resizing_SOURCES = \
animated-resizing.c \
@@ -461,6 +463,8 @@ listmodel_SOURCES = listmodel.c
testwidgetfocus_SOURCES = testwidgetfocus.c
+testcenterbox_SOURCES = testcenterbox.c
+
EXTRA_DIST += \
gradient1.png \
testgtk.1 \
diff --git a/tests/meson.build b/tests/meson.build
index b29c74842a..ac0f3b67a3 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -127,6 +127,8 @@ gtk_tests = [
['testpopup'],
['testpopupat'],
['testgaction'],
+ ['testwidgetfocus'],
+ ['testcenterbox'],
]
if os_linux
diff --git a/tests/testcenterbox.c b/tests/testcenterbox.c
new file mode 100644
index 0000000000..1be333a0c4
--- /dev/null
+++ b/tests/testcenterbox.c
@@ -0,0 +1,24 @@
+#include <gtk/gtk.h>
+
+int
+main (int argc, char *argv[])
+{
+ GtkWidget *window;
+ GtkWidget *box;
+
+ gtk_init ();
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ box = gtk_center_box_new ();
+ gtk_container_add (GTK_CONTAINER (window), box);
+
+ gtk_center_box_set_start_widget (GTK_CENTER_BOX (box), gtk_label_new ("Start Start Start Start Start"));
+ gtk_center_box_set_center_widget (GTK_CENTER_BOX (box), gtk_label_new ("Center"));
+ gtk_center_box_set_end_widget (GTK_CENTER_BOX (box), gtk_label_new ("End"));
+
+ gtk_widget_show (window);
+
+ gtk_main ();
+
+ return 0;
+}