[telepathy-qt4/master] streamed-media-chan test: Fixed race condition.

Andre Moreira Magalhaes (none) andrunko at andrunko-vmdebianlenny
Wed May 20 09:50:14 PDT 2009


---
 tests/dbus/streamed-media-chan.cpp |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/tests/dbus/streamed-media-chan.cpp b/tests/dbus/streamed-media-chan.cpp
index 4890a9a..f26f48c 100644
--- a/tests/dbus/streamed-media-chan.cpp
+++ b/tests/dbus/streamed-media-chan.cpp
@@ -436,10 +436,9 @@ void TestStreamedMediaChan::testOutgoingCall()
                     SIGNAL(finished(Tp::PendingOperation*)),
                     SLOT(expectSuccessfulCall(Tp::PendingOperation*))));
     QCOMPARE(mLoop->exec(), 0);
-    if (!mSDCStreamReturn) {
+    while (!mSDCStreamReturn || !mSSCStreamReturn) {
         // wait direction and state changed signal
         QCOMPARE(mLoop->exec(), 0);
-        QCOMPARE(mLoop->exec(), 0);
     }
     QCOMPARE(mSDCStreamReturn, stream);
     QVERIFY(mSDCDirectionReturn & Tp::MediaStreamDirectionReceive);
@@ -784,10 +783,9 @@ void TestStreamedMediaChan::testIncomingCall()
                     SIGNAL(finished(Tp::PendingOperation*)),
                     SLOT(expectSuccessfulCall(Tp::PendingOperation*))));
     QCOMPARE(mLoop->exec(), 0);
-    if (!mSDCStreamReturn) {
+    while (!mSDCStreamReturn || !mSSCStreamReturn) {
         // wait direction and state changed signal
         QCOMPARE(mLoop->exec(), 0);
-        QCOMPARE(mLoop->exec(), 0);
     }
     QCOMPARE(mSDCStreamReturn, stream);
     QVERIFY(mSDCDirectionReturn & Tp::MediaStreamDirectionSend);
-- 
1.5.6.5




More information about the telepathy-commits mailing list