[glib/fix-freeze-count-underflow: 4/7] tests: Port GObject singleton test to GTest framework




commit 3d36162bd7a8782dde0d5b358203b843c0d9b4c3
Author: Philip Withnall <pwithnall endlessos org>
Date:   Fri Jun 10 13:48:40 2022 +0100

    tests: Port GObject singleton test to GTest framework
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 gobject/tests/singleton.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/gobject/tests/singleton.c b/gobject/tests/singleton.c
index db024f18c4..c5e151dbf4 100644
--- a/gobject/tests/singleton.c
+++ b/gobject/tests/singleton.c
@@ -67,10 +67,8 @@ my_singleton_class_init (MySingletonClass *klass)
   G_OBJECT_CLASS (klass)->constructor = my_singleton_constructor;
 }
 
-/* --- test program --- */
-int
-main (int   argc,
-      char *argv[])
+static void
+test_singleton_construction (void)
 {
   MySingleton *singleton, *obj;
 
@@ -85,5 +83,15 @@ main (int   argc,
 
   /* shutdown */
   g_object_unref (singleton);
-  return 0;
+}
+
+int
+main (int   argc,
+      char *argv[])
+{
+  g_test_init (&argc, &argv, NULL);
+
+  g_test_add_func ("/gobject/singleton/construction", test_singleton_construction);
+
+  return g_test_run ();
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]