aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_nodelist.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-07-14 10:43:49 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-07-14 10:49:43 -0400
commit06ccf12258b4ed480cf387f0291e26d41ff4450a (patch)
tree26abd1dbc482e5f73bdc909bcd24469207dfe59b /src/test/test_nodelist.c
parente594195aa2faa153e997f12dbcaebae4281ff925 (diff)
downloadtor-06ccf12258b4ed480cf387f0291e26d41ff4450a.tar.gz
tor-06ccf12258b4ed480cf387f0291e26d41ff4450a.zip
node: Standardize interface of format_node_description()
Pass the IPv4 before the IPv6 like all our other interfaces. Changes unreleased code related to #40043. Closes #40045 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_nodelist.c')
-rw-r--r--src/test/test_nodelist.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/test_nodelist.c b/src/test/test_nodelist.c
index ab7bc030a6..c165eebb63 100644
--- a/src/test/test_nodelist.c
+++ b/src/test/test_nodelist.c
@@ -703,8 +703,8 @@ test_nodelist_format_node_description(void *arg)
rv = format_node_description(ndesc,
mock_digest,
mock_nickname,
- &mock_null_ip,
- NULL);
+ NULL,
+ &mock_null_ip);
tt_ptr_op(rv, OP_EQ, ndesc);
tt_str_op(ndesc, OP_EQ,
"$AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA~TestOR7890123456789");
@@ -722,8 +722,8 @@ test_nodelist_format_node_description(void *arg)
rv = format_node_description(ndesc,
mock_digest,
mock_nickname,
- &mock_ipv6,
- NULL);
+ NULL,
+ &mock_ipv6);
tt_ptr_op(rv, OP_EQ, ndesc);
tt_str_op(ndesc, OP_EQ,
"$AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA~TestOR7890123456789 at "
@@ -732,18 +732,18 @@ test_nodelist_format_node_description(void *arg)
rv = format_node_description(ndesc,
mock_digest,
mock_nickname,
- &mock_ipv6,
- &mock_ipv4);
+ &mock_ipv4,
+ &mock_ipv6);
tt_ptr_op(rv, OP_EQ, ndesc);
tt_str_op(ndesc, OP_EQ,
"$AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA~TestOR7890123456789 at "
"111.222.233.244 and [1111:2222:3333:4444:5555:6666:7777:8888]");
/* test NULL handling */
- rv = format_node_description(NULL, NULL, NULL, NULL, 0);
+ rv = format_node_description(NULL, NULL, NULL, NULL, NULL);
tt_str_op(rv, OP_EQ, "<NULL BUFFER>");
- rv = format_node_description(ndesc, NULL, NULL, NULL, 0);
+ rv = format_node_description(ndesc, NULL, NULL, NULL, NULL);
tt_ptr_op(rv, OP_EQ, ndesc);
tt_str_op(rv, OP_EQ, "<NULL ID DIGEST>");