[gtk/matthiasc/for-main: 3/5] gtk: Improve test coverage
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-main: 3/5] gtk: Improve test coverage
- Date: Mon, 18 Jul 2022 12:08:45 +0000 (UTC)
commit eb1a2268bb3292cb9c7925394cf8c7807f886e49
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jul 17 09:10:38 2022 -0400
gtk: Improve test coverage
testsuite/gtk/border.c | 27 +++++++++++++++++++++++++++
testsuite/gtk/meson.build | 1 +
2 files changed, 28 insertions(+)
---
diff --git a/testsuite/gtk/border.c b/testsuite/gtk/border.c
new file mode 100644
index 0000000000..2fabefcbfa
--- /dev/null
+++ b/testsuite/gtk/border.c
@@ -0,0 +1,27 @@
+#include <gtk/gtk.h>
+
+static void
+test_border_basic (void)
+{
+ GtkBorder *border;
+ GtkBorder *border2;
+
+ border = gtk_border_new ();
+ *border = (GtkBorder) { 5, 6, 666, 777 };
+ border2 = gtk_border_copy (border);
+
+ g_assert_true (memcmp (border, border2, sizeof (GtkBorder)) == 0);
+
+ gtk_border_free (border);
+ gtk_border_free (border2);
+}
+
+int
+main (int argc, char *argv[])
+{
+ gtk_test_init (&argc, &argv);
+
+ g_test_add_func ("/border/basic", test_border_basic);
+
+ return g_test_run ();
+}
diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build
index 05800c22d5..4c5d70a088 100644
--- a/testsuite/gtk/meson.build
+++ b/testsuite/gtk/meson.build
@@ -26,6 +26,7 @@ tests = [
{ 'name': 'action' },
{ 'name': 'adjustment' },
{ 'name': 'bitset' },
+ { 'name': 'border' },
{
'name': 'builder',
'link_args': gtk_tests_export_dynamic_ldflag,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]