Fix an issue where matrices would not get printed out on test failure.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 18 Nov 2017 10:45:30 +0000 (11:45 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 18 Nov 2017 10:45:35 +0000 (11:45 +0100)
test_util.cpp

index 648e647..ed8b92a 100644 (file)
@@ -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");