aboutsummaryrefslogtreecommitdiff
path: root/src/test/testing_common.c
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2016-11-02 14:16:14 +1100
committerteor <teor2345@gmail.com>2016-11-02 14:16:14 +1100
commit13fbbe9cced6df027d2354f3c94f5312dfe60bf2 (patch)
treed087db67d3f913c2b01804b6f1f93d24cf9d2d5d /src/test/testing_common.c
parent77e1d660ee5b8e2beae12f3de543d19009aaa8ac (diff)
downloadtor-13fbbe9cced6df027d2354f3c94f5312dfe60bf2.tar.gz
tor-13fbbe9cced6df027d2354f3c94f5312dfe60bf2.zip
Make sure passthrough_test_setup doesn't inadvertently fail or skip tests
passthrough_test_setup doesn't pass through arguments if the argument is equal to 0 or TT_SKIP. Instead, it fails or skips the test. Assert on this, so we don't accidentally fail or skip tests.
Diffstat (limited to 'src/test/testing_common.c')
-rw-r--r--src/test/testing_common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/testing_common.c b/src/test/testing_common.c
index 1eae07e450..9c6580f788 100644
--- a/src/test/testing_common.c
+++ b/src/test/testing_common.c
@@ -240,6 +240,9 @@ free_pregenerated_keys(void)
static void *
passthrough_test_setup(const struct testcase_t *testcase)
{
+ /* Make sure the passthrough doesn't unintentionally fail or skip tests */
+ tor_assert(testcase->setup_data);
+ tor_assert(testcase->setup_data != (void*)TT_SKIP);
return testcase->setup_data;
}
static int