Mercurial > hg > svcore
comparison data/fileio/test/EncodingTest.h @ 1428:87ae75da6527
Convert some cerrs to SVCERRs. Apart from anything else, this makes MSVC2017 happy
author | Chris Cannam |
---|---|
date | Thu, 01 Mar 2018 14:43:40 +0000 |
parents | aadfb395e933 |
children | 0773b34d987f |
comparison
equal
deleted
inserted
replaced
1427:622d193a00dc | 1428:87ae75da6527 |
---|---|
80 | 80 |
81 private slots: | 81 private slots: |
82 void init() | 82 void init() |
83 { | 83 { |
84 if (!QDir(encodingDir).exists()) { | 84 if (!QDir(encodingDir).exists()) { |
85 cerr << "ERROR: Audio encoding file directory \"" << encodingDir << "\" does not exist" << endl; | 85 SVCERR << "ERROR: Audio encoding file directory \"" << encodingDir << "\" does not exist" << endl; |
86 QVERIFY2(QDir(encodingDir).exists(), "Audio encoding file directory not found"); | 86 QVERIFY2(QDir(encodingDir).exists(), "Audio encoding file directory not found"); |
87 } | 87 } |
88 if (!QDir(outDir).exists() && !QDir().mkpath(outDir)) { | 88 if (!QDir(outDir).exists() && !QDir().mkpath(outDir)) { |
89 cerr << "ERROR: Audio out directory \"" << outDir << "\" does not exist and could not be created" << endl; | 89 SVCERR << "ERROR: Audio out directory \"" << outDir << "\" does not exist and could not be created" << endl; |
90 QVERIFY2(QDir(outDir).exists(), "Audio out directory not found and could not be created"); | 90 QVERIFY2(QDir(outDir).exists(), "Audio out directory not found and could not be created"); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 void readAudio_data() { | 94 void readAudio_data() { |
159 for (int m = 0; m < mappingCount; ++m) { | 159 for (int m = 0; m < mappingCount; ++m) { |
160 if (file == QString::fromUtf8(mapping[m][0])) { | 160 if (file == QString::fromUtf8(mapping[m][0])) { |
161 found = true; | 161 found = true; |
162 QString expected = QString::fromUtf8(mapping[m][1]); | 162 QString expected = QString::fromUtf8(mapping[m][1]); |
163 if (title != expected) { | 163 if (title != expected) { |
164 cerr << "Title does not match expected: codepoints are" << endl; | 164 SVCERR << "Title does not match expected: codepoints are" << endl; |
165 cerr << "Title (" << title.length() << "ch): "; | 165 SVCERR << "Title (" << title.length() << "ch): "; |
166 for (int i = 0; i < title.length(); ++i) { | 166 for (int i = 0; i < title.length(); ++i) { |
167 cerr << title[i].unicode() << " "; | 167 SVCERR << title[i].unicode() << " "; |
168 } | 168 } |
169 cerr << endl; | 169 SVCERR << endl; |
170 cerr << "Expected (" << expected.length() << "ch): "; | 170 SVCERR << "Expected (" << expected.length() << "ch): "; |
171 for (int i = 0; i < expected.length(); ++i) { | 171 for (int i = 0; i < expected.length(); ++i) { |
172 cerr << expected[i].unicode() << " "; | 172 SVCERR << expected[i].unicode() << " "; |
173 } | 173 } |
174 cerr << endl; | 174 SVCERR << endl; |
175 } | 175 } |
176 QCOMPARE(title, expected); | 176 QCOMPARE(title, expected); |
177 break; | 177 break; |
178 } | 178 } |
179 } | 179 } |
183 // where (for annoying VCS-related reasons) the test | 183 // where (for annoying VCS-related reasons) the test |
184 // files may have a different filename encoding from | 184 // files may have a different filename encoding from |
185 // the expected UTF-16. We check this properly in | 185 // the expected UTF-16. We check this properly in |
186 // readWriteAudio below, by saving out the file to a | 186 // readWriteAudio below, by saving out the file to a |
187 // name matching the metadata | 187 // name matching the metadata |
188 cerr << "Couldn't find filename \"" | 188 SVCERR << "Couldn't find filename \"" |
189 << file << "\" in title mapping array" << endl; | 189 << file << "\" in title mapping array" << endl; |
190 QSKIP("Couldn't find filename in title mapping array"); | 190 QSKIP("Couldn't find filename in title mapping array"); |
191 } | 191 } |
192 } | 192 } |
193 } | 193 } |