~ubuntu-branches/ubuntu/vivid/ofono-qt/vivid

« back to all changes in this revision

Viewing changes to tests/test_ofonointerface.cpp

  • Committer: Package Import Robot
  • Author(s): Ricardo Salveti de Araujo
  • Date: 2013-06-04 06:39:51 UTC
  • Revision ID: package-import@ubuntu.com-20130604063951-2v4g0yyx0pey2sg5
Tags: 1.5+git20120419+bcf0c04-0ubuntu1
Initial release for Ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
        QVariantList list;
99
99
        bool online;
100
100
        bool online_found;
 
101
        int lastSignalCount = -1;
101
102
    
102
103
        oi->setProperty("Online", qVariantFromValue(false));
103
 
        while (spy_changed.count() != 3 && spy_failed.count() == 0) {
104
 
            QTest::qWait(100);
 
104
        while (spy_failed.count() == 0 && spy_changed.count() != lastSignalCount) {
 
105
            lastSignalCount = spy_changed.count();
 
106
            QTest::qWait(1000);
105
107
        }
106
 
        QCOMPARE(spy_changed.count(), 3);
107
108
        QCOMPARE(spy_failed.count(), 0);
108
109
        online = false;
109
110
        online_found = false;
116
117
        }
117
118
        QCOMPARE(online_found, true);
118
119
        QCOMPARE(online, false);
119
 
        
 
120
 
120
121
        oi->setProperty("Online", qVariantFromValue(true));
121
 
        while (spy_changed.count() < 3 && spy_failed.count() == 0) {
122
 
            QTest::qWait(100);
 
122
 
 
123
        lastSignalCount = -1;
 
124
        while (spy_failed.count() == 0 && spy_changed.count() != lastSignalCount) {
 
125
            lastSignalCount = spy_changed.count();
 
126
            QTest::qWait(1000);
123
127
        }
124
 
        QVERIFY(spy_changed.count() > 3);
 
128
 
 
129
        qDebug() << lastSignalCount;
125
130
        QCOMPARE(spy_failed.count(), 0);
126
131
        online = false;
127
132
        online_found = false;