summaryrefslogtreecommitdiff
path: root/src/test/testhelper.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2014-09-15 15:51:20 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2014-09-15 16:07:48 +0300
commita72b92676e936e4936073e10a2452a12982e7ab4 (patch)
tree2c0dfeefc9e50a2c7cb6b3d5fa14c38ee83d35f9 /src/test/testhelper.c
parent532ab7e13cac4c9ba1cdb1e6e008b0e5cb2afff4 (diff)
downloadtor-a72b92676e936e4936073e10a2452a12982e7ab4.tar.gz
tor-a72b92676e936e4936073e10a2452a12982e7ab4.zip
Fix up testhelper to be used by the entryguard unittests.
Diffstat (limited to 'src/test/testhelper.c')
-rw-r--r--src/test/testhelper.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/test/testhelper.c b/src/test/testhelper.c
index 4e23f0c3df..8bbc192a6c 100644
--- a/src/test/testhelper.c
+++ b/src/test/testhelper.c
@@ -24,9 +24,9 @@ router_descriptor_is_older_than_replacement(const routerinfo_t *router,
/** Parse a file containing router descriptors and load them to our
routerlist. This function is used to setup an artificial network
- so that we can conduct entry guard tests. */
-static void
-setup_fake_routerlist(void)
+ so that we can conduct tests on it. */
+void
+helper_setup_fake_routerlist(void)
{
int retval;
routerlist_t *our_routerlist = NULL;
@@ -43,15 +43,16 @@ setup_fake_routerlist(void)
retval = router_load_routers_from_string(TEST_DESCRIPTORS,
NULL, SAVED_IN_JOURNAL,
NULL, 0, NULL);
- tt_int_op(retval, ==, NUMBER_OF_DESCRIPTORS);
+ tt_int_op(retval, ==, HELPER_NUMBER_OF_DESCRIPTORS);
/* Sanity checking of routerlist and nodelist. */
our_routerlist = router_get_routerlist();
- tt_int_op(smartlist_len(our_routerlist->routers), ==, NUMBER_OF_DESCRIPTORS);
+ tt_int_op(smartlist_len(our_routerlist->routers), ==,
+ HELPER_NUMBER_OF_DESCRIPTORS);
routerlist_assert_ok(our_routerlist);
our_nodelist = nodelist_get_list();
- tt_int_op(smartlist_len(our_nodelist), ==, NUMBER_OF_DESCRIPTORS);
+ tt_int_op(smartlist_len(our_nodelist), ==, HELPER_NUMBER_OF_DESCRIPTORS);
/* Mark all routers as non-guards but up and running! */
SMARTLIST_FOREACH_BEGIN(our_nodelist, node_t *, node) {
@@ -63,3 +64,4 @@ setup_fake_routerlist(void)
done:
UNMOCK(router_descriptor_is_older_than);
}
+