changeset 17655:9f765c38fd79

lib-test: quieten the random seed printfs We only need to know the seed once. Signed-off-by: Phil Carmody <phil@dovecot.fi>
author Phil Carmody <phil@dovecot.fi>
date Mon, 28 Jul 2014 16:45:33 +0300
parents 5601d3e9d2a3
children ec534d652137
files src/lib-test/test-common.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-test/test-common.c	Mon Jul 28 16:45:33 2014 +0300
+++ b/src/lib-test/test-common.c	Mon Jul 28 16:45:33 2014 +0300
@@ -167,7 +167,12 @@
 static void
 test_dump_rand_state(void)
 {
-	if (rand_get_seed_count() > 0)
+	static int seen_count = -1;
+	int count = rand_get_seed_count();
+	if (count == seen_count)
+		return;
+	seen_count = count;
+	if (count > 0)
 		printf("test: random seed #%i was %u\n", 
 		       rand_get_seed_count(),
 		       rand_get_last_seed());