From: Steinar H. Gunderson Date: Sat, 18 Nov 2017 10:45:30 +0000 (+0100) Subject: Fix an issue where matrices would not get printed out on test failure. X-Git-Tag: 1.6.0~62 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=240454ecb79e895dfebfab146174bd7458af4e42 Fix an issue where matrices would not get printed out on test failure. --- diff --git a/test_util.cpp b/test_util.cpp index 648e647..ed8b92a 100644 --- a/test_util.cpp +++ b/test_util.cpp @@ -385,7 +385,7 @@ void expect_equal(const float *ref, const float *result, unsigned width, unsigne float rms = sqrt(squared_difference) / (width * height); EXPECT_LT(rms, rms_limit); - if (largest_difference >= largest_difference_limit || rms >= rms_limit) { + if (largest_difference >= largest_difference_limit || isnan(rms) || rms >= rms_limit) { fprintf(stderr, "Dumping matrices for easier debugging, since at least one test failed.\n"); fprintf(stderr, "Reference:\n");