dovecot-2.2: lib: Replaced two test_assert()s checking for NULLs...

dovecot at dovecot.org dovecot at dovecot.org
Thu Feb 19 11:04:13 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/c8aeb0cb4a6e
changeset: 18265:c8aeb0cb4a6e
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 19 13:03:46 2015 +0200
description:
lib: Replaced two test_assert()s checking for NULLs with i_assert()s
These can never happen anyway, and keeping them as test_assert()s cause
static analyzer to give warnings.

diffstat:

 src/lib/test-data-stack.c        |  2 +-
 src/lib/test-printf-format-fix.c |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r faed0c7403f8 -r c8aeb0cb4a6e src/lib/test-data-stack.c
--- a/src/lib/test-data-stack.c	Thu Feb 19 12:00:11 2015 +0200
+++ b/src/lib/test-data-stack.c	Thu Feb 19 13:03:46 2015 +0200
@@ -102,7 +102,7 @@
 	for (i = 0; i < number; i++) {
 		ps[i] = t_malloc(size/2);
 		bool re = t_try_realloc(ps[i], size);
-		test_assert_idx(ps[i] != NULL, i);
+		i_assert(ps[i] != NULL);
 		if (!re) {
 			try_fails++;
 			ps[i] = t_malloc(size);
diff -r faed0c7403f8 -r c8aeb0cb4a6e src/lib/test-printf-format-fix.c
--- a/src/lib/test-printf-format-fix.c	Thu Feb 19 12:00:11 2015 +0200
+++ b/src/lib/test-printf-format-fix.c	Thu Feb 19 13:03:46 2015 +0200
@@ -52,7 +52,7 @@
 
 	errno = EINVAL;
 	needle = strerror(errno);
-	test_assert(needle != NULL);
+	i_assert(needle != NULL);
 	needlen = strlen(needle);
 
 	for (i = 0; i < N_ELEMENTS(tests); ++i) {


More information about the dovecot-cvs mailing list