void dump(const Hand &h){ switch(h.type){ case HandType::PASS: std::cout << "type:Pass "; break; case HandType::GROUP: std::cout << "type:Group "; break; case HandType::STAIR: std::cout << "type:Stair "; break; default: std::cout << "type:broken("<<(int)h.type<<") "; } std::cout << "low: " << (int)h.low << " "; std::cout << "high: " << (int)h.high << " "; std::cout << "joker: " << (int)h.joker << " "; dump(h.cards()); }
TEST(Hand_Stair,cards){ Hand h = Hand::Stair(0x1,1,3); ASSERT_EQ(h.cards(),0x1110ull); h = Hand::Stair(0x1,1,3,2); ASSERT_EQ(h.cards(),0x1010ull|JOKER); }
TEST(Hand_Group,cards){ Hand h = Hand::Group(0x1,1); ASSERT_EQ(h.cards(),0x10ull); h = Hand::Group(0xf,1,0x1); ASSERT_EQ(h.cards(),JOKER|0xe0ull); }