From f8931f348ef456d9fac78b5cadad280f81dfcfc6 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Wed, 27 Dec 2017 00:04:32 +0000 Subject: First sp test working --- src/test/test_helper.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/test/test_helper.cpp') diff --git a/src/test/test_helper.cpp b/src/test/test_helper.cpp index 5e08bc3..2e08829 100644 --- a/src/test/test_helper.cpp +++ b/src/test/test_helper.cpp @@ -2,8 +2,22 @@ // Created by thecharlesblake on 12/26/17. // +#include + #include "test_helper.h" +#include "../main/game/game_state.h" +#include "../main/solver/solver.h" +#include "../main/util/util.h" + +using namespace rapidjson; +using namespace std; + +bool test_helper::is_solvable(const std::string& input_file, const std::string& preset_type) { + const Document in_doc = util::get_file_json("resources/" + input_file + ".json"); + const sol_rules rules = sol_rules::from_preset(preset_type); + + game_state gs(rules, in_doc); + solver sol(gs, rules); -bool test_helper::is_solvable(std::string, std::string) { - return false; + return sol.run() ? true : false; } -- cgit v1.2.1