]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Resolve a compilation warning in test_connection.c
authorNick Mathewson <nickm@torproject.org>
Mon, 14 Sep 2020 15:50:38 +0000 (11:50 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 14 Sep 2020 15:50:38 +0000 (11:50 -0400)
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.

changes/bug40113 [new file with mode: 0644]
src/test/test_connection.c

diff --git a/changes/bug40113 b/changes/bug40113
new file mode 100644 (file)
index 0000000..adf4634
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes (compilation):
+    - Resolve a compilation warning that could occur in test_connection.c.
+      Fixes bug 40113; bugfix on 0.2.9.3-alpha.
index ebe7c6d36f766a954135dd7529187dcf0af36a3a..6f716f5758e9502b503a5757dc862a501d7b8a24 100644 (file)
@@ -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