From 829cf3b5026702eb8cbaba62c37acec85647b676 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Wed, 4 May 2022 11:11:07 -0600 Subject: [PATCH] Apply compiler warnings to test utilities --- test/CMakeLists.txt | 1 + test/TestUtilities/SystemUtil.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index da311613f..70848031d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,6 +10,7 @@ add_library(sfml-test-main STATIC target_include_directories(sfml-test-main SYSTEM PUBLIC "${PROJECT_SOURCE_DIR}/extlibs/headers") target_include_directories(sfml-test-main PUBLIC TestUtilities) target_link_libraries(sfml-test-main PUBLIC SFML::System) +set_target_warnings(sfml-test-main) SET(SYSTEM_SRC System/Angle.cpp diff --git a/test/TestUtilities/SystemUtil.cpp b/test/TestUtilities/SystemUtil.cpp index d0eaa959f..699b344fb 100644 --- a/test/TestUtilities/SystemUtil.cpp +++ b/test/TestUtilities/SystemUtil.cpp @@ -37,12 +37,12 @@ namespace sf bool operator==(const sf::Vector2f& lhs, const ApproxVec& rhs) { - return (lhs - rhs.vector).length() == doctest::Approx(0.0); + return static_cast((lhs - rhs.vector).length()) == doctest::Approx(0.0); } bool operator==(const sf::Angle& lhs, const ApproxDeg& rhs) { - return lhs.asDegrees() == doctest::Approx(rhs.degrees); + return static_cast(lhs.asDegrees()) == doctest::Approx(static_cast(rhs.degrees)); } std::ostream& operator <<(std::ostream& os, const ApproxVec& approx)