Merge lp:~thomas-voss/location-service/fix-fp-comparison into lp:location-service/trunk

Proposed by Thomas Voß
Status: Merged
Approved by: Timo Jyrinki
Approved revision: 12
Merged at revision: 12
Proposed branch: lp:~thomas-voss/location-service/fix-fp-comparison
Merge into: lp:location-service/trunk
Diff against target: 21 lines (+2/-2)
2 files modified
tests/heading_test.cpp (+1/-1)
tests/velocity_test.cpp (+1/-1)
To merge this branch: bzr merge lp:~thomas-voss/location-service/fix-fp-comparison
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Timo Jyrinki Approve
Review via email: mp+169385@code.launchpad.net

Commit message

* Fix test-cases to rely on proper floating point comparisons.

Description of the change

* Fix test-cases to rely on proper floating point comparisons.

To post a comment you must log in.
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Tested on pbuilder 32-bit.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/heading_test.cpp'
--- tests/heading_test.cpp 2013-05-28 14:41:06 +0000
+++ tests/heading_test.cpp 2013-06-14 11:00:39 +0000
@@ -41,5 +41,5 @@
41 com::ubuntu::location::Heading::max().value());41 com::ubuntu::location::Heading::max().value());
42 double d = dist(rng);42 double d = dist(rng);
43 com::ubuntu::location::Heading h {d* com::ubuntu::location::units::Degrees};43 com::ubuntu::location::Heading h {d* com::ubuntu::location::units::Degrees};
44 EXPECT_EQ(d * com::ubuntu::location::units::Degrees, h.value);44 EXPECT_DOUBLE_EQ(d, h.value.value());
45}45}
4646
=== modified file 'tests/velocity_test.cpp'
--- tests/velocity_test.cpp 2013-06-10 11:10:00 +0000
+++ tests/velocity_test.cpp 2013-06-14 11:00:39 +0000
@@ -50,5 +50,5 @@
50 com::ubuntu::location::Velocity::max().value());50 com::ubuntu::location::Velocity::max().value());
51 double d = dist(rng);51 double d = dist(rng);
52 com::ubuntu::location::Velocity v {d* com::ubuntu::location::units::MetersPerSecond};52 com::ubuntu::location::Velocity v {d* com::ubuntu::location::units::MetersPerSecond};
53 EXPECT_EQ(d * com::ubuntu::location::units::MetersPerSecond, v.value);53 EXPECT_DOUBLE_EQ(d, v.value.value());
54}54}

Subscribers

People subscribed via source and target branches