# HG changeset patch # User Chris Cannam # Date 1548085744 0 # Node ID d3f0681535465a3dd17429ff9c5749afe0c3f03c # Parent f8e3dcbafb4d0fcd7f496b43ac6cefdec8c74e9f QDir::entryList on Mac ignores all of our files with non-ASCII filenames, I think because of variant normalisations (https://bugreports.qt.io/browse/QTBUG-70732). Hard code the file list instead. diff -r f8e3dcbafb4d -r d3f068153546 data/fileio/test/EncodingTest.h --- a/data/fileio/test/EncodingTest.h Mon Jan 21 13:16:17 2019 +0000 +++ b/data/fileio/test/EncodingTest.h Mon Jan 21 15:49:04 2019 +0000 @@ -46,6 +46,18 @@ }; static const int mappingCount = 4; +static const char *testFiles[][2] = { + { "id3v2-iso-8859-1", "mp3" }, + { "id3v2-ucs-2", "mp3" }, + { utf8_name_tsprk, "flac" }, + { utf8_name_tsprk, "m4a" }, + { utf8_name_tsprk, "mp3" }, + { utf8_name_tsprk, "ogg" }, + { utf8_name_sprkt, "mp3" }, + { utf8_name_sprkt, "ogg" }, +}; +static const int testFileCount = 8; + class EncodingTest : public QObject { Q_OBJECT @@ -66,15 +78,13 @@ } private: - const char *strOf(QString s) { - return strdup(s.toLocal8Bit().data()); - } - void addAudioFiles() { QTest::addColumn("audiofile"); - QStringList files = QDir(encodingDir).entryList(QDir::Files); - foreach (QString filename, files) { - QTest::newRow(strOf(filename)) << filename; + for (int i = 0; i < testFileCount; ++i) { + std::string s = testFiles[i][0]; + s += "."; + s += testFiles[i][1]; + QTest::newRow(strdup(s.c_str())) << QString::fromStdString(s); } } @@ -84,7 +94,7 @@ if (!QDir(encodingDir).exists()) { SVCERR << "ERROR: Audio encoding file directory \"" << encodingDir << "\" does not exist" << endl; QVERIFY2(QDir(encodingDir).exists(), "Audio encoding file directory not found"); - } + } if (!QDir(outDir).exists() && !QDir().mkpath(outDir)) { SVCERR << "ERROR: Audio out directory \"" << outDir << "\" does not exist and could not be created" << endl; QVERIFY2(QDir(outDir).exists(), "Audio out directory not found and could not be created");