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
1=== modified file 'tests/heading_test.cpp'
2--- tests/heading_test.cpp 2013-05-28 14:41:06 +0000
3+++ tests/heading_test.cpp 2013-06-14 11:00:39 +0000
4@@ -41,5 +41,5 @@
5 com::ubuntu::location::Heading::max().value());
6 double d = dist(rng);
7 com::ubuntu::location::Heading h {d* com::ubuntu::location::units::Degrees};
8- EXPECT_EQ(d * com::ubuntu::location::units::Degrees, h.value);
9+ EXPECT_DOUBLE_EQ(d, h.value.value());
10 }
11
12=== modified file 'tests/velocity_test.cpp'
13--- tests/velocity_test.cpp 2013-06-10 11:10:00 +0000
14+++ tests/velocity_test.cpp 2013-06-14 11:00:39 +0000
15@@ -50,5 +50,5 @@
16 com::ubuntu::location::Velocity::max().value());
17 double d = dist(rng);
18 com::ubuntu::location::Velocity v {d* com::ubuntu::location::units::MetersPerSecond};
19- EXPECT_EQ(d * com::ubuntu::location::units::MetersPerSecond, v.value);
20+ EXPECT_DOUBLE_EQ(d, v.value.value());
21 }

Subscribers

People subscribed via source and target branches