From eecf4b1e666211a13afa56f93477c55e8fd01621 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 2 Jun 2022 19:51:54 +0200 Subject: feat: implement game of life --- test/string_matrix.test.cpp | 53 --------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 test/string_matrix.test.cpp (limited to 'test/string_matrix.test.cpp') diff --git a/test/string_matrix.test.cpp b/test/string_matrix.test.cpp deleted file mode 100644 index 522a274..0000000 --- a/test/string_matrix.test.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "engine/graphics/string_matrix.hpp" -#include "engine/data/bounds.hpp" - -#include -#include - -constexpr uint32_t MATRIX_WIDTH = 76; -constexpr uint32_t MATRIX_HEIGHT = 31; - -TEST_CASE("String matrix") -{ - auto string_matrix = - StringMatrix(Bounds({.width = MATRIX_WIDTH, .height = MATRIX_HEIGHT})); - - SUBCASE("Can set & get elements") - { - // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers) - const auto position = Vector2({.x = 56, .y = 20}); - - string_matrix.set(position, "#"); - - CHECK(string_matrix.get(position) == "#"); - } - - SUBCASE("Can iterate") - { - CHECK(std::is_same_v>); - - CHECK(std::is_same_v>); - - uint32_t row_iter_cnt = 0; - - for (auto row : string_matrix) - { - row_iter_cnt++; - - CHECK(std::is_same_v>); - - uint32_t col_iter_cnt = 0; - - for (auto &col : row) - { - col_iter_cnt++; - } - - CHECK(col_iter_cnt == MATRIX_WIDTH); - } - - CHECK(row_iter_cnt == MATRIX_HEIGHT); - } -} -- cgit v1.2.3-18-g5258