}
+void BlockTest::testOrientation() {
+ Block block(0, Block::FACE_DOWN, Block::TURN_LEFT);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "wrong block face after initialization",
+ block.GetFace(), Block::FACE_DOWN
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "wrong block turn after initialization",
+ block.GetTurn(), Block::TURN_LEFT
+ );
+
+ block.SetFace(Block::FACE_BACK);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "changing block face has unexpected effect",
+ block.GetFace(), Block::FACE_BACK
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "changing block face affected turn",
+ block.GetTurn(), Block::TURN_LEFT
+ );
+
+ block.SetTurn(Block::TURN_AROUND);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "changing block turn has unexpected effect",
+ block.GetTurn(), Block::TURN_AROUND
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "changing block turn affected face",
+ block.GetFace(), Block::FACE_BACK
+ );
+}
+
void BlockTest::testFaceOpposite() {
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"DOWN not opposite of UP",
CPPUNIT_TEST_SUITE(BlockTest);
+CPPUNIT_TEST(testOrientation);
CPPUNIT_TEST(testFaceOpposite);
CPPUNIT_TEST(testFaceAxis);
CPPUNIT_TEST(testFaceNormal);
void setUp();
void tearDown();
+ void testOrientation();
+
void testFaceOpposite();
void testFaceAxis();
void testFaceNormal();