summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPiotr Srebrny <piotr.srebrny@qt.io>2021-10-28 13:27:42 +0200
committerPiotr Srebrny <piotr.srebrny@qt.io>2021-11-02 15:57:37 +0200
commitfad168fcbc13bb3ab4c110cf3734f3e5cd83e3b4 (patch)
tree2b11866fd76e28fae825c8bebeec4fc89dd8eadc /tests
parent9c2a312558d4c3e6007f33e2fd079e3eea5dc210 (diff)
Enable QAudioDecoder backend tests for Windows
The patch enables the QAudioDecoder backend tests for Windows with minor adjustments. The expected duration time of the resampled file has been reduced as the Windows resampler produces slightly shorter audio after resampling. Additionally, the expected error code when reading invalid file is changed to ResourceError, which is better suited for this case than AccessDeniedError that relates to lack of permission. Pick-to: 6.2 Change-Id: Iaf905a66c6e03d6ba6d5c9afd4fc8e88b9cb7840 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/integration/qaudiodecoderbackend/BLACKLIST2
-rw-r--r--tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp13
2 files changed, 6 insertions, 9 deletions
diff --git a/tests/auto/integration/qaudiodecoderbackend/BLACKLIST b/tests/auto/integration/qaudiodecoderbackend/BLACKLIST
deleted file mode 100644
index 316c5a083..000000000
--- a/tests/auto/integration/qaudiodecoderbackend/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-# QTBUG-56796
-windows
diff --git a/tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp b/tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp
index 5e3132d25..d7031ee70 100644
--- a/tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp
+++ b/tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp
@@ -160,7 +160,7 @@ void tst_QAudioDecoderBackend::fileTest()
buffer = d.read();
QVERIFY(buffer.isValid());
QTRY_VERIFY(!positionSpy.isEmpty());
- QVERIFY(positionSpy.takeLast().at(0).toLongLong() == qint64(duration / 1000));
+ QCOMPARE(positionSpy.takeLast().at(0).toLongLong(), qint64(duration / 1000));
duration += buffer.duration();
sampleCount += buffer.sampleCount();
@@ -234,7 +234,7 @@ void tst_QAudioDecoderBackend::fileTest()
byteCount += buffer.byteCount();
// Now drain the decoder
- if (duration < 998000) {
+ if (duration < 996000) {
QTRY_COMPARE(d.bufferAvailable(), true);
}
@@ -242,14 +242,14 @@ void tst_QAudioDecoderBackend::fileTest()
buffer = d.read();
QVERIFY(buffer.isValid());
QTRY_VERIFY(!positionSpy.isEmpty());
- QVERIFY(positionSpy.takeLast().at(0).toLongLong() == qint64(duration / 1000));
+ QCOMPARE(positionSpy.takeLast().at(0).toLongLong(), qint64(duration / 1000));
QVERIFY(d.position() - (duration / 1000) < 20);
duration += buffer.duration();
sampleCount += buffer.sampleCount();
byteCount += buffer.byteCount();
- if (duration < 998000) {
+ if (duration < 996000) {
QTRY_COMPARE(d.bufferAvailable(), true);
}
}
@@ -501,9 +501,8 @@ void tst_QAudioDecoderBackend::invalidSource()
// Check the error code.
QTRY_VERIFY(!errorSpy.isEmpty());
errorCode = qvariant_cast<QAudioDecoder::Error>(errorSpy.takeLast().at(0));
- QCOMPARE(errorCode, QAudioDecoder::AccessDeniedError);
- QCOMPARE(d.error(), QAudioDecoder::AccessDeniedError);
-
+ QCOMPARE(errorCode, QAudioDecoder::ResourceError);
+ QCOMPARE(d.error(), QAudioDecoder::ResourceError);
// Check all other spies.
QVERIFY(readySpy.isEmpty());
QVERIFY(bufferChangedSpy.isEmpty());