dovecot-2.2: lib: test-var-expand - use test_assert_idx() inside...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jul 2 15:23:19 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/1278fed4f2c9
changeset: 17550:1278fed4f2c9
user:      Phil Carmody <phil at dovecot.fi>
date:      Wed Jul 02 18:21:23 2014 +0300
description:
lib: test-var-expand - use test_assert_idx() inside loops
It helps narrow down which test has failed.

Signed-off-by: Phil Carmody <phil at dovecot.fi>

diffstat:

 src/lib/test-var-expand.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r 9511372c7c18 -r 1278fed4f2c9 src/lib/test-var-expand.c
--- a/src/lib/test-var-expand.c	Wed Jul 02 00:10:16 2014 +0300
+++ b/src/lib/test-var-expand.c	Wed Jul 02 18:21:23 2014 +0300
@@ -70,7 +70,7 @@
 	for (i = 0; i < N_ELEMENTS(tests); i++) {
 		str_truncate(str, 0);
 		var_expand(str, tests[i].in, table);
-		test_assert(strcmp(tests[i].out, str_c(str)) == 0);
+		test_assert_idx(strcmp(tests[i].out, str_c(str)) == 0, i);
 	}
 	test_end();
 }
@@ -91,11 +91,11 @@
 	test_begin("var_get_key_range");
 	for (i = 0; i < N_ELEMENTS(tests); i++) {
 		var_get_key_range(tests[i].in, &idx, &size);
-		test_assert(tests[i].idx == idx);
-		test_assert(tests[i].size == size);
+		test_assert_idx(tests[i].idx == idx, i);
+		test_assert_idx(tests[i].size == size, i);
 
 		if (tests[i].size == 1)
-			test_assert(tests[i].in[idx] == var_get_key(tests[i].in));
+			test_assert_idx(tests[i].in[idx] == var_get_key(tests[i].in), i);
 	}
 	test_end();
 }


More information about the dovecot-cvs mailing list