[linux-nfc] [neard][PATCH v2 48/73] unit: use g_assert_null()

Krzysztof Kozlowski <[email protected]> Mon, 19 Jul 2021 13:07:54 +0200
Newsgroups org.01.lists.linux-nfc,dev.linux.lists.oe-linux-nfc
Message-ID <[email protected]>
It's more readable.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
 unit/test-ndef-build.c | 2 +-
 unit/test-ndef-parse.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/unit/test-ndef-build.c b/unit/test-ndef-build.c
index e83f7a8075df..bf77fdd42165 100644
--- a/unit/test-ndef-build.c
+++ b/unit/test-ndef-build.c
@@ -95,7 +95,7 @@ static void test_ndef_wsc_with_out_ssid_build(void)
 
 	ndef = near_ndef_prepare_wsc_record(NULL, NULL);
 
-	g_assert(!ndef);
+	g_assert_null(ndef);
 }
 
 int main(int argc, char **argv)
diff --git a/unit/test-ndef-parse.c b/unit/test-ndef-parse.c
index 9d68a6a77c64..a4f1ab3d0df4 100644
--- a/unit/test-ndef-parse.c
+++ b/unit/test-ndef-parse.c
@@ -290,8 +290,8 @@ static void test_ndef_single_sp(void)
 
 	g_assert(record->sp);
 	g_assert_cmpuint(record->sp->number_of_title_records, ==, 0);
-	g_assert(!record->sp->type);
-	g_assert(!record->sp->action);
+	g_assert_null(record->sp->type);
+	g_assert_null(record->sp->action);
 	g_assert_cmpuint(record->sp->size, ==, 0);
 	g_assert(record->sp->uri);
 
@@ -332,8 +332,8 @@ static void test_ndef_title_sp(void)
 
 	g_assert(record->sp);
 	g_assert_cmpuint(record->sp->number_of_title_records, ==, 1);
-	g_assert(!record->sp->type);
-	g_assert(!record->sp->action);
+	g_assert_null(record->sp->type);
+	g_assert_null(record->sp->action);
 	g_assert_cmpuint(record->sp->size, ==, 0);
 	g_assert(record->sp->uri);
 	g_assert(record->sp->title_records[0]);
-- 
2.27.0
_______________________________________________
Linux-nfc mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s