[libgens/tests] test_VdpPalette_DAC.cpp: If the test suite failed due to a fatal...
authorDavid Korth <gerbilsoft@gerbilsoft.com>
Sat, 5 Sep 2015 02:43:27 +0000 (22:43 -0400)
committerDavid Korth <gerbilsoft@gerbilsoft.com>
Sat, 5 Sep 2015 02:43:27 +0000 (22:43 -0400)
This ensures that the test suite fails in CTest if e.g. the test file
has the wrong format, resulting in the test suite aborting without
running any actual tests.

src/libgens/tests/test_VdpPalette_DAC.cpp

index aec609c..d512c9b 100644 (file)
@@ -450,5 +450,10 @@ int main(int argc, char *argv[])
 
        LibGens::Tests::Test_VdpPalette_DAC vdpTest(argv[1]);
        int ret = vdpTest.exec();
-       return ((ret == 0) ? ret : vdpTest.testsFailed())
+       if (ret != 0) {
+               if (vdpTest.testsFailed() > 0) {
+                       ret = vdpTest.testsFailed();
+               }
+       }
+       return ret;
 }