summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-10-13 14:11:27 -0400
committerNick Mathewson <nickm@torproject.org>2014-10-13 14:31:11 -0400
commit223d354e344ad3d07766b7c19e1841342c270ad2 (patch)
treeab2026149aec399fe4ff9a1e8a9d97228f1afa88 /src/test
parent39795e117f55fc951ea9ba0802ce5ce91e65ae33 (diff)
downloadtor-223d354e344ad3d07766b7c19e1841342c270ad2.tar.gz
tor-223d354e344ad3d07766b7c19e1841342c270ad2.zip
Bugfixes on bug11243 fix for the not-added cases and tests
1. The test that adds things to the cache needs to set the clock back so that the descriptors it adds are valid. 2. We split ROUTER_NOT_NEW into ROUTER_TOO_OLD, so that we can distinguish "already had it" from "rejected because of old published date". 3. We make extrainfo_insert() return a was_router_added_t, and we make its caller use it correctly. This is probably redundant with the extrainfo_is_bogus flag.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_dir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index 0499251352..e03efbeff5 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -618,6 +618,8 @@ test_dir_load_routers(void *arg)
MOCK(router_get_dl_status_by_descriptor_digest, mock_router_get_dl_status);
+ update_approx_time(1412510400);
+
smartlist_add(chunks, tor_strdup(EX_RI_MINIMAL));
smartlist_add(chunks, tor_strdup(EX_RI_BAD_FINGERPRINT));
smartlist_add(chunks, tor_strdup(EX_RI_BAD_SIG2));
@@ -708,12 +710,12 @@ mock_get_by_ei_desc_digest(const char *d)
}
static smartlist_t *mock_ei_insert_list = NULL;
-static int
+static was_router_added_t
mock_ei_insert(routerlist_t *rl, extrainfo_t *ei)
{
(void) rl;
smartlist_add(mock_ei_insert_list, ei);
- return 1;
+ return ROUTER_ADDED_SUCCESSFULLY;
}
static void