summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2014-08-08 17:18:10 +0200
committerStef Walter <stef@thewalter.net>2014-08-08 18:44:49 +0200
commit9cd9153a4d4cf78011d2a8f8c7a69aa8f3eda9f3 (patch)
treeded05597065f53de642c8cc9613cdb783a13dde6 /common
parenteb9d1fcc8e0adc38ff494af619db37013ff17cb9 (diff)
Fix mostly erroneous scanner warnings in tests
Diffstat (limited to 'common')
-rw-r--r--common/tests/test-array.c1
-rw-r--r--common/tests/test-dict.c3
-rw-r--r--common/tests/test-tests.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/common/tests/test-array.c b/common/tests/test-array.c
index 8e8f996..695917a 100644
--- a/common/tests/test-array.c
+++ b/common/tests/test-array.c
@@ -151,6 +151,7 @@ test_remove_and_count (void)
for (i = 0; i < 20000; ++i) {
value = malloc (sizeof (int));
+ assert (value != NULL);
*value = i;
if (!p11_array_push (array, value))
assert_not_reached ();
diff --git a/common/tests/test-dict.c b/common/tests/test-dict.c
index 7c6f851..f12a34e 100644
--- a/common/tests/test-dict.c
+++ b/common/tests/test-dict.c
@@ -426,6 +426,7 @@ test_hash_add_check_lots_and_collisions (void)
for (i = 0; i < 20000; ++i) {
value = malloc (sizeof (int));
+ assert (value != NULL);
*value = i;
if (!p11_dict_set (map, value, value))
assert_not_reached ();
@@ -454,6 +455,7 @@ test_hash_count (void)
for (i = 0; i < 20000; ++i) {
value = malloc (sizeof (int));
+ assert (value != NULL);
*value = i;
if (!p11_dict_set (map, value, value))
assert_not_reached ();
@@ -483,6 +485,7 @@ test_hash_ulongptr (void)
for (i = 0; i < 20000; ++i) {
value = malloc (sizeof (unsigned long));
+ assert (value != NULL);
*value = i;
if (!p11_dict_set (map, value, value))
assert_not_reached ();
diff --git a/common/tests/test-tests.c b/common/tests/test-tests.c
index cd48a13..ba31d83 100644
--- a/common/tests/test-tests.c
+++ b/common/tests/test-tests.c
@@ -60,6 +60,7 @@ test_memory (void)
if (getenv ("TEST_FAIL")) {
mem = malloc (1);
+ assert (mem != NULL);
free (mem);
*mem = 1;
}
@@ -73,6 +74,7 @@ test_leak (void)
if (getenv ("TEST_FAIL")) {
mem = malloc (1);
+ assert (mem != NULL);
*mem = 1;
}
}