Improve gtype test coverage
authorMatthias Clasen <mclasen@redhat.com>
Wed, 29 May 2013 12:34:24 +0000 (08:34 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 29 May 2013 12:37:28 +0000 (08:37 -0400)
tests/refcount/objects.c
tests/refcount/properties.c
tests/refcount/properties2.c
tests/refcount/properties4.c

index 9ff3b60..e45db23 100644 (file)
@@ -150,6 +150,9 @@ main (int argc, char **argv)
     g_thread_join (thread);
   }
 
+  g_object_unref (test1);
+  g_object_unref (test2);
+
   g_print ("stopped\n");
 
   return 0;
index d96a012..5a7020c 100644 (file)
@@ -183,6 +183,8 @@ run_thread (GTest * test)
       }
   }
 
+  g_object_unref (test);
+
   return NULL;
 }
 
index 577e33e..27e0309 100644 (file)
@@ -193,5 +193,7 @@ main (int argc, char **argv)
 
   g_assert (count == test->dummy);
 
+  g_object_unref (test);
+
   return 0;
 }
index 2512160..94b704a 100644 (file)
@@ -151,6 +151,7 @@ int
 main (int argc, char **argv)
 {
   MyBadger * badger1, * badger2;
+  gpointer test;
 
   g_print ("START: %s\n", argv[0]);
   g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | g_log_set_always_fatal (G_LOG_FATAL_MASK));
@@ -161,6 +162,9 @@ main (int argc, char **argv)
   g_object_set (badger1, "mama", badger2, NULL);
   g_assert_cmpuint (badger1->mama_notify_count, ==, 1);
   g_assert_cmpuint (badger2->mama_notify_count, ==, 1);
+  g_object_get (badger1, "mama", &test, NULL);
+  g_assert (test == badger2);
+  g_object_unref (test);
 
   g_object_unref (badger1);
   g_object_unref (badger2);