summaryrefslogtreecommitdiff
path: root/test/testutil.h
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2016-11-04 16:06:12 +0100
committerEmilia Kasper <emilia@openssl.org>2016-11-07 16:55:16 +0100
commitd836d71b2da026b4ed9a2233657b2289ab8e4be0 (patch)
treec4c9b9e2112eaea750871d66914868ea8585a6da /test/testutil.h
parent8e47ee18c8f7e59575effdd8dfcfbfff1a365ede (diff)
downloadopenssl-new-d836d71b2da026b4ed9a2233657b2289ab8e4be0.tar.gz
Simplify tests part 2
1) Remove some unnecessary fixtures 2) Add EXECUTE_TEST_NO_TEARDOWN shorthand when a fixture exists but has no teardown. 3) Fix return values in ct_test.c (introduced by an earlier refactoring, oops) Note that for parameterized tests, the index (test vector) usually holds all the customization, and there should be no need for a separate test fixture. The CTS test is an exception: it demonstrates how to combine customization with parameterization. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test/testutil.h')
-rw-r--r--test/testutil.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/testutil.h b/test/testutil.h
index af7c48cc61..53d58bee5c 100644
--- a/test/testutil.h
+++ b/test/testutil.h
@@ -60,6 +60,11 @@
tear_down(fixture);\
return result
+/* Shorthand if tear_down does nothing. */
+# define EXECUTE_TEST_NO_TEARDOWN(execute_func)\
+ result = execute_func(fixture);\
+ return result
+
/*
* TEST_CASE_NAME is defined as the name of the test case function where
* possible; otherwise we get by with the file name and line number.