aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/tests/test_runner.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2014-05-20 19:27:50 +0200
committerTobias Brunner <tobias@strongswan.org>2014-06-19 14:00:48 +0200
commita1625fdc9b4747564665b698213c901aa2fc6d58 (patch)
treed61cd2620a0e068faf7450ec8d3f163a34a1f38e /src/libstrongswan/tests/test_runner.c
parentf609682e5da0e29e89a02aa5fe21dcc49b469503 (diff)
downloadstrongswan-a1625fdc9b4747564665b698213c901aa2fc6d58.tar.bz2
strongswan-a1625fdc9b4747564665b698213c901aa2fc6d58.tar.xz
unit-tests: Make fixture functions optional
Diffstat (limited to 'src/libstrongswan/tests/test_runner.c')
-rw-r--r--src/libstrongswan/tests/test_runner.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libstrongswan/tests/test_runner.c b/src/libstrongswan/tests/test_runner.c
index 443c0ae13..8f2e9855e 100644
--- a/src/libstrongswan/tests/test_runner.c
+++ b/src/libstrongswan/tests/test_runner.c
@@ -187,11 +187,17 @@ static bool call_fixture(test_case_t *tcase, bool up)
{
if (up)
{
- fixture->setup();
+ if (fixture->setup)
+ {
+ fixture->setup();
+ }
}
else
{
- fixture->teardown();
+ if (fixture->teardown)
+ {
+ fixture->teardown();
+ }
}
}
else