[glib/another-victim-of-gobject] fixup! Add a test for custom dispatch_properties_changed



commit ea5ae123eba43b1ae37c5be5176da5ab994e68a4
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Jul 8 12:59:30 2022 +0100

    fixup! Add a test for custom dispatch_properties_changed

 gobject/tests/custom-dispatch.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/gobject/tests/custom-dispatch.c b/gobject/tests/custom-dispatch.c
index ec498ef82b..43f0fb1725 100644
--- a/gobject/tests/custom-dispatch.c
+++ b/gobject/tests/custom-dispatch.c
@@ -1,4 +1,4 @@
-/* GLib testing framework examples and tests
+/* custom-dispatch.c: Test GObjectClass.dispatch_properties_changed
  * Copyright (C) 2022 Red Hat, Inc.
  *
  * SPDX-License-Identifier: LGPL-2.1-or-later
@@ -21,8 +21,6 @@
  * if advised of the possibility of such damage.
  */
 
-#include <stdlib.h>
-#include <gstdio.h>
 #include <glib-object.h>
 
 typedef struct {
@@ -102,12 +100,9 @@ test_object_dispatch_properties_changed (GObject     *object,
                                          guint        n_pspecs,
                                          GParamSpec **pspecs)
 {
-  guint i;
-
   dispatch_properties_called++;
 
-  for (i = 0; i < n_pspecs; i++)
-    g_signal_emit_by_name (object, "notify", g_param_spec_get_name_quark (pspecs[i]), pspecs[i]);
+  G_OBJECT_CLASS (test_object_parent_class)->dispatch_properties_changes (object, n_pspecs, pspecs);
 }
 
 
@@ -157,7 +152,7 @@ test_custom_dispatch (void)
 
   obj = g_object_new (test_object_get_type (), NULL);
 
-  g_assert_true (!object_has_notify_signal_handlers (obj));
+  g_assert_false (object_has_notify_signal_handlers (obj));
 
   g_assert_cmpint (dispatch_properties_called, ==, 0);
   g_object_set (obj, "foo", 11, NULL);


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