diff options
Diffstat (limited to 'tests/auto/integration/qsound/tst_qsound.cpp')
-rw-r--r-- | tests/auto/integration/qsound/tst_qsound.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/integration/qsound/tst_qsound.cpp b/tests/auto/integration/qsound/tst_qsound.cpp index 9fcf79184..dbf75f2e3 100644 --- a/tests/auto/integration/qsound/tst_qsound.cpp +++ b/tests/auto/integration/qsound/tst_qsound.cpp @@ -46,6 +46,9 @@ private slots: void testPlay(); void testStop(); + void testPlayResource_data(); + void testPlayResource(); + void testStaticPlay(); private: @@ -110,6 +113,25 @@ void tst_QSound::testStop() QTRY_VERIFY(sound->isFinished()); } +void tst_QSound::testPlayResource_data() +{ + QTest::addColumn<QString>("filePath"); + + QTest::newRow("prefix :/") << ":/test.wav"; + QTest::newRow("prefix qrc:") << "qrc:test.wav"; + QTest::newRow("prefix qrc:///") << "qrc:///test.wav"; +} + +void tst_QSound::testPlayResource() +{ + QFETCH(QString, filePath); + + QSound snd(filePath); + snd.play(); + QVERIFY(!snd.isFinished()); + QTRY_VERIFY(snd.isFinished()); +} + void tst_QSound::testStaticPlay() { // Check that you hear sound with static play also. |