From 6ae91412d63b00a771f49e8ef3f39caae38bb080 Mon Sep 17 00:00:00 2001 From: Dennis Hezel Date: Sat, 26 Nov 2022 17:53:09 +0100 Subject: [PATCH] fix: Make unit.core.exe compile with MSVC --- CMakeLists.txt | 1 - appveyor.yml | 2 ++ test/unit/module/core/constants.cpp | 7 +++++-- test/unit/module/core/frexp.cpp | 1 + test/unit/module/core/hi.cpp | 2 +- test/unit/module/core/lo.cpp | 2 +- test/unit/module/core/scan.cpp | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bfe51144a3..c20b60e99e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,6 @@ endif() ## ================================================================================================= if( EVE_BUILD_TEST ) include(config/dependencies) - include(CTest) include(target/add_parent_target) include(config/compiler) include(config/types) diff --git a/appveyor.yml b/appveyor.yml index 7448fc66cbc..7d1e1fc34eb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,8 +12,10 @@ build_script: - cmake --build . --target unit.arch.exe --verbose --config Release - cmake --build . --target unit.meta.exe --verbose --config Release - cmake --build . --target unit.internals.exe --verbose --config Release +- cmake --build . --target unit.core.exe --verbose --config Release test_script: - ctest -C Release -VV -R ^unit.arch.*.exe - ctest -C Release -VV -R ^unit.meta.*.exe - ctest -C Release -VV -R ^unit.internals.*.exe +- ctest -C Release -VV -R ^unit.core.*.exe diff --git a/test/unit/module/core/constants.cpp b/test/unit/module/core/constants.cpp index 2f2d8ccf565..b192abb97c2 100644 --- a/test/unit/module/core/constants.cpp +++ b/test/unit/module/core/constants.cpp @@ -8,6 +8,9 @@ #include "test.hpp" #include +#include + +#include TTS_CASE_TPL("Check basic constants behavior", eve::test::simd::ieee_reals) (tts::type) @@ -23,7 +26,7 @@ TTS_CASE_TPL("Check basic constants behavior", eve::test::simd::ieee_reals) if constexpr( eve::floating_value ) { - TTS_IEEE_EQUAL(eve::allbits(as()), T(0.0 / 0.0)); + TTS_IEEE_EQUAL(eve::allbits(as()), T(std::numeric_limits::quiet_NaN())); TTS_EQUAL(eve::mzero(as()), T(-0)); TTS_EQUAL(eve::half(as()), T(0.5)); TTS_EQUAL(eve::mhalf(as()), T(-0.5)); @@ -40,7 +43,7 @@ TTS_CASE_TPL("Check ieee754 constants", eve::test::simd::ieee_reals) using ilt_t = eve::as_integer_t; using i_t = eve::as_integer_t; TTS_EQUAL(eve::bitincrement(as()), T(eve::bit_cast(eve::one(as()), as()))); - TTS_IEEE_EQUAL(eve::nan(as()), T(0.0 / 0.0)); + TTS_IEEE_EQUAL(eve::nan(as()), T(std::numeric_limits::quiet_NaN())); TTS_EQUAL(eve::signmask(as()), T(eve::bit_cast(eve::one(as()) << (sizeof(ilt_t) * 8 - 1), as()))); TTS_EQUAL(eve::mindenormal(as()), eve::bitincrement(as())); diff --git a/test/unit/module/core/frexp.cpp b/test/unit/module/core/frexp.cpp index 06e0f1b2d21..34d31364fd4 100644 --- a/test/unit/module/core/frexp.cpp +++ b/test/unit/module/core/frexp.cpp @@ -8,6 +8,7 @@ #include "test.hpp" #include +#include #include #include diff --git a/test/unit/module/core/hi.cpp b/test/unit/module/core/hi.cpp index aeff2fae79f..bddaabfda66 100644 --- a/test/unit/module/core/hi.cpp +++ b/test/unit/module/core/hi.cpp @@ -34,7 +34,7 @@ TTS_CASE_WITH("Check behavior of hi(wide) on unsigned integral ", { using v_t = eve::element_type_t; using d_t = eve::detail::downgrade_t; - constexpr int s = sizeof(v_t) * 4; + static constexpr int s = sizeof(v_t) * 4; if constexpr( s == 4 ) { TTS_EQUAL(eve::hi(a0), map([&](auto e) -> v_t { return d_t(eve::shr(e, s)); }, a0)); diff --git a/test/unit/module/core/lo.cpp b/test/unit/module/core/lo.cpp index ee4f4141a85..4c73e5217ab 100644 --- a/test/unit/module/core/lo.cpp +++ b/test/unit/module/core/lo.cpp @@ -34,7 +34,7 @@ TTS_CASE_WITH("Check behavior of lo(wide) on unsigned integral ", { using v_t = eve::element_type_t; using d_t = eve::detail::downgrade_t; - constexpr int s = sizeof(v_t) * 4; + static constexpr int s = sizeof(v_t) * 4; if constexpr( s == 4 ) { TTS_EQUAL(eve::lo(a0), diff --git a/test/unit/module/core/scan.cpp b/test/unit/module/core/scan.cpp index 050229e639b..59df5d0db23 100644 --- a/test/unit/module/core/scan.cpp +++ b/test/unit/module/core/scan.cpp @@ -10,7 +10,7 @@ #include -#include +#include #include template