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 (up)
{
if (fixture->setup)
{
fixture->setup();
}
}
else
{
if (fixture->teardown)
{
fixture->teardown();
}
}
}
else
{
failure = TRUE;