summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsound
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-11-02 10:23:12 +0200
committerJanne Anttila <janne.anttila@digia.com>2009-11-02 11:49:08 +0200
commitfc6822cb2c1a09b018189168965a8ade23cf1074 (patch)
tree27f6d2bd6008a5ba922b4587098678494b04a384 /tests/auto/qsound
parent8910b449dafcb3475ab8c6f90213cd632412da68 (diff)
Fix for static QSound::play in Symbian and code style fixes.
Static QSound::play(const QString& filename) API did work for Symbian, since local stack variable was deleted before asynchronous play completed. This happened with the following seqeunce: - void QAuServer::play() is called and creates a QSound on the stack - QAuBucketS60::play() is called - m_prepared is false, so the actual play will happen a bit later - The QSound created on the stack is deleted -> Silence This scenario is now fixed by making copy of QSound object to internal list, and temp object is being deleted when play is completed either successfully or unsuccessfully. Added also manual test case for static play. Task-number: QTBUG-5217 Reviewed-by: Miikka Heikkinen
Diffstat (limited to 'tests/auto/qsound')
-rw-r--r--tests/auto/qsound/tst_qsound.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/tests/auto/qsound/tst_qsound.cpp b/tests/auto/qsound/tst_qsound.cpp
index 56a330b590..73eca983a1 100644
--- a/tests/auto/qsound/tst_qsound.cpp
+++ b/tests/auto/qsound/tst_qsound.cpp
@@ -55,20 +55,32 @@ public:
tst_QSound( QObject* parent=0) : QObject(parent) {}
private slots:
- void checkFinished();
+ void checkFinished();
+
+ // Manual tests
+ void staticPlay();
};
void tst_QSound::checkFinished()
{
- QSound sound(SRCDIR"4.wav");
- sound.setLoops(3);
- sound.play();
- QTest::qWait(5000);
+ QSound sound(SRCDIR"4.wav");
+ sound.setLoops(3);
+ sound.play();
+ QTest::qWait(5000);
#if defined(Q_WS_QWS)
- QEXPECT_FAIL("", "QSound buggy on embedded (task QTBUG-157)", Abort);
+ QEXPECT_FAIL("", "QSound buggy on embedded (task QTBUG-157)", Abort);
#endif
- QVERIFY(sound.isFinished() );
+ QVERIFY(sound.isFinished() );
+}
+
+void tst_QSound::staticPlay()
+{
+ QSKIP("Test disabled -- only for manual purposes", SkipAll);
+
+ // Check that you hear sound with static play also.
+ QSound::play(SRCDIR"4.wav");
+ QTest::qWait(2000);
}
QTEST_MAIN(tst_QSound);