summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-05-27 11:31:38 +1000
committerRohan McGovern <rohan.mcgovern@nokia.com>2011-05-27 11:46:43 +1000
commit871a21c05728344af5159014c81b09634d969263 (patch)
tree4d93a06371e1788bce8ef79490f7fea21b413527
parent9e927e502f69d0b36df973f60fc020f339602a33 (diff)
tests: improve failure messages from tst_mediaobject
Add some checks for Phonon::ErrorState, and make sure that the errorString() is put into the test failure log in this case. Reviewed-by: Jason McDonald Change-Id: I7e844b85c821df02ad562108d9752c7fc43534d5
-rw-r--r--tests/auto/mediaobject/tst_mediaobject.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/mediaobject/tst_mediaobject.cpp b/tests/auto/mediaobject/tst_mediaobject.cpp
index f16a6f7..dc2fdbc 100644
--- a/tests/auto/mediaobject/tst_mediaobject.cpp
+++ b/tests/auto/mediaobject/tst_mediaobject.cpp
@@ -745,17 +745,19 @@ void tst_MediaObject::playUrl()
media.setProperty("InternetAccessPointName", iap);
#endif //Q_OS_SYMBIAN
media.setCurrentSource(Phonon::MediaSource(url));
- QVERIFY(media.state() != Phonon::ErrorState);
+ QVERIFY2(media.state() != Phonon::ErrorState, qPrintable(media.errorString()));
//we use a long 30s timeout here as it can take a long time for the streaming source to
//be sucessfully prepared depending on the network.
if (media.state() != Phonon::StoppedState)
QTest::waitForSignal(&media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), 30000);
+ QVERIFY2(media.state() != Phonon::ErrorState, qPrintable(media.errorString()));
QCOMPARE(media.state(), Phonon::StoppedState);
media.play();
if (media.state() != Phonon::PlayingState)
QTest::waitForSignal(&media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), 15000);
+ QVERIFY2(media.state() != Phonon::ErrorState, qPrintable(media.errorString()));
QCOMPARE(media.state(), Phonon::PlayingState);
//sleep and allow some of the stream to be played
@@ -772,6 +774,7 @@ void tst_MediaObject::playUrl()
media.stop();
if (media.state() != Phonon::StoppedState)
QTest::waitForSignal(&media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), 15000);
+ QVERIFY2(media.state() != Phonon::ErrorState, qPrintable(media.errorString()));
QCOMPARE(media.state(), Phonon::StoppedState);
}