aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_helper.cpp
diff options
context:
space:
mode:
authorthecharlesblake2018-02-23 11:46:25 +0000
committerthecharlesblake2018-02-23 11:46:25 +0000
commit2818331334330b65e94d69f228a13e312f0c5abd (patch)
tree14166805f0b6b771a057032c02e72bee7b8396a5 /src/test/test_helper.cpp
parentAdd reduce suit streamliner: replace card symmetry (diff)
downloadmetasol-2818331334330b65e94d69f228a13e312f0c5abd.tar.gz
metasol-2818331334330b65e94d69f228a13e312f0c5abd.zip

Remove card symmetry from tests

Diffstat (limited to 'src/test/test_helper.cpp')
-rw-r--r--src/test/test_helper.cpp53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/test/test_helper.cpp b/src/test/test_helper.cpp
index 246de38..da618d8 100644
--- a/src/test/test_helper.cpp
+++ b/src/test/test_helper.cpp
@@ -26,59 +26,6 @@ bool test_helper::is_solvable(const std::string& input_file, const std::string&
return sol.run();
}
-void test_helper::run_card_cache_test(sol_rules::build_policy bp,
- bool assert_dif_col,
- bool assert_same_col) {
- sol_rules rules;
- rules.tableau_pile_count = 1;
- rules.build_pol = bp;
-
- for (uint8_t suit_idx = 0; suit_idx < 4; suit_idx++) {
- for (card::rank_t rank = 1; rank <= 13; rank++) {
- // c2 is the same as c_ but with a different suit
- const card c = card(suit_idx, rank);
- const card c_dif_col = card(uint8_t((suit_idx + 1) % 4), rank);
- const card c_same_col = card(uint8_t((suit_idx + 2) % 4), rank);
- const card c_dif_rank = card(suit_idx, card::rank_t((rank % 13) + 1));
-
- const game_state s = game_state(rules, initializer_list<pile>{{c}});
- const game_state s_dif_suit(rules, initializer_list<pile>{{c_dif_col}});
- const game_state s_same_col(rules, initializer_list<pile>{{c_same_col}});
- const game_state s_dif_rank(rules, initializer_list<pile>{{c_dif_rank}});
-
- global_cache cache(s);
-
- cache.insert(s);
-
- ASSERT_TRUE(cache.contains(s)) << "Contains self";
-
- ASSERT_(assert_dif_col, hasher(s)(cached_game_state(s))
- == hasher(s)(cached_game_state(s_dif_suit)))
- << "Insert: " << c.to_string()
- << ", Comp: " << c_dif_col.to_string();
- ASSERT_(assert_dif_col, cache.contains(s_dif_suit))
- << "Insert: " << c.to_string()
- << ", Comp: " << c_dif_col.to_string();
-
- ASSERT_(assert_same_col, hasher(s)(cached_game_state(s))
- == hasher(s)(cached_game_state(s_same_col)))
- << "Insert: " << c.to_string()
- << ", Comp: " << c_same_col.to_string();
- ASSERT_(assert_same_col, cache.contains(s_same_col))
- << "Insert: " << c.to_string()
- << ", Comp: " << c_same_col.to_string();
-
- ASSERT_FALSE(hasher(s)(cached_game_state(s))
- == hasher(s)(cached_game_state(s_dif_rank)))
- << "Insert: " << c.to_string()
- << ", Comp: " << c_dif_rank.to_string();
- ASSERT_FALSE(cache.contains(s_dif_rank))
- << "Insert: " << c.to_string()
- << ", Comp: " << c_dif_rank.to_string();
- }
- }
-}
-
void test_helper::run_foundations_dominance_test(sol_rules::build_policy policy,
std::vector<card> cards) {
sol_rules rules = rules_parser::from_preset("simple-free-cell");