#include "../src/logic/Board.h" #include #include int main() { using logic::Board; Board b; // board starts empty for (int y = 0; y < Board::Height; ++y) for (int x = 0; x < Board::Width; ++x) assert(b.at(x,y) == Board::Cell::Empty); // fill a single full row at bottom int y = Board::Height - 1; for (int x = 0; x < Board::Width; ++x) b.set(x, y, Board::Cell::Filled); int cleared = b.clearFullLines(); assert(cleared == 1); // bottom row should be empty after clear for (int x = 0; x < Board::Width; ++x) assert(b.at(x, Board::Height - 1) == Board::Cell::Empty); // fill two non-adjacent rows and verify both clear int y1 = Board::Height - 1; int y2 = Board::Height - 3; for (int x = 0; x < Board::Width; ++x) { b.set(x, y1, Board::Cell::Filled); b.set(x, y2, Board::Cell::Filled); } cleared = b.clearFullLines(); assert(cleared == 2); std::cout << "tests/test_board: all assertions passed\n"; return 0; }