From 933554c4c2b1f1925fdbf3ce9ccd9b632c8f172a Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Fri, 22 Jun 2018 16:02:51 +0100 Subject: Change move order generation --- src/test/test_helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/test/test_helper.cpp') diff --git a/src/test/test_helper.cpp b/src/test/test_helper.cpp index eaa0aba..ab9e0cb 100644 --- a/src/test/test_helper.cpp +++ b/src/test/test_helper.cpp @@ -22,7 +22,7 @@ bool test_helper::is_solvable(const std::string& input_file, const std::string& 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; -- cgit v1.2.1 From 2b92783762c2824e519b881afbf5d66a606c394f Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Mon, 25 Jun 2018 11:50:34 +0100 Subject: Add card face down unit tests --- src/test/test_helper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test/test_helper.cpp') diff --git a/src/test/test_helper.cpp b/src/test/test_helper.cpp index ab9e0cb..e1aa0a7 100644 --- a/src/test/test_helper.cpp +++ b/src/test/test_helper.cpp @@ -62,9 +62,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 piles, - vector exp_moves) { +void test_helper::expected_moves_test(sol_rules sr, + initializer_list piles, + vector exp_moves) { game_state gs(sr, piles); vector actual_moves = gs.get_legal_moves(); -- cgit v1.2.1 From 797400ea32ac1f6588e834fc1bcb42aa67fa6863 Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Tue, 26 Jun 2018 10:37:54 +0100 Subject: Finished klondike correct impl --- src/test/test_helper.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/test/test_helper.cpp') diff --git a/src/test/test_helper.cpp b/src/test/test_helper.cpp index e1aa0a7..1bc1f24 100644 --- a/src/test/test_helper.cpp +++ b/src/test/test_helper.cpp @@ -14,10 +14,12 @@ #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> 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); @@ -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{ + game_state gs = game_state(rules, string_il{ {}, {}, {}, @@ -63,7 +65,7 @@ void test_helper::run_foundations_dominance_test(sol_rules::build_policy policy, } void test_helper::expected_moves_test(sol_rules sr, - initializer_list piles, + string_il piles, vector exp_moves) { game_state gs(sr, piles); vector 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 << ")"; } -- cgit v1.2.1