aboutsummaryrefslogtreecommitdiffstats
path: root/g10/t-keydb.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-09-10 15:43:13 +0000
committerWerner Koch <[email protected]>2015-09-10 15:43:37 +0000
commitfbf24cd09abcdc3dec21db4114ab2db99ce21e4c (patch)
treeca8c1a0fdd751ab952a407cd8bf83983dbae6897 /g10/t-keydb.c
parentpo: Auto-update (diff)
downloadgnupg-fbf24cd09abcdc3dec21db4114ab2db99ce21e4c.tar.gz
gnupg-fbf24cd09abcdc3dec21db4114ab2db99ce21e4c.zip
g10: Improve portability of the new test driver.
* g10/test.c: Include stdio.h and stdlib.h. (verbose): New. (print_results): Rename to exit_tests. (main): Remove atexit and call exit_tests. Set verbose. (ASSERT, ABORT): Call exit_tests instead of exit. -- Calling exit from an exit handler is undefined behaviour. It works on Linux but other systems will hit an endless loop. That is indeed unfortunate but we can't do anything about it. Calling _exit() would be possible but that may lead to other problems. Thus we change to call a custom exit function :-(. Using "make check verbose=1" is supported by tests/openpgp and thus we add the same mechanism here. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/t-keydb.c')
-rw-r--r--g10/t-keydb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/g10/t-keydb.c b/g10/t-keydb.c
index 0f176431c..634cb05a7 100644
--- a/g10/t-keydb.c
+++ b/g10/t-keydb.c
@@ -80,8 +80,11 @@ do_test (int argc, char *argv[])
ABORT ("1E42B367 has no user id packet");
uid2 = kb2->pkt->pkt.user_id->name;
- printf ("user id for DBFC6AD9: %s\n", uid1);
- printf ("user id for 1E42B367: %s\n", uid2);
+ if (verbose)
+ {
+ printf ("user id for DBFC6AD9: %s\n", uid1);
+ printf ("user id for 1E42B367: %s\n", uid2);
+ }
TEST_P ("cache consistency", strcmp (uid1, uid2) != 0);
}