diff data/fileio/test/AudioFileReaderTest.h @ 1698:dbd13eb7dad1

Add tests for audio file readers presented with empty or nonsense input
author Chris Cannam
date Fri, 03 May 2019 13:33:53 +0100
parents 6d9881e59cc2
children c1208b211d8c
line wrap: on
line diff
--- a/data/fileio/test/AudioFileReaderTest.h	Tue Apr 23 16:17:13 2019 +0100
+++ b/data/fileio/test/AudioFileReaderTest.h	Fri May 03 13:33:53 2019 +0100
@@ -21,6 +21,7 @@
 #include "../WavFileWriter.h"
 
 #include "AudioTestData.h"
+#include "UnsupportedFormat.h"
 
 #include <cmath>
 
@@ -73,7 +74,7 @@
             bitdepth = bits[2].toInt();
         }
     }
-    
+
     void getExpectedThresholds(QString format,
                                QString filename,
                                bool resampled,
@@ -305,11 +306,13 @@
             (audioDir + "/" + format + "/" + audiofile, params);
         
         if (!reader) {
+            if (isLegitimatelyUnsupported(format)) {
 #if ( QT_VERSION >= 0x050000 )
-            QSKIP("Unsupported file, skipping");
+                QSKIP("Unsupported file, skipping");
 #else
-            QSKIP("Unsupported file, skipping", SkipSingle);
+                QSKIP("Unsupported file, skipping", SkipSingle);
 #endif
+            }
         }
 
         QString extension;