diff --git a/tests/auto/integration/qsound/qsound.pro b/tests/auto/integration/qsound/qsound.pro index da4f6d91..d8960ab3 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 588619f1..1cbf4f6d 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); } diff --git a/tests/auto/integration/qsoundeffect/qsoundeffect.pro b/tests/auto/integration/qsoundeffect/qsoundeffect.pro index 4d7f083b..352273a9 100644 --- a/tests/auto/integration/qsoundeffect/qsoundeffect.pro +++ b/tests/auto/integration/qsoundeffect/qsoundeffect.pro @@ -8,8 +8,6 @@ CONFIG += no_private_qt_headers_warning SOURCES += tst_qsoundeffect.cpp -DEFINES += SRCDIR=\\\"$$PWD/\\\" - unix:!mac { !contains(QT_CONFIG, pulseaudio) { DEFINES += QT_MULTIMEDIA_QMEDIAPLAYER diff --git a/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp b/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp index f2c576a0..771110ce 100644 --- a/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp +++ b/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp @@ -75,11 +75,11 @@ private: void tst_QSoundEffect::initTestCase() { -#ifdef QT_QSOUNDEFFECT_USEAPPLICATIONPATH - url = QUrl::fromLocalFile(QCoreApplication::applicationDirPath() + QString("/test.wav")); -#else - url = QUrl::fromLocalFile(QString(SRCDIR "test.wav")); -#endif + const QString testFileName = QStringLiteral("test.wav"); + const QString fullPath = QFINDTESTDATA(testFileName); + QVERIFY2(!fullPath.isEmpty(), qPrintable(QStringLiteral("Unable to locate ") + testFileName)); + + url = QUrl::fromLocalFile(fullPath); sound = new QSoundEffect(this);