]> git.sesse.net Git - movit/commitdiff
Let users of expect_equal() override the default tolerance limits.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 13 Oct 2012 01:02:17 +0000 (03:02 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 13 Oct 2012 01:02:17 +0000 (03:02 +0200)
test_util.cpp
test_util.h

index bcfc97a644146837ba50b1e7cb8de05756a8c0dd..aa9cf5651aced8ef9f29e99c2ba3a093d565d3d2 100644 (file)
@@ -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);
index 6a3e16b49836f483448e453769c1ac440fc8d344..1de5d2582ad0058c10b4156707fe19cdbc3da090 100644 (file)
@@ -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)