diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-06-15 01:02:30 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-06-15 01:02:30 +0800 |
commit | d868d7b0d463ede80b761f87f10d4e25f52989c3 (patch) | |
tree | eb61e339f15b6b8b4cc1a246b4281631e701d6e0 /test | |
parent | 7ac84c9d200d43f50155ce1e8316ada12043f7a8 (diff) | |
download | cru-d868d7b0d463ede80b761f87f10d4e25f52989c3.tar.gz cru-d868d7b0d463ede80b761f87f10d4e25f52989c3.tar.bz2 cru-d868d7b0d463ede80b761f87f10d4e25f52989c3.zip |
Remove some files of OSX. Symbol Point is conflict and needs to be
fixed.
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)); |