diff options
Diffstat (limited to 'test/test_pcm_volume.cxx')
-rw-r--r-- | test/test_pcm_volume.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/test_pcm_volume.cxx b/test/test_pcm_volume.cxx index bba5d3bbf..c3a261f7a 100644 --- a/test/test_pcm_volume.cxx +++ b/test/test_pcm_volume.cxx @@ -60,8 +60,9 @@ TestVolume(G g=G()) const auto _dest = ConstBuffer<value_type>::FromVoid(dest); for (unsigned i = 0; i < N; ++i) { - CPPUNIT_ASSERT(_dest.data[i] >= (_src[i] - 1) / 2); - CPPUNIT_ASSERT(_dest.data[i] <= _src[i] / 2 + 1); + const auto expected = (_src[i] + 1) / 2; + CPPUNIT_ASSERT(_dest.data[i] >= expected - 4); + CPPUNIT_ASSERT(_dest.data[i] <= expected + 4); } pv.Close(); |