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>
diff --git a/test/testutil.h b/test/testutil.h
index af7c48c..53d58be 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.