aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-09-14 11:50:38 -0400
committerNick Mathewson <nickm@torproject.org>2020-09-14 11:50:38 -0400
commit020e8e41c676370de66d3ddf459700867ed454cd (patch)
treee4f6e184e8258cc1fc21b3201ffb9105ae6970f5 /src/test
parent72484a4953d744754b3b6b025242ef668e3f017a (diff)
downloadtor-020e8e41c676370de66d3ddf459700867ed454cd.tar.gz
tor-020e8e41c676370de66d3ddf459700867ed454cd.zip
Resolve a compilation warning in test_connection.c
Instead of casting an enum to a void and back, use a string -- that's better C anyway. Fixes bug 40113; bugfix on 0.2.9.3-alpha.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_connection.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/test_connection.c b/src/test/test_connection.c
index ebe7c6d36f..6f716f5758 100644
--- a/src/test/test_connection.c
+++ b/src/test/test_connection.c
@@ -592,7 +592,8 @@ test_conn_download_status(void *arg)
connection_t *ap_conn = NULL;
const struct testcase_t *tc = arg;
- consensus_flavor_t usable_flavor = (consensus_flavor_t)tc->setup_data;
+ consensus_flavor_t usable_flavor =
+ networkstatus_parse_flavor_name((const char*) tc->setup_data);
/* The "other flavor" trick only works if there are two flavors */
tor_assert(N_CONSENSUS_FLAVORS == 2);
@@ -893,9 +894,9 @@ struct testcase_t connection_tests[] = {
CONNECTION_TESTCASE(get_rend, TT_FORK, test_conn_get_rend_st),
CONNECTION_TESTCASE(get_rsrc, TT_FORK, test_conn_get_rsrc_st),
CONNECTION_TESTCASE_ARG(download_status, TT_FORK,
- test_conn_download_status_st, FLAV_MICRODESC),
+ test_conn_download_status_st, "microdesc"),
CONNECTION_TESTCASE_ARG(download_status, TT_FORK,
- test_conn_download_status_st, FLAV_NS),
+ test_conn_download_status_st, "ns"),
//CONNECTION_TESTCASE(func_suffix, TT_FORK, setup_func_pair),
{ "failed_orconn_tracker", test_failed_orconn_tracker, TT_FORK, NULL, NULL },
END_OF_TESTCASES