diff options
author | David Goulet <dgoulet@torproject.org> | 2020-01-20 10:44:03 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2020-01-20 10:44:03 -0500 |
commit | ca8b90a843b404799550fb88f8542040698d2a94 (patch) | |
tree | ae6116594eaba17a4de9f671c93e7679f9e91382 /src/test/test_config.c | |
parent | 51c76215dbdf94ff710eca1cc671a2b1976e6d07 (diff) | |
parent | ca9a5390ff56cb809b2afa2645863ebd7b12262d (diff) | |
download | tor-ca8b90a843b404799550fb88f8542040698d2a94.tar.gz tor-ca8b90a843b404799550fb88f8542040698d2a94.zip |
Merge branch 'tor-github/pr/1668'
Diffstat (limited to 'src/test/test_config.c')
-rw-r--r-- | src/test/test_config.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/test/test_config.c b/src/test/test_config.c index c23d04ceb8..9e14e2e25a 100644 --- a/src/test/test_config.c +++ b/src/test/test_config.c @@ -5712,11 +5712,27 @@ test_config_check_bridge_distribution_setting_not_a_bridge(void *arg) static void test_config_check_bridge_distribution_setting_valid(void *arg) { - int ret = check_bridge_distribution_setting("https"); - (void)arg; - tt_int_op(ret, OP_EQ, 0); + // Check all the possible values we support right now. + tt_int_op(check_bridge_distribution_setting("none"), OP_EQ, 0); + tt_int_op(check_bridge_distribution_setting("any"), OP_EQ, 0); + tt_int_op(check_bridge_distribution_setting("https"), OP_EQ, 0); + tt_int_op(check_bridge_distribution_setting("email"), OP_EQ, 0); + tt_int_op(check_bridge_distribution_setting("moat"), OP_EQ, 0); + + // Check all the possible values we support right now with weird casing. + tt_int_op(check_bridge_distribution_setting("NoNe"), OP_EQ, 0); + tt_int_op(check_bridge_distribution_setting("anY"), OP_EQ, 0); + tt_int_op(check_bridge_distribution_setting("hTTps"), OP_EQ, 0); + tt_int_op(check_bridge_distribution_setting("emAIl"), OP_EQ, 0); + tt_int_op(check_bridge_distribution_setting("moAt"), OP_EQ, 0); + + // Invalid values. + tt_int_op(check_bridge_distribution_setting("x\rx"), OP_EQ, -1); + tt_int_op(check_bridge_distribution_setting("x\nx"), OP_EQ, -1); + tt_int_op(check_bridge_distribution_setting("\t\t\t"), OP_EQ, -1); + done: return; } |