aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test_helper.cpp')
-rw-r--r--src/test/test_helper.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/test/test_helper.cpp b/src/test/test_helper.cpp
index eaa0aba..1bc1f24 100644
--- a/src/test/test_helper.cpp
+++ b/src/test/test_helper.cpp
@@ -14,15 +14,17 @@
#define ASSERT_(t_f, statement) ASSERT_TRUE((statement) == (t_f))
using namespace rapidjson;
-using std::initializer_list;
using std::vector;
using std::ostream;
+typedef std::initializer_list<std::initializer_list<std::string>> string_il;
+
+
bool test_helper::is_solvable(const std::string& input_file, const std::string& preset_type) {
const Document in_doc = json_helper::get_file_json(input_file);
const sol_rules rules = rules_parser::from_preset(preset_type);
- game_state gs(rules, in_doc);
+ game_state gs(rules, in_doc, false);
solver sol(gs, 1000000);
return sol.run() == solver::sol_state::solved;
@@ -35,7 +37,7 @@ void test_helper::run_foundations_dominance_test(sol_rules::build_policy policy,
rules.foundations_removable = false;
rules.cells = 0;
- game_state gs = game_state(rules, std::initializer_list<pile>{
+ game_state gs = game_state(rules, string_il{
{},
{},
{},
@@ -62,9 +64,9 @@ void test_helper::run_foundations_dominance_test(sol_rules::build_policy policy,
ASSERT_TRUE(i->child_moves.empty());
}
-void test_helper::run_built_group_test(sol_rules sr,
- initializer_list<pile> piles,
- vector<move> exp_moves) {
+void test_helper::expected_moves_test(sol_rules sr,
+ string_il piles,
+ vector<move> exp_moves) {
game_state gs(sr, piles);
vector<move> actual_moves = gs.get_legal_moves();
@@ -88,6 +90,7 @@ ostream& operator <<(ostream& os, const move& m) {
return os << "move:(" << int(m.from)
<< "," << int(m.to)
<< "," << int(m.count)
+ << "," << m.reveal_move
<< ")";
}