Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Pose_TEST patch (send upstream) #1

Merged
merged 1 commit into from
Nov 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions ubuntu/debian/patches/0004_fix_test_pose_zero_positive.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ diff --git a/src/Pose_TEST.cc b/src/Pose_TEST.cc
index a41c284..3c98771 100644
--- a/src/Pose_TEST.cc
+++ b/src/Pose_TEST.cc
@@ -152,8 +152,11 @@ TEST(PoseTest, OperatorStreamOut)
@@ -184,6 +184,9 @@ TEST(PoseTest, OperatorStreamOut)
math::Pose3d p(0.1, 1.2, 2.3, 0.0, 0.1, 1.0);
std::ostringstream stream;
stream << p;
- EXPECT_EQ(stream.str(), "0.1 1.2 2.3 0 0.1 1");
-}
+ // some compiler optimizations returns negative zero (-0) in the stream, workaround
+ // using prefix and postfix check. Not nice I know.
+ EXPECT_TRUE(stream.str().find("0.1 1.2 2.3") != std::string::npos) << "stream.str is: " << stream.str();
+ EXPECT_TRUE(stream.str().find("0 0.1 1") != std::string::npos) << "stream.str is: " << stream.str();
+ }
}

/////////////////////////////////////////////////
TEST(PoseTest, MutablePose)