aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_mixramp.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-11-04 22:08:27 +0100
committerMax Kellermann <max@duempel.org>2013-11-04 22:08:59 +0100
commit39257717d83957c065c9fe501cbb8263bc6714a4 (patch)
treefdbc851b2945e2d5ec28279d3987c9ddbcee011a /test/test_mixramp.cxx
parentb54762a8f67ef860762dcf50354919194b040281 (diff)
downloadmpd-39257717d83957c065c9fe501cbb8263bc6714a4.tar.gz
mpd-39257717d83957c065c9fe501cbb8263bc6714a4.tar.xz
mpd-39257717d83957c065c9fe501cbb8263bc6714a4.zip
test/test_mixramp: add threshold to floating point comparisons
Fixes bogus test failures on Debian build machines due to rounding errors (hopefully).
Diffstat (limited to 'test/test_mixramp.cxx')
-rw-r--r--test/test_mixramp.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/test_mixramp.cxx b/test/test_mixramp.cxx
index 0dc67db77..954aade87 100644
--- a/test/test_mixramp.cxx
+++ b/test/test_mixramp.cxx
@@ -28,18 +28,21 @@ public:
free(foo);
foo = strdup(input);
- CPPUNIT_ASSERT_EQUAL(float(0),
- mixramp_interpolate(foo, 1));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(float(0),
+ mixramp_interpolate(foo, 1),
+ 0.005);
free(foo);
foo = strdup(input);
- CPPUNIT_ASSERT_EQUAL(float(0.1),
- mixramp_interpolate(foo, 3));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(float(0.1),
+ mixramp_interpolate(foo, 3),
+ 0.005);
free(foo);
foo = strdup(input);
- CPPUNIT_ASSERT_EQUAL(float(2.5),
- mixramp_interpolate(foo, 6));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(float(2.5),
+ mixramp_interpolate(foo, 6),
+ 0.01);
free(foo);
foo = strdup(input);