From 6216751bd42c9241d9c6e10593167f8c22e8b1bf Mon Sep 17 00:00:00 2001 From: Soeren Peters <peters@irmb.tu-bs.de> Date: Fri, 22 Dec 2023 08:53:13 +0000 Subject: [PATCH] use RealEq --- src/basics/CMakeLists.txt | 1 - src/cpu/core/CMakeLists.txt | 1 - src/gpu/core/CMakeLists.txt | 1 - tests/unit-tests/gpu/GridGenerator/grid/GridImpTest.cpp | 8 +++++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/basics/CMakeLists.txt b/src/basics/CMakeLists.txt index 40ccda2b4..a85bde19a 100644 --- a/src/basics/CMakeLists.txt +++ b/src/basics/CMakeLists.txt @@ -86,7 +86,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") target_compile_options(basics PRIVATE "/wd4100") # unreferenced formal parameter target_compile_options(basics PRIVATE "/wd4701") # potentially uninitialized local variable target_compile_options(basics PRIVATE "/wd4703") # potentially uninitialized local pointer - target_compile_options(basics PRIVATE "/wd4458") # declaration of 'XXX' hides class member target_compile_options(basics PRIVATE "/wd4305") #'initializing': truncation from double to float target_compile_options(basics PRIVATE "/wd4242") #'conversion from 'int' to 'char', possible loss of data endif() \ No newline at end of file diff --git a/src/cpu/core/CMakeLists.txt b/src/cpu/core/CMakeLists.txt index 2d42d40f0..94dc320bc 100644 --- a/src/cpu/core/CMakeLists.txt +++ b/src/cpu/core/CMakeLists.txt @@ -96,7 +96,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") target_compile_options(${library_name} PUBLIC "/wd4100") # unreferenced formal parameter target_compile_options(${library_name} PUBLIC "/wd4701") # potentially uninitialized local variable target_compile_options(${library_name} PUBLIC "/wd4703") # potentially uninitialized local pointer - target_compile_options(${library_name} PUBLIC "/wd4458") # declaration of 'XXX' hides class member target_compile_options(${library_name} PUBLIC "/wd4305") #'initializing': truncation from double to float target_compile_options(${library_name} PUBLIC "/wd4505") # C4505: 'XXX': unreferenced local function has been removed target_compile_options(${library_name} PUBLIC "/wd4310") # C4310: cast truncates constant value, triggerd by muParserbase.h diff --git a/src/gpu/core/CMakeLists.txt b/src/gpu/core/CMakeLists.txt index 9567019a0..da1246f06 100644 --- a/src/gpu/core/CMakeLists.txt +++ b/src/gpu/core/CMakeLists.txt @@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") list(APPEND WARNINGS "/wd4100") # unreferenced formal parameter list(APPEND WARNINGS "/wd4701") # potentially uninitialized local variable list(APPEND WARNINGS "/wd4703") # potentially uninitialized local pointer - list(APPEND WARNINGS "/wd4458") # declaration of 'XXX' hides class member list(APPEND WARNINGS "/wd4305") # 'initializing': truncation from double to float list(APPEND WARNINGS "/wd4505") # 'XXX': unreferenced local function has been removed list(APPEND WARNINGS "/wd4324") # structure was padded due to alignment specifier diff --git a/tests/unit-tests/gpu/GridGenerator/grid/GridImpTest.cpp b/tests/unit-tests/gpu/GridGenerator/grid/GridImpTest.cpp index 7ddec9588..bed2456b7 100644 --- a/tests/unit-tests/gpu/GridGenerator/grid/GridImpTest.cpp +++ b/tests/unit-tests/gpu/GridGenerator/grid/GridImpTest.cpp @@ -37,6 +37,8 @@ #include <memory> #include <ostream> +#include <basics/tests/testUtilities.h> + #include <gpu/GridGenerator/grid/GridImp.h> #include "PointerDefinitions.h" @@ -310,9 +312,9 @@ void compareNodeToCoordinates(SPtr<Grid> grid, int index, real xExpected, real y { real xNode, yNode, zNode; grid->transIndexToCoords(index, xNode, yNode, zNode); - EXPECT_FLOAT_EQ(xNode, xExpected) << message; - EXPECT_FLOAT_EQ(yNode, yExpected) << message; - EXPECT_FLOAT_EQ(zNode, zExpected) << message; + EXPECT_THAT(xNode, RealEq(xExpected)) << message; + EXPECT_THAT(yNode, RealEq(yExpected)) << message; + EXPECT_THAT(zNode, RealEq(zExpected)) << message; } void iterateOverXLine(std::shared_ptr<Grid> grid, uint iy, uint iz, std::function<void(int, const std::string&)> func) -- GitLab