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

Method testProblemReporting

tests/quickinspectortest.cpp:325–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323 }
324
325 void testProblemReporting()
326 {
327 // TODO using this qml-file as testcase might stop working if qt decides to be
328 // smarter with out of view items in ListViews
329 QVERIFY(showSource(QStringLiteral("qrc:/manual/quickitemcreatedestroytest.qml")));
330
331 QVERIFY(ProblemCollector::instance()->isCheckerRegistered("com.kdab.GammaRay.QuickItemChecker"));
332
333 ProblemCollector::instance()->requestScan();
334 if (!isViewExposed()) { // if the CI fails to show the window, this isn't going to succeed
335 return;
336 }
337
338 const auto &problems = ProblemCollector::instance()->problems();
339 QVERIFY(std::any_of(problems.begin(), problems.end(),
340 [&](const Problem &p) {
341 return p.problemId.startsWith("com.kdab.GammaRay.QuickItemChecker")
342 && !p.object.isNull()
343 && p.description.contains("out of view")
344 && p.locations.size() > 0;
345 }));
346 }
347
348private:
349 QAbstractItemModel *itemModel;

Callers

nothing calls this directly

Calls 7

showSourceFunction · 0.85
isCheckerRegisteredMethod · 0.80
endMethod · 0.80
requestScanMethod · 0.45
beginMethod · 0.45
isNullMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected