dovecot-2.2: lib-test: quieten the random seed printfs
dovecot at dovecot.org
dovecot at dovecot.org
Mon Jul 28 13:54:30 UTC 2014
details: http://hg.dovecot.org/dovecot-2.2/rev/9f765c38fd79
changeset: 17655:9f765c38fd79
user: Phil Carmody <phil at dovecot.fi>
date: Mon Jul 28 16:45:33 2014 +0300
description:
lib-test: quieten the random seed printfs
We only need to know the seed once.
Signed-off-by: Phil Carmody <phil at dovecot.fi>
diffstat:
src/lib-test/test-common.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diffs (17 lines):
diff -r 5601d3e9d2a3 -r 9f765c38fd79 src/lib-test/test-common.c
--- 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());
More information about the dovecot-cvs
mailing list