From: Steinar H. Gunderson Date: Sat, 13 Oct 2012 01:02:17 +0000 (+0200) Subject: Let users of expect_equal() override the default tolerance limits. X-Git-Tag: 1.0~284 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=47d5eca6c49be8f1bfcf62b36f884d97d12ca6f0;hp=9bfa15dcbddfdeaaba490879362f74d75982ee2f Let users of expect_equal() override the default tolerance limits. --- diff --git a/test_util.cpp b/test_util.cpp index bcfc97a..aa9cf56 100644 --- a/test_util.cpp +++ b/test_util.cpp @@ -68,7 +68,7 @@ void EffectChainTester::run(float *out_data, GLenum format, ColorSpace color_spa } } -void expect_equal(const float *ref, const float *result, unsigned width, unsigned height) +void expect_equal(const float *ref, const float *result, unsigned width, unsigned height, float largest_difference_limit, float rms_limit) { float largest_difference = -1.0f; float squared_difference = 0.0f; @@ -81,9 +81,6 @@ void expect_equal(const float *ref, const float *result, unsigned width, unsigne } } - const float largest_difference_limit = 1.5 / 255.0; - const float rms_limit = 0.2 / 255.0; - EXPECT_LT(largest_difference, largest_difference_limit); float rms = sqrt(squared_difference) / (width * height); diff --git a/test_util.h b/test_util.h index 6a3e16b..1de5d25 100644 --- a/test_util.h +++ b/test_util.h @@ -16,6 +16,6 @@ private: unsigned width, height; }; -void expect_equal(const float *ref, const float *result, unsigned width, unsigned height); +void expect_equal(const float *ref, const float *result, unsigned width, unsigned height, float largest_difference_limit = 1.5 / 255.0, float rms_limit = 0.2 / 255.0); #endif // !defined(_TEST_UTIL_H)