diff data/fileio/test/EncodingTest.h @ 1592:f8e3dcbafb4d bqaudiostream

Implement title/maker in wav readers; extra handling of supported-ness for file types
author Chris Cannam
date Mon, 21 Jan 2019 13:16:17 +0000
parents 0773b34d987f
children d3f068153546
line wrap: on
line diff
--- a/data/fileio/test/EncodingTest.h	Mon Jan 21 11:45:51 2019 +0000
+++ b/data/fileio/test/EncodingTest.h	Mon Jan 21 13:16:17 2019 +0000
@@ -101,6 +101,15 @@
         
         QFETCH(QString, audiofile);
 
+        if (!AudioFileReaderFactory::isSupported(encodingDir + "/" +
+                                                 audiofile)) {
+#if ( QT_VERSION >= 0x050000 )
+            QSKIP("Known unsupported file, skipping");
+#else
+            QSKIP("Known unsupported file, skipping", SkipSingle);
+#endif
+        }            
+        
         AudioFileReaderFactory::Parameters params;
         AudioFileReader *reader =
             AudioFileReaderFactory::createReader
@@ -128,7 +137,13 @@
             AudioFileReaderFactory::createReader
             (encodingDir + "/" + audiofile, params);
 
-        QVERIFY(reader != nullptr);
+        if (!reader) {
+#if ( QT_VERSION >= 0x050000 )
+            QSKIP("Unsupported file, skipping");
+#else
+            QSKIP("Unsupported file, skipping", SkipSingle);
+#endif
+        }
 
         QStringList fileAndExt = audiofile.split(".");
         QString file = fileAndExt[0];
@@ -225,7 +240,14 @@
         AudioFileReader *reader =
             AudioFileReaderFactory::createReader
             (encodingDir + "/" + audiofile, params);
-        QVERIFY(reader != nullptr);
+        
+        if (!reader) {
+#if ( QT_VERSION >= 0x050000 )
+            QSKIP("Unsupported file, skipping");
+#else
+            QSKIP("Unsupported file, skipping", SkipSingle);
+#endif
+        }
 
         QString title = reader->getTitle();
         QVERIFY(title != QString());