Don't create fixtures for simple tests
The test fixtures are (meant to be) useful for sharing common
setup. Don't bother when we don't have any setup/teardown.
This only addresses simple tests. Parameterized tests (ADD_ALL_TESTS)
will be made more user-friendly in a follow-up.
Reviewed-by: Rich Salz <rsalz@openssl.org>
diff --git a/test/d2i_test.c b/test/d2i_test.c
index c536764..e12f249 100644
--- a/test/d2i_test.c
+++ b/test/d2i_test.c
@@ -41,18 +41,7 @@
static expected_error_t expected_error = ASN1_UNKNOWN;
-typedef struct d2i_test_fixture {
- const char *test_case_name;
-} D2I_TEST_FIXTURE;
-
-static D2I_TEST_FIXTURE set_up(const char *const test_case_name)
-{
- D2I_TEST_FIXTURE fixture;
- fixture.test_case_name = test_case_name;
- return fixture;
-}
-
-static int execute_test(D2I_TEST_FIXTURE fixture)
+static int test_bad_asn1()
{
BIO *bio = NULL;
ASN1_VALUE *value = NULL;
@@ -116,22 +105,6 @@
return ret;
}
-static void tear_down(D2I_TEST_FIXTURE fixture)
-{
-}
-
-#define SETUP_D2I_TEST_FIXTURE() \
- SETUP_TEST_FIXTURE(D2I_TEST_FIXTURE, set_up)
-
-#define EXECUTE_D2I_TEST() \
- EXECUTE_TEST(execute_test, tear_down)
-
-static int test_bad_asn1()
-{
- SETUP_D2I_TEST_FIXTURE();
- EXECUTE_D2I_TEST();
-}
-
/*
* Usage: d2i_test <type> <file>, e.g.
* d2i_test generalname bad_generalname.der