Skip to content

Commit 3077a48

Browse files
committed
fix unit test
1 parent 5f1ff9e commit 3077a48

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/test_steprange_axis.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222

2323
#include "eckit/testing/Test.h"
24+
#include "eckit/types/FloatCompare.h"
2425

2526
using namespace eckit::testing;
2627

@@ -50,17 +51,17 @@ CASE("steprange") {
5051
{
5152
StepRange sr{0,.5};
5253
EXPECT(sr.from()==0);
53-
EXPECT(sr.to()==0.5);
54+
EXPECT(eckit::types::is_approximately_equal(sr.to(), 0.5));
5455
}
5556
{
5657
StepRange sr{"0-30m"};
5758
EXPECT(sr.from()==0);
58-
EXPECT(sr.to()==0.5);
59+
EXPECT(eckit::types::is_approximately_equal(sr.to(), 0.5));
5960
}
6061
{
6162
StepRange sr{"0-24s"};
6263
EXPECT(sr.from()==0);
63-
EXPECT(sr.to()==(24./3600.));
64+
EXPECT(eckit::types::is_approximately_equal(sr.to(), 24./3600.));
6465
}
6566
}
6667

0 commit comments

Comments
 (0)