diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-12-19 10:00:25 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-12-19 10:08:22 -0500 |
commit | cde5abfdc6381e618f9649dd00f74d91d65848d7 (patch) | |
tree | 53dcc2493f7f437ef495c1a19f1ab3da9fea4bf1 /src/test/test_options.c | |
parent | be9bc5981f21a73508e32207fd197b513a6f01be (diff) | |
download | tor-cde5abfdc6381e618f9649dd00f74d91d65848d7.tar.gz tor-cde5abfdc6381e618f9649dd00f74d91d65848d7.zip |
Move TestingDirAuthTimeToLearnReachability into dirauth module.
Diffstat (limited to 'src/test/test_options.c')
-rw-r--r-- | src/test/test_options.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/test/test_options.c b/src/test/test_options.c index 3465207166..10e79c48d8 100644 --- a/src/test/test_options.c +++ b/src/test/test_options.c @@ -3851,14 +3851,15 @@ test_options_validate__testing_options(void *ignored) options_test_data_t *tdata = NULL; setup_capture_of_logs(LOG_WARN); -#define TEST_TESTING_OPTION(name, low_val, high_val, err_low, EXTRA_OPT_STR) \ +#define TEST_TESTING_OPTION(name, accessor, \ + low_val, high_val, err_low, EXTRA_OPT_STR) \ STMT_BEGIN \ free_options_test_data(tdata); \ tdata = get_options_test_data(EXTRA_OPT_STR \ VALID_DIR_AUTH \ "TestingTorNetwork 1\n" \ ); \ - tdata->opt-> name = low_val; \ + accessor(tdata->opt)->name = low_val; \ ret = options_validate(NULL, tdata->opt, &msg); \ tt_int_op(ret, OP_EQ, -1); \ tt_str_op(msg, OP_EQ, #name " " err_low); \ @@ -3869,7 +3870,7 @@ test_options_validate__testing_options(void *ignored) VALID_DIR_AUTH \ "TestingTorNetwork 1\n" \ ); \ - tdata->opt-> name = high_val; \ + accessor(tdata->opt)->name = high_val; \ mock_clean_saved_logs(); \ ret = options_validate(NULL, tdata->opt, &msg); \ tt_int_op(ret, OP_EQ, 0); \ @@ -3878,30 +3879,32 @@ test_options_validate__testing_options(void *ignored) tor_free(msg); \ STMT_END - TEST_TESTING_OPTION(TestingAuthDirTimeToLearnReachability, -1, 8000, + TEST_TESTING_OPTION(TestingAuthDirTimeToLearnReachability, + get_dirauth_options, -1, 8000, "must be non-negative.", ENABLE_AUTHORITY_V3); - TEST_TESTING_OPTION(TestingAuthDirTimeToLearnReachability, -1, 8000, + TEST_TESTING_OPTION(TestingAuthDirTimeToLearnReachability, + get_dirauth_options, -1, 8000, "must be non-negative.", ENABLE_AUTHORITY_BRIDGE); - TEST_TESTING_OPTION(TestingEstimatedDescriptorPropagationTime, -1, 3601, + TEST_TESTING_OPTION(TestingEstimatedDescriptorPropagationTime, , -1, 3601, "must be non-negative.", ""); - TEST_TESTING_OPTION(TestingClientMaxIntervalWithoutRequest, -1, 3601, + TEST_TESTING_OPTION(TestingClientMaxIntervalWithoutRequest, , -1, 3601, "is way too low.", ""); - TEST_TESTING_OPTION(TestingDirConnectionMaxStall, 1, 3601, + TEST_TESTING_OPTION(TestingDirConnectionMaxStall, , 1, 3601, "is way too low.", ""); - TEST_TESTING_OPTION(TestingEstimatedDescriptorPropagationTime, -1, 3601, + TEST_TESTING_OPTION(TestingEstimatedDescriptorPropagationTime, , -1, 3601, "must be non-negative.", ENABLE_AUTHORITY_V3); - TEST_TESTING_OPTION(TestingClientMaxIntervalWithoutRequest, -1, 3601, + TEST_TESTING_OPTION(TestingClientMaxIntervalWithoutRequest, , -1, 3601, "is way too low.", ENABLE_AUTHORITY_V3); - TEST_TESTING_OPTION(TestingDirConnectionMaxStall, 1, 3601, + TEST_TESTING_OPTION(TestingDirConnectionMaxStall, , 1, 3601, "is way too low.", ENABLE_AUTHORITY_V3); - TEST_TESTING_OPTION(TestingEstimatedDescriptorPropagationTime, -1, 3601, + TEST_TESTING_OPTION(TestingEstimatedDescriptorPropagationTime, , -1, 3601, "must be non-negative.", ENABLE_AUTHORITY_BRIDGE); - TEST_TESTING_OPTION(TestingClientMaxIntervalWithoutRequest, -1, 3601, + TEST_TESTING_OPTION(TestingClientMaxIntervalWithoutRequest, , -1, 3601, "is way too low.", ENABLE_AUTHORITY_BRIDGE); - TEST_TESTING_OPTION(TestingDirConnectionMaxStall, 1, 3601, + TEST_TESTING_OPTION(TestingDirConnectionMaxStall, , 1, 3601, "is way too low.", ENABLE_AUTHORITY_BRIDGE); free_options_test_data(tdata); |