dovecot: Run each test in its own data stack frame.

dovecot at dovecot.org dovecot at dovecot.org
Sat Dec 29 04:15:01 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/2eeb9b2d8f9a
changeset: 7048:2eeb9b2d8f9a
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Dec 29 01:03:21 2007 +0200
description:
Run each test in its own data stack frame.

diffstat:

1 file changed, 16 insertions(+), 7 deletions(-)
src/tests/test-lib.c |   23 ++++++++++++++++-------

diffs (33 lines):

diff -r 3fe934d0843a -r 2eeb9b2d8f9a src/tests/test-lib.c
--- a/src/tests/test-lib.c	Sat Dec 29 01:02:28 2007 +0200
+++ b/src/tests/test-lib.c	Sat Dec 29 01:03:21 2007 +0200
@@ -203,13 +203,22 @@ static void test_str_sanitize(void)
 
 int main(void)
 {
+	static void (*test_functions[])(void) = {
+		test_base64_encode,
+		test_base64_decode,
+		test_bsearch_insert_pos,
+		test_seq_range_array,
+		test_str_sanitize,
+
+		test_istreams
+	};
+	unsigned int i;
+
 	test_init();
-
-	test_base64_encode();
-	test_base64_decode();
-	test_bsearch_insert_pos();
-	test_seq_range_array();
-	test_str_sanitize();
-	test_istreams();
+	for (i = 0; i < N_ELEMENTS(test_functions); i++) {
+		T_FRAME(
+			test_functions[i]();
+		);
+	}
 	return test_deinit();
 }


More information about the dovecot-cvs mailing list