aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_entrynodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test_entrynodes.c')
-rw-r--r--src/test/test_entrynodes.c62
1 files changed, 35 insertions, 27 deletions
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 2391e10cd6..cb694106c4 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -10,39 +10,42 @@
#define ROUTERLIST_PRIVATE
#define DIRECTORY_PRIVATE
-#include "or/or.h"
+#include "core/or/or.h"
#include "test/test.h"
-#include "or/bridges.h"
-#include "or/circuitlist.h"
-#include "or/circuitbuild.h"
-#include "or/config.h"
-#include "or/confparse.h"
+#include "feature/client/bridges.h"
+#include "core/or/circuitlist.h"
+#include "core/or/circuitbuild.h"
+#include "app/config/config.h"
+#include "app/config/confparse.h"
#include "lib/crypt_ops/crypto_rand.h"
-#include "or/directory.h"
-#include "or/entrynodes.h"
-#include "or/nodelist.h"
-#include "or/networkstatus.h"
-#include "or/policies.h"
-#include "or/routerlist.h"
-#include "or/routerparse.h"
-#include "or/routerset.h"
-#include "or/statefile.h"
-#include "common/util.h"
-
-#include "or/cpath_build_state_st.h"
-#include "or/crypt_path_st.h"
-#include "or/dir_connection_st.h"
-#include "or/microdesc_st.h"
-#include "or/networkstatus_st.h"
-#include "or/node_st.h"
-#include "or/origin_circuit_st.h"
-#include "or/routerinfo_st.h"
-#include "or/routerstatus_st.h"
+#include "feature/dircache/directory.h"
+#include "feature/client/entrynodes.h"
+#include "feature/nodelist/nodelist.h"
+#include "feature/nodelist/networkstatus.h"
+#include "core/or/policies.h"
+#include "feature/nodelist/routerlist.h"
+#include "feature/nodelist/routerparse.h"
+#include "feature/nodelist/routerset.h"
+#include "app/config/statefile.h"
+
+#include "core/or/cpath_build_state_st.h"
+#include "core/or/crypt_path_st.h"
+#include "feature/dircommon/dir_connection_st.h"
+#include "feature/nodelist/microdesc_st.h"
+#include "feature/nodelist/networkstatus_st.h"
+#include "feature/nodelist/node_st.h"
+#include "core/or/origin_circuit_st.h"
+#include "app/config/or_state_st.h"
+#include "feature/nodelist/routerinfo_st.h"
+#include "feature/nodelist/routerstatus_st.h"
#include "test/test_helpers.h"
#include "test/log_test_helpers.h"
+#include "lib/container/bloomfilt.h"
+#include "lib/encoding/confline.h"
+
/* TODO:
* choose_random_entry() test with state set.
*
@@ -1160,6 +1163,7 @@ test_entry_guard_update_from_consensus_status(void *arg)
for (i = 0; i < 5; ++i) {
entry_guard_t *g = smartlist_get(gs->sampled_entry_guards, i);
node_t *n = (node_t*) bfn_mock_node_get_by_id(g->identity);
+ tt_assert(n);
n->is_possible_guard = 0;
}
@@ -1198,6 +1202,7 @@ test_entry_guard_update_from_consensus_status(void *arg)
{
entry_guard_t *g = smartlist_get(gs->sampled_entry_guards, 0);
node_t *n = (node_t*) bfn_mock_node_get_by_id(g->identity);
+ tt_assert(n);
n->is_possible_guard = 1;
}
{
@@ -1205,6 +1210,7 @@ test_entry_guard_update_from_consensus_status(void *arg)
*/
entry_guard_t *g = smartlist_get(gs->sampled_entry_guards, 5);
node_t *n = (node_t*) bfn_mock_node_get_by_id(g->identity);
+ tt_assert(n);
smartlist_remove(big_fake_net_nodes, n);
test_node_free(n);
}
@@ -1261,6 +1267,7 @@ test_entry_guard_update_from_consensus_repair(void *arg)
/* these will get a date. */
entry_guard_t *g = smartlist_get(gs->sampled_entry_guards, i);
node_t *n = (node_t*) bfn_mock_node_get_by_id(g->identity);
+ tt_assert(n);
n->is_possible_guard = 0;
g->currently_listed = 0;
}
@@ -1326,6 +1333,7 @@ test_entry_guard_update_from_consensus_remove(void *arg)
{
entry_guard_t *g = smartlist_get(gs->sampled_entry_guards, 0);
node_t *n = (node_t*) bfn_mock_node_get_by_id(g->identity);
+ tt_assert(n);
n->is_possible_guard = 0;
g->currently_listed = 0;
g->unlisted_since_date = one_day_ago;
@@ -1335,6 +1343,7 @@ test_entry_guard_update_from_consensus_remove(void *arg)
{
entry_guard_t *g = smartlist_get(gs->sampled_entry_guards, 1);
node_t *n = (node_t*) bfn_mock_node_get_by_id(g->identity);
+ tt_assert(n);
n->is_possible_guard = 0;
g->currently_listed = 0;
g->unlisted_since_date = one_year_ago;
@@ -3074,4 +3083,3 @@ struct testcase_t entrynodes_tests[] = {
END_OF_TESTCASES
};
-