From 1ba09691453699b9fd1cfb39a0d0a548cd062801 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Fri, 11 Aug 2023 13:26:33 +0200 Subject: [PATCH 1/3] Handle non i386/amd4 arches in PI precission Signed-off-by: Jose Luis Rivero --- src/Helpers_TEST.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Helpers_TEST.cc b/src/Helpers_TEST.cc index 7734d16ca..8daa07daf 100644 --- a/src/Helpers_TEST.cc +++ b/src/Helpers_TEST.cc @@ -1006,7 +1006,7 @@ TEST(HelpersTest, AppendToStream) << std::setprecision(std::numeric_limits::digits10 + 1); math::appendToStream(out, pi); -#ifdef _WIN32 +#ifdef _WIN32 && !defined(__amd64__) && !defined(__i386__) EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.141592653589793"); #else EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.141592653589793239"); @@ -1016,7 +1016,7 @@ TEST(HelpersTest, AppendToStream) << std::setprecision(3); math::appendToStream(out, pi); -#ifdef _WIN32 +#ifdef _WIN32 && !defined(__amd64__) && !defined(__i386__) EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.141592653589793 3.14"); #else EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.141592653589793239 3.14"); From eed29f923b62b8a2480af4648af7c1218ecd1ba4 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Fri, 11 Aug 2023 13:27:17 +0200 Subject: [PATCH 2/3] Avoid to use zero as some arches return negative zero in str Signed-off-by: Jose Luis Rivero --- src/Pose_TEST.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pose_TEST.cc b/src/Pose_TEST.cc index dde17ce9c..6fbed09c8 100644 --- a/src/Pose_TEST.cc +++ b/src/Pose_TEST.cc @@ -181,10 +181,10 @@ TEST(PoseTest, ConstPose) ///////////////////////////////////////////////// TEST(PoseTest, OperatorStreamOut) { - math::Pose3d p(0.1, 1.2, 2.3, 0.0, 0.1, 1.0); + math::Pose3d p(0.1, 1.2, 2.3, 0.2, 0.1, 1.0); std::ostringstream stream; stream << p; - EXPECT_EQ(stream.str(), "0.1 1.2 2.3 0 0.1 1"); + EXPECT_EQ(stream.str(), "0.1 1.2 2.3 0.2 0.1 1"); } ///////////////////////////////////////////////// From c83702c113a3e65c4b135a44ea11d2cac030e166 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 22 Aug 2023 13:23:08 +0000 Subject: [PATCH 3/3] Fix preprocessor check Signed-off-by: Michael Carroll --- src/Helpers_TEST.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Helpers_TEST.cc b/src/Helpers_TEST.cc index 8daa07daf..3bd1fa2d1 100644 --- a/src/Helpers_TEST.cc +++ b/src/Helpers_TEST.cc @@ -1006,7 +1006,7 @@ TEST(HelpersTest, AppendToStream) << std::setprecision(std::numeric_limits::digits10 + 1); math::appendToStream(out, pi); -#ifdef _WIN32 && !defined(__amd64__) && !defined(__i386__) +#if defined(_WIN32) && !defined(__amd64__) && !defined(__i386__) EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.141592653589793"); #else EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.141592653589793239"); @@ -1016,7 +1016,7 @@ TEST(HelpersTest, AppendToStream) << std::setprecision(3); math::appendToStream(out, pi); -#ifdef _WIN32 && !defined(__amd64__) && !defined(__i386__) +#if defined(_WIN32) && !defined(__amd64__) && !defined(__i386__) EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.141592653589793 3.14"); #else EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.141592653589793239 3.14");