diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/platform/CMakeLists.txt | 3 | ||||
-rw-r--r-- | test/platform/MatrixTest.cpp | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/test/platform/CMakeLists.txt b/test/platform/CMakeLists.txt index 6a6f81e5..394aa247 100644 --- a/test/platform/CMakeLists.txt +++ b/test/platform/CMakeLists.txt @@ -9,7 +9,8 @@ if (WIN32) endif() if (UNIX AND NOT EMSCRIPTEN) - add_subdirectory(graphics/cairo) + # TODO: Re-enable this! + # add_subdirectory(graphics/cairo) endif() cru_catch_discover_tests(CruPlatformBaseTest) diff --git a/test/platform/MatrixTest.cpp b/test/platform/MatrixTest.cpp index b19b25fe..c107ddc3 100644 --- a/test/platform/MatrixTest.cpp +++ b/test/platform/MatrixTest.cpp @@ -2,13 +2,14 @@ #include "cru/platform/Matrix.h" #include <catch2/catch_test_macros.hpp> -#include "catch2/catch_approx.hpp" +#include <catch2/catch_approx.hpp> using Catch::Approx; using cru::platform::Matrix; -using cru::platform::Point; TEST_CASE("Matrix Rotation", "[matrix]") { + using cru::platform::Point; + Point p(1, 1); Point p90 = Matrix::Rotation(90).TransformPoint(p); @@ -25,6 +26,8 @@ TEST_CASE("Matrix Rotation", "[matrix]") { } TEST_CASE("Matrix TranslationAndRotation", "[matrix]") { + using cru::platform::Point; + Point p = (Matrix::Translation(1, 1) * Matrix::Rotation(90)).TransformPoint({1, 1}); REQUIRE(p.x == Approx(-2)); @@ -32,6 +35,8 @@ TEST_CASE("Matrix TranslationAndRotation", "[matrix]") { } TEST_CASE("Matrix RotationAndTranslation", "[matrix]") { + using cru::platform::Point; + Point p = (Matrix::Rotation(90) * Matrix::Translation(1, 1)).TransformPoint({1, 1}); REQUIRE(p.x == Approx(0)); |