aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_entrynodes.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-11-14 12:04:42 -0500
committerNick Mathewson <nickm@torproject.org>2016-11-30 14:42:52 -0500
commit823357dbe4874e9726749f1d9d16d85fab949ee5 (patch)
treed712de33dc862c0547ef32d86e2110532d042ded /src/test/test_entrynodes.c
parentbe447bc7700bc91c3b0f2475c06d1e9e64c90804 (diff)
downloadtor-823357dbe4874e9726749f1d9d16d85fab949ee5.tar.gz
tor-823357dbe4874e9726749f1d9d16d85fab949ee5.zip
Add an entry_guard_describe() function
This function helpfully removes all but one remaining use of an entry_guard_t private field in pathbias.c
Diffstat (limited to 'src/test/test_entrynodes.c')
-rw-r--r--src/test/test_entrynodes.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 781fa4d195..aa1b455ff1 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -843,6 +843,22 @@ test_node_preferred_orport(void *arg)
UNMOCK(get_options);
}
+static void
+test_entry_guard_describe(void *arg)
+{
+ (void)arg;
+ entry_guard_t g;
+ memset(&g, 0, sizeof(g));
+ strlcpy(g.nickname, "okefenokee", sizeof(g.nickname));
+ memcpy(g.identity, "theforestprimeval---", DIGEST_LEN);
+
+ tt_str_op(entry_guard_describe(&g), OP_EQ,
+ "okefenokee ($746865666F726573747072696D6576616C2D2D2D)");
+
+ done:
+ ;
+}
+
static const struct testcase_setup_t fake_network = {
fake_network_setup, fake_network_cleanup
};
@@ -876,6 +892,7 @@ struct testcase_t entrynodes_tests[] = {
{ "node_preferred_orport",
test_node_preferred_orport,
0, NULL, NULL },
+ { "entry_guard_describe", test_entry_guard_describe, 0, NULL, NULL },
END_OF_TESTCASES
};