unit-tests: Make fixture functions optional

This commit is contained in:
Tobias Brunner
2014-06-19 14:00:48 +02:00
parent f609682e5d
commit a1625fdc9b
+6
View File
@@ -186,14 +186,20 @@ static bool call_fixture(test_case_t *tcase, bool up)
if (test_restore_point()) if (test_restore_point())
{ {
if (up) if (up)
{
if (fixture->setup)
{ {
fixture->setup(); fixture->setup();
} }
}
else else
{
if (fixture->teardown)
{ {
fixture->teardown(); fixture->teardown();
} }
} }
}
else else
{ {
failure = TRUE; failure = TRUE;