mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
Convert tests/refcount/properties4.c to glib test framework
This commit is contained in:
parent
94ef5ae4c7
commit
d97c1a148e
@ -143,19 +143,15 @@ my_badger_mama_notify (GObject *object,
|
||||
MyBadger *self;
|
||||
|
||||
self = MY_BADGER (object);
|
||||
|
||||
self->mama_notify_count++;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
static void
|
||||
test_refcount_properties_4 (void)
|
||||
{
|
||||
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));
|
||||
|
||||
badger1 = g_object_new (MY_TYPE_BADGER, NULL);
|
||||
badger2 = g_object_new (MY_TYPE_BADGER, NULL);
|
||||
|
||||
@ -163,11 +159,23 @@ main (int argc, char **argv)
|
||||
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_assert_cmpmem (test, sizeof (MyBadger), badger2, sizeof (MyBadger));
|
||||
g_object_unref (test);
|
||||
|
||||
g_object_unref (badger1);
|
||||
g_object_unref (badger2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, gchar *argv[])
|
||||
{
|
||||
g_log_set_always_fatal (G_LOG_LEVEL_WARNING |
|
||||
G_LOG_LEVEL_CRITICAL |
|
||||
g_log_set_always_fatal (G_LOG_FATAL_MASK));
|
||||
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func ("/gobject/refcount/properties-4", test_refcount_properties_4);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user