summaryrefslogtreecommitdiffstats
path: root/tests/auto/integration/qaudiodecoderbackend
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/integration/qaudiodecoderbackend')
-rw-r--r--tests/auto/integration/qaudiodecoderbackend/BLACKLIST8
-rw-r--r--tests/auto/integration/qaudiodecoderbackend/qaudiodecoderbackend.pro8
-rw-r--r--tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp22
3 files changed, 30 insertions, 8 deletions
diff --git a/tests/auto/integration/qaudiodecoderbackend/BLACKLIST b/tests/auto/integration/qaudiodecoderbackend/BLACKLIST
index 8b6712728..316c5a083 100644
--- a/tests/auto/integration/qaudiodecoderbackend/BLACKLIST
+++ b/tests/auto/integration/qaudiodecoderbackend/BLACKLIST
@@ -1,10 +1,2 @@
# QTBUG-56796
windows
-
-[fileTest]
-# QTBUG-60268
-b2qt
-
-[deviceTest]
-# QTBUG-60268
-b2qt
diff --git a/tests/auto/integration/qaudiodecoderbackend/qaudiodecoderbackend.pro b/tests/auto/integration/qaudiodecoderbackend/qaudiodecoderbackend.pro
index 7464a8aa2..672bcfa6a 100644
--- a/tests/auto/integration/qaudiodecoderbackend/qaudiodecoderbackend.pro
+++ b/tests/auto/integration/qaudiodecoderbackend/qaudiodecoderbackend.pro
@@ -9,5 +9,13 @@ TESTDATA += testdata/*
INCLUDEPATH += \
../../../../src/multimedia/audio
+HEADERS += \
+ ../shared/mediafileselector.h
+
SOURCES += \
tst_qaudiodecoderbackend.cpp
+
+boot2qt: {
+ # Yocto sysroot does not have gstreamer/wav
+ QMAKE_CXXFLAGS += -DWAV_SUPPORT_NOT_FORCED
+}
diff --git a/tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp b/tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp
index 2af06b46c..1e582d14b 100644
--- a/tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp
+++ b/tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp
@@ -30,6 +30,8 @@
#include <QDebug>
#include "qaudiodecoder.h"
+#include "../shared/mediafileselector.h"
+
#define TEST_FILE_NAME "testdata/test.wav"
#define TEST_UNSUPPORTED_FILE_NAME "testdata/test-unsupported.avi"
#define TEST_CORRUPTED_FILE_NAME "testdata/test-corrupted.wav"
@@ -56,6 +58,9 @@ private slots:
void unsupportedFileTest();
void corruptedFileTest();
void deviceTest();
+
+private:
+ bool isWavSupported();
};
void tst_QAudioDecoderBackend::init()
@@ -67,14 +72,28 @@ void tst_QAudioDecoderBackend::initTestCase()
QAudioDecoder d;
if (!d.isAvailable())
QSKIP("Audio decoder service is not available");
+
+ qRegisterMetaType<QMediaContent>();
}
void tst_QAudioDecoderBackend::cleanup()
{
}
+bool tst_QAudioDecoderBackend::isWavSupported()
+{
+#ifdef WAV_SUPPORT_NOT_FORCED
+ return !MediaFileSelector::selectMediaFile(QStringList() << QFINDTESTDATA(TEST_FILE_NAME)).isNull();
+#else
+ return true;
+#endif
+}
+
void tst_QAudioDecoderBackend::fileTest()
{
+ if (!isWavSupported())
+ QSKIP("Sound format is not supported");
+
QAudioDecoder d;
if (d.error() == QAudioDecoder::ServiceMissingError)
QSKIP("There is no audio decoding support on this platform.");
@@ -411,6 +430,9 @@ void tst_QAudioDecoderBackend::corruptedFileTest()
void tst_QAudioDecoderBackend::deviceTest()
{
+ if (!isWavSupported())
+ QSKIP("Sound format is not supported");
+
QAudioDecoder d;
if (d.error() == QAudioDecoder::ServiceMissingError)
QSKIP("There is no audio decoding support on this platform.");