summaryrefslogtreecommitdiff
path: root/unit
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2013-08-06 14:16:14 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-08-07 09:46:56 +0300
commita0a24ba793ad4bfbb0bebfa721c1bf5e4dea8bac (patch)
tree7db4c5648653c8ec07a1d3134ba59a8c10566c60 /unit
parentc879c4fb65c9665a9ea470cec579e143b10659f9 (diff)
downloadconnman-a0a24ba793ad4bfbb0bebfa721c1bf5e4dea8bac.tar.gz
unit: Do not compare expression against NULL
This patch generate via coccinelle with: @ disable is_null,isnt_null1 @ expression E; @@ ( - E == NULL + !E | - E != NULL + E )
Diffstat (limited to 'unit')
-rw-r--r--unit/test-ippool.c6
-rw-r--r--unit/test-pbkdf2-sha1.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/unit/test-ippool.c b/unit/test-ippool.c
index e5c08ca7..a11220d1 100644
--- a/unit/test-ippool.c
+++ b/unit/test-ippool.c
@@ -47,7 +47,7 @@ static void test_case_1(void)
__connman_ippool_init();
pool = __connman_ippool_create(23, 1, 500, NULL, NULL);
- g_assert(pool == NULL);
+ g_assert(!pool);
for (i = 0; i < 100000; i++) {
pool = __connman_ippool_create(23, 1, 20, NULL, NULL);
@@ -131,7 +131,7 @@ static void test_case_3(void)
while (TRUE) {
pool = __connman_ippool_create(23, 1, 100, NULL, NULL);
- if (pool == NULL)
+ if (!pool)
break;
i += 1;
@@ -154,7 +154,7 @@ static void test_case_3(void)
LOG("Number of blocks %d", i);
- for (it = list; it != NULL; it = it->next) {
+ for (it = list; it; it = it->next) {
pool = it->data;
__connman_ippool_unref(pool);
diff --git a/unit/test-pbkdf2-sha1.c b/unit/test-pbkdf2-sha1.c
index 5c8e7f40..71e1d4e2 100644
--- a/unit/test-pbkdf2-sha1.c
+++ b/unit/test-pbkdf2-sha1.c
@@ -199,7 +199,7 @@ static void psk_test(gconstpointer data)
unsigned int i;
int result;
- if (test->network == NULL) {
+ if (!test->network) {
memcpy(ssid, test->ssid, test->ssid_len);
ssid_len = test->ssid_len;
} else {