[asterisk-commits] mjordan: trunk r396535 - /trunk/tests/test_hashtab_thrash.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Aug 10 15:29:58 CDT 2013


Author: mjordan
Date: Sat Aug 10 15:29:56 2013
New Revision: 396535

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=396535
Log:
Pipe test output through test object not stdout

Otherwise, it doesn't show up in the automated test failures

Modified:
    trunk/tests/test_hashtab_thrash.c

Modified: trunk/tests/test_hashtab_thrash.c
URL: http://svnview.digium.com/svn/asterisk/trunk/tests/test_hashtab_thrash.c?view=diff&rev=396535&r1=396534&r2=396535
==============================================================================
--- trunk/tests/test_hashtab_thrash.c (original)
+++ trunk/tests/test_hashtab_thrash.c Sat Aug 10 15:29:56 2013
@@ -58,13 +58,15 @@
 	int preload;
 	/*! When to give up on the tests */
 	struct timeval deadline;
+	/*! The actual test object */
+	struct ast_test *test;
 };
 
 static int is_timed_out(struct hash_test const *data) {
 	struct timeval now = ast_tvnow();
 	int val = ast_tvdiff_us(data->deadline, now) < 0;
 	if (val) {
-		printf("Now: %ld.%06ld Deadline: %ld.%06ld\n",
+		ast_test_status_update(data->test, "Now: %ld.%06ld Deadline: %ld.%06ld\n",
 			now.tv_sec, now.tv_usec,
 			data->deadline.tv_sec, data->deadline.tv_usec);
 	}
@@ -240,6 +242,7 @@
 	}
 
 	ast_test_status_update(test, "Executing hash concurrency test...\n");
+	data.test = test;
 	data.preload = MAX_HASH_ENTRIES / 2;
 	data.max_grow = MAX_HASH_ENTRIES - data.preload;
 	data.deadline = ast_tvadd(ast_tvnow(), ast_tv(MAX_TEST_SECONDS, 0));




More information about the asterisk-commits mailing list