summaryrefslogtreecommitdiff
path: root/dbus
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2021-03-26 12:16:57 +0000
committerSimon McVittie <smcv@collabora.com>2021-03-26 12:22:14 +0000
commit97590d6071d8deb82e09794119c9e680a3488c49 (patch)
treed67c810b60acf580f700a8369857b290ef5948f3 /dbus
parent6f9838a8736557534c06f1abc7e2ac4f4ab4bf89 (diff)
downloaddbus-glib-97590d6071d8deb82e09794119c9e680a3488c49.tar.gz
test: Compare integers using g_assert_cmpint(), g_assert_cmpuint()
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus-gobject.c34
-rw-r--r--dbus/dbus-gvalue.c16
2 files changed, 25 insertions, 25 deletions
diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c
index f0942e8..ad5ee8b 100644
--- a/dbus/dbus-gobject.c
+++ b/dbus/dbus-gobject.c
@@ -3333,67 +3333,67 @@ _dbus_gobject_test (const char *test_data_dir)
/* DoNothing */
arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info,
&(dbus_glib_internal_test_methods[0]));
- g_assert (*arg == '\0');
+ g_assert_cmpint (*arg, ==, '\0');
/* Increment */
arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info,
&(dbus_glib_internal_test_methods[1]));
- g_assert (*arg != '\0');
+ g_assert_cmpint (*arg, !=, '\0');
arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature);
g_assert_cmpstr (arg_name, ==, "x");
g_assert (arg_in == TRUE);
g_assert_cmpstr (arg_signature, ==, "u");
- g_assert (*arg != '\0');
+ g_assert_cmpint (*arg, !=, '\0');
arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature);
g_assert (arg_in == FALSE);
- g_assert (retval == RETVAL_NONE);
+ g_assert_cmpint (retval, ==, RETVAL_NONE);
g_assert_cmpstr (arg_signature, ==, "u");
- g_assert (*arg == '\0');
+ g_assert_cmpint (*arg, ==, '\0');
/* IncrementRetval */
arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info,
&(dbus_glib_internal_test_methods[2]));
- g_assert (*arg != '\0');
+ g_assert_cmpint (*arg, !=, '\0');
arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature);
g_assert_cmpstr (arg_name, ==, "x");
g_assert (arg_in == TRUE);
g_assert_cmpstr (arg_signature, ==, "u");
- g_assert (*arg != '\0');
+ g_assert_cmpint (*arg, !=, '\0');
arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature);
- g_assert (retval == RETVAL_NOERROR);
+ g_assert_cmpint (retval, ==, RETVAL_NOERROR);
g_assert (arg_in == FALSE);
g_assert_cmpstr (arg_signature, ==, "u");
- g_assert (*arg == '\0');
+ g_assert_cmpint (*arg, ==, '\0');
/* IncrementRetvalError */
arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info,
&(dbus_glib_internal_test_methods[3]));
- g_assert (*arg != '\0');
+ g_assert_cmpint (*arg, !=, '\0');
arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature);
g_assert_cmpstr (arg_name, ==, "x");
g_assert (arg_in == TRUE);
g_assert_cmpstr (arg_signature, ==, "u");
- g_assert (*arg != '\0');
+ g_assert_cmpint (*arg, !=, '\0');
arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature);
- g_assert (retval == RETVAL_ERROR);
+ g_assert_cmpint (retval, ==, RETVAL_ERROR);
g_assert (arg_in == FALSE);
g_assert_cmpstr (arg_signature, ==, "u");
- g_assert (*arg == '\0');
+ g_assert_cmpint (*arg, ==, '\0');
/* Stringify */
arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info,
&(dbus_glib_internal_test_methods[8]));
- g_assert (*arg != '\0');
+ g_assert_cmpint (*arg, !=, '\0');
arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature);
g_assert_cmpstr (arg_name, ==, "val");
g_assert (arg_in == TRUE);
g_assert_cmpstr (arg_signature, ==, "v");
- g_assert (*arg != '\0');
+ g_assert_cmpint (*arg, !=, '\0');
arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature);
- g_assert (retval == RETVAL_NONE);
+ g_assert_cmpint (retval, ==, RETVAL_NONE);
g_assert (arg_in == FALSE);
g_assert_cmpstr (arg_signature, ==, "s");
- g_assert (*arg == '\0');
+ g_assert_cmpint (*arg, ==, '\0');
sigdata = dbus_glib_internal_test_object_info.exported_signals;
g_assert (*sigdata != '\0');
diff --git a/dbus/dbus-gvalue.c b/dbus/dbus-gvalue.c
index bd97e65..534e90a 100644
--- a/dbus/dbus-gvalue.c
+++ b/dbus/dbus-gvalue.c
@@ -2036,7 +2036,7 @@ assert_type_maps_to (GType gtype, const char *expected_sig)
static void
assert_signature_maps_to (const char *sig, GType expected_gtype)
{
- g_assert (_dbus_gtype_from_signature (sig, TRUE) == expected_gtype);
+ g_assert_cmpuint (_dbus_gtype_from_signature (sig, TRUE), ==, expected_gtype);
}
static void
@@ -2074,26 +2074,26 @@ _dbus_gvalue_test (const char *test_data_dir)
DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_OBJECT_PATH_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING );
rectype = dbus_g_type_get_collection ("GArray", G_TYPE_UINT);
- g_assert (rectype != G_TYPE_INVALID);
+ g_assert_cmpuint (rectype, !=, G_TYPE_INVALID);
g_assert_cmpstr (g_type_name (rectype), ==, "GArray_guint_");
type = _dbus_gtype_from_signature ("au", TRUE);
- g_assert (type == rectype);
+ g_assert_cmpuint (type, ==, rectype);
rectype = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING);
- g_assert (rectype != G_TYPE_INVALID);
+ g_assert_cmpuint (rectype, !=, G_TYPE_INVALID);
g_assert_cmpstr (g_type_name (rectype), ==, "GHashTable_gchararray+gchararray_");
type = _dbus_gtype_from_signature ("a{ss}", TRUE);
- g_assert (type == rectype);
+ g_assert_cmpuint (type, ==, rectype);
type = _dbus_gtype_from_signature ("o", FALSE);
- g_assert (type == DBUS_TYPE_G_OBJECT_PATH);
+ g_assert_cmpuint (type, ==, DBUS_TYPE_G_OBJECT_PATH);
type = _dbus_gtype_from_signature ("o", TRUE);
- g_assert (type == DBUS_TYPE_G_OBJECT_PATH);
+ g_assert_cmpuint (type, ==, DBUS_TYPE_G_OBJECT_PATH);
type = _dbus_gtype_from_signature ("g", TRUE);
- g_assert (type == DBUS_TYPE_G_SIGNATURE);
+ g_assert_cmpuint (type, ==, DBUS_TYPE_G_SIGNATURE);
return TRUE;
}