From 8943111428929771774be73430c8a6d553b1ba21 Mon Sep 17 00:00:00 2001 From: Michael Goddard Date: Tue, 11 Oct 2011 13:50:50 +1000 Subject: Fix the wavedecoder a little. Handle RIFX and corrupted files better. Update the autotest so that it is run properly (and copies files properly in shadow build). Fix the gendata script to properly create testdata. Change-Id: I47b705507bebaef54df2835ec767c6b220c64678 Reviewed-on: http://codereview.qt-project.org/6380 Sanity-Review: Qt Sanity Bot Reviewed-by: derick hawcroft --- src/multimedia/effects/qwavedecoder_p.cpp | 127 ++++++++++++++++----- src/multimedia/effects/qwavedecoder_p.h | 5 +- tests/auto/multimedia.pro | 1 + tests/auto/qwavedecoder/data/gendata.sh | 4 +- .../qwavedecoder/data/isawav_1_16_44100_le.wav | Bin 22094 -> 22094 bytes .../auto/qwavedecoder/data/isawav_1_16_8000_le.wav | Bin 4044 -> 4044 bytes .../qwavedecoder/data/isawav_1_32_44100_le.wav | Bin 44180 -> 44180 bytes .../auto/qwavedecoder/data/isawav_1_32_8000_le.wav | Bin 8080 -> 8080 bytes tests/auto/qwavedecoder/data/isawav_1_8_44100.wav | Bin 11069 -> 11069 bytes tests/auto/qwavedecoder/data/isawav_1_8_8000.wav | Bin 2044 -> 2044 bytes .../qwavedecoder/data/isawav_2_16_44100_be.wav | Bin 44144 -> 44144 bytes .../auto/qwavedecoder/data/isawav_2_16_8000_be.wav | Bin 8044 -> 8044 bytes .../qwavedecoder/data/isawav_2_32_44100_be.wav | Bin 88280 -> 88280 bytes .../auto/qwavedecoder/data/isawav_2_32_8000_be.wav | Bin 16080 -> 16080 bytes tests/auto/qwavedecoder/data/isawav_2_8_44100.wav | Bin 22094 -> 22094 bytes tests/auto/qwavedecoder/data/isawav_2_8_8000.wav | Bin 4044 -> 4044 bytes tests/auto/qwavedecoder/qwavedecoder.pro | 4 +- tests/auto/qwavedecoder/tst_qwavedecoder.cpp | 46 ++++---- 18 files changed, 131 insertions(+), 56 deletions(-) diff --git a/src/multimedia/effects/qwavedecoder_p.cpp b/src/multimedia/effects/qwavedecoder_p.cpp index e173aed8d..ad4ecf26b 100644 --- a/src/multimedia/effects/qwavedecoder_p.cpp +++ b/src/multimedia/effects/qwavedecoder_p.cpp @@ -50,9 +50,10 @@ QWaveDecoder::QWaveDecoder(QIODevice *s, QObject *parent): QIODevice(parent), haveFormat(false), dataSize(0), - remaining(0), source(s), - state(QWaveDecoder::InitialState) + state(QWaveDecoder::InitialState), + junkToSkip(0), + bigEndian(false) { open(QIODevice::ReadOnly | QIODevice::Unbuffered); @@ -106,7 +107,15 @@ qint64 QWaveDecoder::writeData(const char *data, qint64 len) void QWaveDecoder::handleData() { - bool valid = true; + // As a special "state", if we have junk to skip, we do + if (junkToSkip > 0) { + discardBytes(junkToSkip); // this also updates junkToSkip + + // If we couldn't skip all the junk, return + if (junkToSkip > 0) + return; + } + if (state == QWaveDecoder::InitialState) { if (source->bytesAvailable() < qint64(sizeof(RIFFHeader))) return; @@ -114,7 +123,8 @@ void QWaveDecoder::handleData() RIFFHeader riff; source->read(reinterpret_cast(&riff), sizeof(RIFFHeader)); - if (qstrncmp(riff.descriptor.id, "RIFF", 4) != 0 || + // RIFF = little endian RIFF, RIFX = big endian RIFF + if (((qstrncmp(riff.descriptor.id, "RIFF", 4) != 0) && (qstrncmp(riff.descriptor.id, "RIFX", 4) != 0)) || qstrncmp(riff.type, "WAVE", 4) != 0) { source->disconnect(SIGNAL(readyRead()), this, SLOT(handleData())); emit invalidFormat(); @@ -122,13 +132,17 @@ void QWaveDecoder::handleData() return; } else { state = QWaveDecoder::WaitingForFormatState; + if (qstrncmp(riff.descriptor.id, "RIFX", 4) == 0) + bigEndian = true; + else + bigEndian = false; } } if (state == QWaveDecoder::WaitingForFormatState) { - if (valid = findChunk("fmt ")) { + if (findChunk("fmt ")) { chunk descriptor; - source->peek(reinterpret_cast(&descriptor), sizeof(chunk)); + peekChunk(&descriptor); if (source->bytesAvailable() < qint64(descriptor.size + sizeof(chunk))) return; @@ -138,20 +152,38 @@ void QWaveDecoder::handleData() if (descriptor.size > sizeof(WAVEHeader)) discardBytes(descriptor.size - sizeof(WAVEHeader)); + // Swizzle this + if (bigEndian) { + wave.audioFormat = qFromBigEndian(wave.audioFormat); + } + if (wave.audioFormat != 0 && wave.audioFormat != 1) { + // 32bit wave files have format == 0xFFFE (WAVE_FORMAT_EXTENSIBLE). + // but don't support them at the moment. source->disconnect(SIGNAL(readyRead()), this, SLOT(handleData())); emit invalidFormat(); return; } else { - int bps = qFromLittleEndian(wave.bitsPerSample); - format.setCodec(QLatin1String("audio/pcm")); - format.setSampleType(bps == 8 ? QAudioFormat::UnSignedInt : QAudioFormat::SignedInt); - format.setByteOrder(QAudioFormat::LittleEndian); - format.setFrequency(qFromLittleEndian(wave.sampleRate)); - format.setSampleSize(bps); - format.setChannels(qFromLittleEndian(wave.numChannels)); + + if (bigEndian) { + int bps = qFromBigEndian(wave.bitsPerSample); + + format.setSampleType(bps == 8 ? QAudioFormat::UnSignedInt : QAudioFormat::SignedInt); + format.setByteOrder(QAudioFormat::BigEndian); + format.setFrequency(qFromBigEndian(wave.sampleRate)); + format.setSampleSize(bps); + format.setChannels(qFromBigEndian(wave.numChannels)); + } else { + int bps = qFromLittleEndian(wave.bitsPerSample); + + format.setSampleType(bps == 8 ? QAudioFormat::UnSignedInt : QAudioFormat::SignedInt); + format.setByteOrder(QAudioFormat::LittleEndian); + format.setFrequency(qFromLittleEndian(wave.sampleRate)); + format.setSampleSize(bps); + format.setChannels(qFromLittleEndian(wave.numChannels)); + } state = QWaveDecoder::WaitingForDataState; } @@ -159,11 +191,14 @@ void QWaveDecoder::handleData() } if (state == QWaveDecoder::WaitingForDataState) { - if (valid = findChunk("data")) { + if (findChunk("data")) { source->disconnect(SIGNAL(readyRead()), this, SLOT(handleData())); chunk descriptor; source->read(reinterpret_cast(&descriptor), sizeof(chunk)); + if (bigEndian) + descriptor.size = qFromBigEndian(descriptor.size); + dataSize = descriptor.size; haveFormat = true; @@ -174,22 +209,24 @@ void QWaveDecoder::handleData() } } - if (source->atEnd() || !valid) { + if (source->atEnd()) { source->disconnect(SIGNAL(readyRead()), this, SLOT(handleData())); emit invalidFormat(); return; } - } bool QWaveDecoder::enoughDataAvailable() { - if (source->bytesAvailable() < qint64(sizeof(chunk))) + chunk descriptor; + if (!peekChunk(&descriptor)) return false; - chunk descriptor; - source->peek(reinterpret_cast(&descriptor), sizeof(chunk)); + // This is only called for the RIFF/RIFX header, before bigEndian is set, + // so we have to manually swizzle + if (qstrncmp(descriptor.id, "RIFX", 4) == 0) + descriptor.size = qFromBigEndian(descriptor.size); if (source->bytesAvailable() < qint64(sizeof(chunk) + descriptor.size)) return false; @@ -199,19 +236,28 @@ bool QWaveDecoder::enoughDataAvailable() bool QWaveDecoder::findChunk(const char *chunkId) { - if (source->bytesAvailable() < qint64(sizeof(chunk))) - return false; - chunk descriptor; - source->peek(reinterpret_cast(&descriptor), sizeof(chunk)); + if (!peekChunk(&descriptor)) + return false; if (qstrncmp(descriptor.id, chunkId, 4) == 0) return true; - while (source->bytesAvailable() >= qint64(sizeof(chunk) + descriptor.size)) { - discardBytes(sizeof(chunk) + descriptor.size); + // It's possible that bytes->available() is less than the chunk size + // if it's corrupt. + junkToSkip = qint64(sizeof(chunk) + descriptor.size); + while (source->bytesAvailable() > 0) { + // Skip the current amount + if (junkToSkip > 0) + discardBytes(junkToSkip); - source->peek(reinterpret_cast(&descriptor), sizeof(chunk)); + // If we still have stuff left, just exit and try again later + // since we can't call peekChunk + if (junkToSkip > 0) + return false; + + if (!peekChunk(&descriptor)) + return false; if (qstrncmp(descriptor.id, chunkId, 4) == 0) return true; @@ -220,12 +266,35 @@ bool QWaveDecoder::findChunk(const char *chunkId) return false; } +// Handles endianness +bool QWaveDecoder::peekChunk(chunk *pChunk) +{ + if (source->bytesAvailable() < qint64(sizeof(chunk))) + return false; + + source->peek(reinterpret_cast(pChunk), sizeof(chunk)); + if (bigEndian) + pChunk->size = qFromBigEndian(pChunk->size); + + return true; +} + void QWaveDecoder::discardBytes(qint64 numBytes) { - if (source->isSequential()) - source->read(numBytes); - else + // Discards a number of bytes + // If the iodevice doesn't have this many bytes in it, + // remember how much more junk we have to skip. + if (source->isSequential()) { + QByteArray r = source->read(numBytes); // uggh, wasted memory + if (r.size() < numBytes) + junkToSkip = numBytes - r.size(); + else + junkToSkip = 0; + } else { + quint64 origPos = source->pos(); source->seek(source->pos() + numBytes); + junkToSkip = origPos + numBytes - source->pos(); + } } QT_END_NAMESPACE diff --git a/src/multimedia/effects/qwavedecoder_p.h b/src/multimedia/effects/qwavedecoder_p.h index 6c4c00c25..0d26fec4b 100644 --- a/src/multimedia/effects/qwavedecoder_p.h +++ b/src/multimedia/effects/qwavedecoder_p.h @@ -106,6 +106,8 @@ private: char id[4]; quint32 size; }; + bool peekChunk(chunk* pChunk); + struct RIFFHeader { chunk descriptor; @@ -124,10 +126,11 @@ private: bool haveFormat; qint64 dataSize; - qint64 remaining; QAudioFormat format; QIODevice *source; State state; + quint32 junkToSkip; + bool bigEndian; }; QT_END_NAMESPACE diff --git a/tests/auto/multimedia.pro b/tests/auto/multimedia.pro index 6a6d08b9e..307a25256 100644 --- a/tests/auto/multimedia.pro +++ b/tests/auto/multimedia.pro @@ -27,6 +27,7 @@ SUBDIRS += \ qmediaobject \ qcamera \ qcamerabackend \ + qwavedecoder # These is disabled until intent is clearer # qvideodevicecontrol \ diff --git a/tests/auto/qwavedecoder/data/gendata.sh b/tests/auto/qwavedecoder/data/gendata.sh index 9954ed409..0dd82cef7 100755 --- a/tests/auto/qwavedecoder/data/gendata.sh +++ b/tests/auto/qwavedecoder/data/gendata.sh @@ -58,9 +58,9 @@ for channel in 1 2; do for samplebits in 8 16 32; do for samplerate in 44100 8000; do if [ $samplebits -ne 8 ]; then - sox --endian "${endian}" -c ${channel} -b ${samplebits} -r ${samplerate} -n isawav_${channel}_${samplebits}_${samplerate}_${endian_extn}.wav synth 0.25 sine 300-3300 + sox -n --endian "${endian}" -c ${channel} -b ${samplebits} -r ${samplerate} isawav_${channel}_${samplebits}_${samplerate}_${endian_extn}.wav synth 0.25 sine 300-3300 else - sox -c ${channel} -b ${samplebits} -r ${samplerate} -n isawav_${channel}_${samplebits}_${samplerate}.wav synth 0.25 sine 300-3300 + sox -n -c ${channel} -b ${samplebits} -r ${samplerate} isawav_${channel}_${samplebits}_${samplerate}.wav synth 0.25 sine 300-3300 fi done done diff --git a/tests/auto/qwavedecoder/data/isawav_1_16_44100_le.wav b/tests/auto/qwavedecoder/data/isawav_1_16_44100_le.wav index d8373cde4..88b1a8379 100644 Binary files a/tests/auto/qwavedecoder/data/isawav_1_16_44100_le.wav and b/tests/auto/qwavedecoder/data/isawav_1_16_44100_le.wav differ diff --git a/tests/auto/qwavedecoder/data/isawav_1_16_8000_le.wav b/tests/auto/qwavedecoder/data/isawav_1_16_8000_le.wav index 6467b9a98..83a405907 100644 Binary files a/tests/auto/qwavedecoder/data/isawav_1_16_8000_le.wav and b/tests/auto/qwavedecoder/data/isawav_1_16_8000_le.wav differ diff --git a/tests/auto/qwavedecoder/data/isawav_1_32_44100_le.wav b/tests/auto/qwavedecoder/data/isawav_1_32_44100_le.wav index 6d4efdefc..9c437b155 100644 Binary files a/tests/auto/qwavedecoder/data/isawav_1_32_44100_le.wav and b/tests/auto/qwavedecoder/data/isawav_1_32_44100_le.wav differ diff --git a/tests/auto/qwavedecoder/data/isawav_1_32_8000_le.wav b/tests/auto/qwavedecoder/data/isawav_1_32_8000_le.wav index 9963f63fe..f90a8bc35 100644 Binary files a/tests/auto/qwavedecoder/data/isawav_1_32_8000_le.wav and b/tests/auto/qwavedecoder/data/isawav_1_32_8000_le.wav differ diff --git a/tests/auto/qwavedecoder/data/isawav_1_8_44100.wav b/tests/auto/qwavedecoder/data/isawav_1_8_44100.wav index 638696999..7d10829ea 100644 Binary files a/tests/auto/qwavedecoder/data/isawav_1_8_44100.wav and b/tests/auto/qwavedecoder/data/isawav_1_8_44100.wav differ diff --git a/tests/auto/qwavedecoder/data/isawav_1_8_8000.wav b/tests/auto/qwavedecoder/data/isawav_1_8_8000.wav index ac7b40f69..76c08e89e 100644 Binary files a/tests/auto/qwavedecoder/data/isawav_1_8_8000.wav and b/tests/auto/qwavedecoder/data/isawav_1_8_8000.wav differ diff --git a/tests/auto/qwavedecoder/data/isawav_2_16_44100_be.wav b/tests/auto/qwavedecoder/data/isawav_2_16_44100_be.wav index d3ffb04f0..ca0cd425a 100644 Binary files a/tests/auto/qwavedecoder/data/isawav_2_16_44100_be.wav and b/tests/auto/qwavedecoder/data/isawav_2_16_44100_be.wav differ diff --git a/tests/auto/qwavedecoder/data/isawav_2_16_8000_be.wav b/tests/auto/qwavedecoder/data/isawav_2_16_8000_be.wav index 8638f19b9..3a684590b 100644 Binary files a/tests/auto/qwavedecoder/data/isawav_2_16_8000_be.wav and b/tests/auto/qwavedecoder/data/isawav_2_16_8000_be.wav differ diff --git a/tests/auto/qwavedecoder/data/isawav_2_32_44100_be.wav b/tests/auto/qwavedecoder/data/isawav_2_32_44100_be.wav index edf655558..f1aaf2906 100644 Binary files a/tests/auto/qwavedecoder/data/isawav_2_32_44100_be.wav and b/tests/auto/qwavedecoder/data/isawav_2_32_44100_be.wav differ diff --git a/tests/auto/qwavedecoder/data/isawav_2_32_8000_be.wav b/tests/auto/qwavedecoder/data/isawav_2_32_8000_be.wav index 642f10c06..c10c20872 100644 Binary files a/tests/auto/qwavedecoder/data/isawav_2_32_8000_be.wav and b/tests/auto/qwavedecoder/data/isawav_2_32_8000_be.wav differ diff --git a/tests/auto/qwavedecoder/data/isawav_2_8_44100.wav b/tests/auto/qwavedecoder/data/isawav_2_8_44100.wav index dcb001741..befd02baf 100644 Binary files a/tests/auto/qwavedecoder/data/isawav_2_8_44100.wav and b/tests/auto/qwavedecoder/data/isawav_2_8_44100.wav differ diff --git a/tests/auto/qwavedecoder/data/isawav_2_8_8000.wav b/tests/auto/qwavedecoder/data/isawav_2_8_8000.wav index 901ee35c7..ce8b0d06a 100644 Binary files a/tests/auto/qwavedecoder/data/isawav_2_8_8000.wav and b/tests/auto/qwavedecoder/data/isawav_2_8_8000.wav differ diff --git a/tests/auto/qwavedecoder/qwavedecoder.pro b/tests/auto/qwavedecoder/qwavedecoder.pro index 435aae956..4f0339a87 100644 --- a/tests/auto/qwavedecoder/qwavedecoder.pro +++ b/tests/auto/qwavedecoder/qwavedecoder.pro @@ -6,8 +6,8 @@ SOURCES += tst_qwavedecoder.cpp \ QT += multimedia-private testlib CONFIG += no_private_qt_headers_warning testcase -data.path = . -data.sources = data +data.files = data +data.path = $${OUT_PWD} INSTALLS += data diff --git a/tests/auto/qwavedecoder/tst_qwavedecoder.cpp b/tests/auto/qwavedecoder/tst_qwavedecoder.cpp index aeed403e3..6bf529f9c 100644 --- a/tests/auto/qwavedecoder/tst_qwavedecoder.cpp +++ b/tests/auto/qwavedecoder/tst_qwavedecoder.cpp @@ -44,18 +44,18 @@ #include #include -#ifndef QTRY_VERIFY -#define QTRY_VERIFY(__expr) \ +#ifndef QTRY_COMPARE +#define QTRY_COMPARE(__expr, __expected) \ do { \ const int __step = 50; \ const int __timeout = 10000; \ if (!(__expr)) { \ QTest::qWait(0); \ } \ - for (int __i = 0; __i < __timeout && !(__expr); __i+=__step) { \ + for (int __i = 0; __i < __timeout && !((__expr) == (__expected)); __i+=__step) { \ QTest::qWait(__step); \ } \ - QVERIFY(__expr); \ + QCOMPARE(__expr, __expected); \ } while (0) #endif @@ -131,10 +131,11 @@ void tst_QWaveDecoder::integrity_data() QTest::newRow("File isawav_2_16_8000_be.wav") << QString("isawav_2_16_8000_be.wav") << tst_QWaveDecoder::None << 2 << 16 << 8000 << QAudioFormat::BigEndian; QTest::newRow("File isawav_2_16_44100_be.wav") << QString("isawav_2_16_44100_be.wav") << tst_QWaveDecoder::None << 2 << 16 << 44100 << QAudioFormat::BigEndian; - QTest::newRow("File isawav_1_32_8000_le.wav") << QString("isawav_1_32_8000_le.wav") << tst_QWaveDecoder::None << 1 << 32 << 8000 << QAudioFormat::LittleEndian; - QTest::newRow("File isawav_1_32_44100_le.wav") << QString("isawav_1_32_44100_le.wav") << tst_QWaveDecoder::None << 1 << 32 << 44100 << QAudioFormat::LittleEndian; - QTest::newRow("File isawav_2_32_8000_be.wav") << QString("isawav_2_32_8000_be.wav") << tst_QWaveDecoder::None << 2 << 32 << 8000 << QAudioFormat::BigEndian; - QTest::newRow("File isawav_2_32_44100_be.wav") << QString("isawav_2_32_44100_be.wav") << tst_QWaveDecoder::None << 2 << 32 << 44100 << QAudioFormat::BigEndian; + // 32 bit waves are not supported + QTest::newRow("File isawav_1_32_8000_le.wav") << QString("isawav_1_32_8000_le.wav") << tst_QWaveDecoder::FormatDescriptor << 1 << 32 << 8000 << QAudioFormat::LittleEndian; + QTest::newRow("File isawav_1_32_44100_le.wav") << QString("isawav_1_32_44100_le.wav") << tst_QWaveDecoder::FormatDescriptor << 1 << 32 << 44100 << QAudioFormat::LittleEndian; + QTest::newRow("File isawav_2_32_8000_be.wav") << QString("isawav_2_32_8000_be.wav") << tst_QWaveDecoder::FormatDescriptor << 2 << 32 << 8000 << QAudioFormat::BigEndian; + QTest::newRow("File isawav_2_32_44100_be.wav") << QString("isawav_2_32_44100_be.wav") << tst_QWaveDecoder::FormatDescriptor << 2 << 32 << 44100 << QAudioFormat::BigEndian; } void tst_QWaveDecoder::integrity() @@ -146,6 +147,7 @@ void tst_QWaveDecoder::integrity() QFETCH(int, samplerate); QFETCH(QAudioFormat::Endian, byteorder); + QFile stream; stream.setFileName(QString("data/") + file); stream.open(QIODevice::ReadOnly); @@ -157,28 +159,28 @@ void tst_QWaveDecoder::integrity() QSignalSpy invalidFormatSpy(&waveDecoder, SIGNAL(invalidFormat())); if (corruption == NotAWav) { - QTRY_VERIFY(validFormatSpy.count() == 0); - QTRY_VERIFY(invalidFormatSpy.count() == 0); + QTRY_COMPARE(validFormatSpy.count(), 0); + QTRY_COMPARE(invalidFormatSpy.count(), 0); } else if (corruption == NoSampleData) { - QTRY_VERIFY(validFormatSpy.count() == 1); - QTRY_VERIFY(invalidFormatSpy.count() == 0); + QTRY_COMPARE(validFormatSpy.count(), 1); + QTRY_COMPARE(invalidFormatSpy.count(), 0); QVERIFY(waveDecoder.audioFormat().isValid()); QVERIFY(waveDecoder.size() == 0); QVERIFY(waveDecoder.duration() == 0); } else if (corruption == FormatDescriptor) { - QTRY_VERIFY(invalidFormatSpy.count() == 1); - QTRY_VERIFY(validFormatSpy.count() == 0); + QTRY_COMPARE(invalidFormatSpy.count(), 1); + QTRY_COMPARE(validFormatSpy.count(), 0); } else if (corruption == FormatString) { - QTRY_VERIFY(invalidFormatSpy.count() == 1); - QTRY_VERIFY(validFormatSpy.count() == 0); + QTRY_COMPARE(invalidFormatSpy.count(), 1); + QTRY_COMPARE(validFormatSpy.count(), 0); QVERIFY(!waveDecoder.audioFormat().isValid()); } else if (corruption == DataDescriptor) { - QTRY_VERIFY(validFormatSpy.count() == 1); - QTRY_VERIFY(invalidFormatSpy.count() == 0); + QTRY_COMPARE(validFormatSpy.count(), 0); + QTRY_COMPARE(invalidFormatSpy.count(), 1); QVERIFY(waveDecoder.size() == 0); } else if (corruption == None) { - QTRY_VERIFY(validFormatSpy.count() == 1); - QTRY_VERIFY(invalidFormatSpy.count() == 0); + QTRY_COMPARE(validFormatSpy.count(), 1); + QTRY_COMPARE(invalidFormatSpy.count(), 0); QVERIFY(waveDecoder.audioFormat().isValid()); QVERIFY(waveDecoder.size() > 0); QVERIFY(waveDecoder.duration() == 250); @@ -206,7 +208,7 @@ void tst_QWaveDecoder::readAllAtOnce() QWaveDecoder waveDecoder(&stream); QSignalSpy validFormatSpy(&waveDecoder, SIGNAL(formatKnown())); - QTRY_VERIFY(validFormatSpy.count() == 1); + QTRY_COMPARE(validFormatSpy.count(), 1); QVERIFY(waveDecoder.size() > 0); QByteArray buffer; @@ -232,7 +234,7 @@ void tst_QWaveDecoder::readPerByte() QWaveDecoder waveDecoder(&stream); QSignalSpy validFormatSpy(&waveDecoder, SIGNAL(formatKnown())); - QTRY_VERIFY(validFormatSpy.count() == 1); + QTRY_COMPARE(validFormatSpy.count(), 1); QVERIFY(waveDecoder.size() > 0); qint64 readSize = 0; -- cgit v1.2.3