/**
* Invoke fixture setup/teardown
*/
-static bool call_fixture(test_case_t *tcase, bool up)
+static bool call_fixture(test_case_t *tcase, bool up, int i)
{
enumerator_t *enumerator;
test_fixture_t *fixture;
{
if (fixture->setup)
{
- fixture->setup();
+ fixture->setup(i);
}
}
else
{
if (fixture->teardown)
{
- fixture->teardown();
+ fixture->teardown(i);
}
}
}
test_setup_timeout(tcase->timeout);
start_timing(&start);
- if (call_fixture(tcase, TRUE))
+ if (call_fixture(tcase, TRUE, i))
{
if (run_test(tfun, i))
{
- if (call_fixture(tcase, FALSE))
+ if (call_fixture(tcase, FALSE, i))
{
ok = TRUE;
}
}
else
{
- call_fixture(tcase, FALSE);
+ call_fixture(tcase, FALSE, i);
}
}
if (!post_test(init, ok, failures, tfun->name, i, &leaks))
/**
* Fixture for a test case.
*/
-typedef void (*test_fixture_cb_t)(void);
+typedef void (*test_fixture_cb_t)(int);
/**
* A test suite; a collection of test cases with fixtures
#define suite_add_tcase test_suite_add_case
#define START_TEST(name) static void name (int _i) {
#define END_TEST test_fail_if_worker_failed(); }
-#define START_SETUP(name) static void name() {
+#define START_SETUP(name) static void name(int _i) {
#define END_SETUP test_fail_if_worker_failed(); }
-#define START_TEARDOWN(name) static void name() {
+#define START_TEARDOWN(name) static void name(int _i) {
#define END_TEARDOWN test_fail_if_worker_failed(); }
#endif /** TEST_SUITE_H_ @}*/