diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-01-03 13:41:33 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-05 04:01:51 +0100 |
commit | 55c0505a001a8ebde961dc5e4f16806efd72bb4e (patch) | |
tree | 369e47f4b426f9c4d9c62267560564fb3cf837c4 /tests/auto/integration/qsound | |
parent | 502d3c8eb353f45f988e371aa6d7938d5ec9d51e (diff) |
QSound/QSoundEffect: Use QFINDTESTDATA to locate test data.
Replace SRCDIR define by QFINDTESTDATA, which is the standard
method of locating test data. Remove apparently unused code path
within QT_QSOUNDEFFECT_USEAPPLICATIONPATH.
Change-Id: Id7120e75af727839ad2d1d2b3ef25c7ef2122fa5
Reviewed-by: Mithra Pattison <mithra.pattison@nokia.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Diffstat (limited to 'tests/auto/integration/qsound')
-rw-r--r-- | tests/auto/integration/qsound/qsound.pro | 3 | ||||
-rw-r--r-- | tests/auto/integration/qsound/tst_qsound.cpp | 11 |
2 files changed, 9 insertions, 5 deletions
diff --git a/tests/auto/integration/qsound/qsound.pro b/tests/auto/integration/qsound/qsound.pro index da4f6d913..d8960ab3f 100644 --- a/tests/auto/integration/qsound/qsound.pro +++ b/tests/auto/integration/qsound/qsound.pro @@ -7,6 +7,3 @@ CONFIG += no_private_qt_headers_warning # CONFIG += testcase SOURCES += tst_qsound.cpp - -DEFINES += SRCDIR=\\\"$$PWD/\\\" - diff --git a/tests/auto/integration/qsound/tst_qsound.cpp b/tests/auto/integration/qsound/tst_qsound.cpp index 588619f15..1cbf4f6d4 100644 --- a/tests/auto/integration/qsound/tst_qsound.cpp +++ b/tests/auto/integration/qsound/tst_qsound.cpp @@ -67,7 +67,10 @@ private: void tst_QSound::initTestCase() { - sound = new QSound(QString(SRCDIR "test.wav"), this); + const QString testFileName = QStringLiteral("test.wav"); + const QString fullPath = QFINDTESTDATA(testFileName); + QVERIFY2(!fullPath.isEmpty(), qPrintable(QStringLiteral("Unable to locate ") + testFileName)); + sound = new QSound(fullPath, this); QVERIFY(!sound->fileName().isEmpty()); QCOMPARE(sound->loops(),1); @@ -120,7 +123,11 @@ void tst_QSound::testStop() void tst_QSound::testStaticPlay() { // Check that you hear sound with static play also. - QSound::play(QString(SRCDIR "test2.wav")); + const QString testFileName = QStringLiteral("test2.wav"); + const QString fullPath = QFINDTESTDATA(testFileName); + QVERIFY2(!fullPath.isEmpty(), qPrintable(QStringLiteral("Unable to locate ") + testFileName)); + + QSound::play(fullPath); QTest::qWait(1000); } |