From 1caa8801f6d888befb3515d24171bf77a172a93c Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 14 Jun 2013 22:00:42 +0200 Subject: trust: Writable module PKCS#11 token functions Although we don't actually write anything out yet, make the various PKCS#11 functions behave properly when faced with requests to write to token objects --- common/test.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/test.c b/common/test.c index 122e78a..b6ad012 100644 --- a/common/test.c +++ b/common/test.c @@ -200,6 +200,7 @@ p11_test_run (int argc, test_item *next; int count; int ret = 0; + int setup; /* p11-kit specific stuff */ putenv ("P11_KIT_STRICT=1"); @@ -229,20 +230,27 @@ p11_test_run (int argc, assert (item->type == TEST); gl.last = item; gl.number++; + setup = 0; if (setjmp (gl.jump) == 0) { if (fixture && fixture->x.fix.setup) (fixture->x.fix.setup) (item->x.test.argument); + setup = 1; + assert (item->x.test.func); (item->x.test.func)(item->x.test.argument); - if (fixture && fixture->x.fix.teardown) - (fixture->x.fix.teardown) (item->x.test.argument); - printf ("ok %d %s\n", gl.number, item->x.test.name); } + if (setup) { + if (setjmp (gl.jump) == 0) { + if (fixture && fixture->x.fix.teardown) + (fixture->x.fix.teardown) (item->x.test.argument); + } + } + gl.last = NULL; } -- cgit v1.1