aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_helper.cpp
diff options
context:
space:
mode:
authorCharlie Blake2018-06-19 16:48:56 +0100
committerCharlie Blake2018-06-19 17:36:17 +0100
commit2bad89dfd8d100145526637c5ef33b8f410014df (patch)
tree1fb5c123465c39b77c05e6857621bc06bfc34b4f /src/test/test_helper.cpp
parentAdd option to resume stopped run (diff)
downloadmetasol-2bad89dfd8d100145526637c5ef33b8f410014df.tar.gz
metasol-2bad89dfd8d100145526637c5ef33b8f410014df.zip

Reduce memory taken up by dfs datastructures

Diffstat (limited to 'src/test/test_helper.cpp')
-rw-r--r--src/test/test_helper.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/test/test_helper.cpp b/src/test/test_helper.cpp
index b58c410..eaa0aba 100644
--- a/src/test/test_helper.cpp
+++ b/src/test/test_helper.cpp
@@ -49,15 +49,17 @@ void test_helper::run_foundations_dominance_test(sol_rules::build_policy policy,
solver sol(gs, 1000000);
sol.run();
- solver::node const *n = &sol.get_search_tree();
+ auto frontier = sol.get_frontier();
+ auto i = std::begin(frontier);
+
for (card c : cards) {
- n = &n->children.back();
- ASSERT_TRUE(n->mv.type == move::mtype::dominance);
- ASSERT_TRUE(gs.get_data()[n->mv.from].top_card() == c);
- ASSERT_TRUE(n->mv.to >= 0 && n->mv.to <= 4);
- gs.make_move(n->mv);
+ i++;
+ ASSERT_TRUE(i->mv.type == move::mtype::dominance);
+ ASSERT_TRUE(gs.get_data()[i->mv.from].top_card() == c);
+ ASSERT_TRUE(i->mv.to >= 0 && i->mv.to <= 4);
+ gs.make_move(i->mv);
}
- ASSERT_TRUE(n->children.empty());
+ ASSERT_TRUE(i->child_moves.empty());
}
void test_helper::run_built_group_test(sol_rules sr,