]> git.sesse.net Git - movit/blobdiff - test_util.cpp
Be better at cleaning up at destruction time. Still stuff to do.
[movit] / test_util.cpp
index 047eb11a18a360de615f08249d50a034df64a5fe..ab10f7b82be0fd3a4528d54eb406cdd6ce09f733 100644 (file)
@@ -34,6 +34,12 @@ EffectChainTester::EffectChainTester(const float *data, unsigned width, unsigned
        check_error();
 }
 
+EffectChainTester::~EffectChainTester()
+{
+       glDeleteFramebuffers(1, &fbo);
+       glDeleteTextures(1, &texnum);
+}
+
 Input *EffectChainTester::add_input(const float *data, MovitPixelFormat pixel_format, ColorSpace color_space, GammaCurve gamma_curve)
 {
        ImageFormat format;
@@ -87,7 +93,9 @@ void expect_equal(const float *ref, const float *result, unsigned width, unsigne
        }
 
        EXPECT_LT(largest_difference, largest_difference_limit)
-               << "Largest difference is in x=" << largest_diff_x << ", y=" << largest_diff_y;
+               << "Largest difference is in x=" << largest_diff_x << ", y=" << largest_diff_y << ":\n"
+               << "Reference: " << ref[largest_diff_y * width + largest_diff_x] << "\n"
+               << "Result:    " << result[largest_diff_y * width + largest_diff_x];
 
        float rms = sqrt(squared_difference) / (width * height);
        EXPECT_LT(rms, rms_limit);