tools: fix signal type in service test
The signal definition is: <signal name="StateChanged"> <arg name="old" type="i" /> <arg name="new" type="i" /> <arg name="reason" type="u" /> </signal> So the first two arguments need to be adjusted. Without this change, the test was failing for me: (/build/source/tools/tests/.libs/lt-test-stub:77030): GLib-GObject-CRITICAL **: 15:05:35.276: ../gobject/gsignal.c:3167: value for 'gint' parameter 0 for signal "state-changed" is of type 'guint'
This commit is contained in:

committed by
Aleksander Morgado

parent
b100189f49
commit
a8f086bfb3
@@ -339,7 +339,7 @@ class Modem(ExportedObj):
|
||||
def PropertiesChanged(self, changed):
|
||||
pass
|
||||
|
||||
@dbus.service.signal(IFACE_MODEM, signature='uuu')
|
||||
@dbus.service.signal(IFACE_MODEM, signature='iiu')
|
||||
def StateChanged(self, old_state, new_state, reason):
|
||||
pass
|
||||
|
||||
@@ -406,7 +406,7 @@ class ObjectManager(dbus.service.Object):
|
||||
self.modem = Modem(self.bus, add_sim, iccid)
|
||||
return dbus.ObjectPath(self.modem.path)
|
||||
|
||||
@dbus.service.method(IFACE_TEST, in_signature='uuu', out_signature='')
|
||||
@dbus.service.method(IFACE_TEST, in_signature='iiu', out_signature='')
|
||||
def EmitStateChanged(self, old_state, new_state, reason):
|
||||
if self.modem is not None:
|
||||
self.modem.StateChanged(old_state, new_state, reason)
|
||||
|
@@ -206,7 +206,7 @@ set_modem_state (TestData *tdata,
|
||||
GError *error = NULL;
|
||||
GVariant *ret = NULL;
|
||||
GVariant *old_state_variant = NULL;
|
||||
guint old_state = 0;
|
||||
gint old_state = 0;
|
||||
|
||||
g_assert_nonnull (tdata->mm_modem_prop_proxy);
|
||||
|
||||
@@ -222,7 +222,7 @@ set_modem_state (TestData *tdata,
|
||||
&error);
|
||||
g_assert_no_error (error);
|
||||
g_variant_get (ret, "(v)", &old_state_variant);
|
||||
old_state = (guint)g_variant_get_int32 (old_state_variant);
|
||||
old_state = g_variant_get_int32 (old_state_variant);
|
||||
g_variant_unref (ret);
|
||||
g_variant_unref (old_state_variant);
|
||||
|
||||
@@ -256,7 +256,7 @@ set_modem_state (TestData *tdata,
|
||||
/* Emit state change signal */
|
||||
g_dbus_proxy_call (tdata->mm_proxy,
|
||||
"EmitStateChanged",
|
||||
g_variant_new ("(uuu)", old_state, state, reason),
|
||||
g_variant_new ("(iiu)", old_state, state, reason),
|
||||
G_DBUS_CALL_FLAGS_NO_AUTO_START,
|
||||
1000,
|
||||
NULL,
|
||||
|
Reference in New Issue
Block a user