MCPcopy Create free account
hub / github.com/KDAB/GammaRay / testTimerActivation

Function testTimerActivation

tests/timertoptest.cpp:85–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83 }
84
85 void testTimerActivation()
86 {
87 createProbe();
88
89 auto *model = ObjectBroker::model(QStringLiteral("com.kdab.GammaRay.TimerModel"));
90 QVERIFY(model);
91 QAbstractItemModelTester modelTest(model);
92
93 auto t1 = new QTimer;
94 t1->setObjectName("timer1");
95 t1->setInterval(10);
96 t1->setSingleShot(true);
97 QTest::qWait(1);
98
99 auto idx = searchFixedIndex(model, "QTimer (timer1)");
100 QVERIFY(idx.isValid());
101 // TODO verify data
102
103 QSignalSpy dataChangeSpy(model, &QAbstractItemModel::dataChanged);
104 QVERIFY(dataChangeSpy.isValid());
105 t1->start();
106
107 // TODO verify data
108 QVERIFY(!dataChangeSpy.isEmpty() || dataChangeSpy.wait(10 * 1000));
109 QVERIFY(dataChangeSpy.size() < 5);
110
111 delete t1;
112 QTest::qWait(1);
113 }
114
115 void testTimerEvent()
116 {

Callers

nothing calls this directly

Calls 4

isValidMethod · 0.45
startMethod · 0.45
isEmptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected