[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/release-0.2.9] Make sure passthrough_test_setup doesn't inadvertently fail or skip tests



commit 13fbbe9cced6df027d2354f3c94f5312dfe60bf2
Author: teor <teor2345@xxxxxxxxx>
Date:   Wed Nov 2 14:16:14 2016 +1100

    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.
---
 src/test/testing_common.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/test/testing_common.c b/src/test/testing_common.c
index 1eae07e..9c6580f 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



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits