[gtk/wip/otte/for-master: 2/11] testsuite: Avoid passing NULL to strcmp()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/for-master: 2/11] testsuite: Avoid passing NULL to strcmp()
- Date: Fri, 6 Mar 2020 04:55:29 +0000 (UTC)
commit b231a401063ce016fef4cb5f9eea906d8f3a9e9c
Author: Benjamin Otte <otte redhat com>
Date: Fri Mar 6 04:31:08 2020 +0100
testsuite: Avoid passing NULL to strcmp()
Use g_strcmp0() instead.
testsuite/gtk/action.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/testsuite/gtk/action.c b/testsuite/gtk/action.c
index 056e60fc80..23a78fa23e 100644
--- a/testsuite/gtk/action.c
+++ b/testsuite/gtk/action.c
@@ -379,10 +379,8 @@ test_introspection (void)
{
g_assert (expected[i].owner == owner);
g_assert (strcmp (expected[i].name, name) == 0);
- g_assert ((expected[i].params == NULL && params == NULL) ||
- strcmp (expected[i].params, g_variant_type_peek_string (params)) == 0);
- g_assert ((expected[i].property == NULL && property == NULL) ||
- strcmp (expected[i].property, property) == 0);
+ g_assert (g_strcmp0 (expected[i].params, params ? g_variant_type_peek_string (params) : NULL) == 0);
+ g_assert (g_strcmp0 (expected[i].property, property) == 0);
i++;
}
g_assert (i == G_N_ELEMENTS (expected));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]