MCPcopy Create free account
hub / github.com/KDE/kdevelop / testChildren

Method testChildren

kdevplatform/shell/tests/test_problemstorenode.cpp:52–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void TestProblemStoreNode::testChildren()
53{
54 QVector<ProblemStoreNode*> nodes;
55 nodes.push_back(new ProblemStoreNode());
56 nodes.push_back(new ProblemStoreNode());
57 nodes.push_back(new ProblemStoreNode());
58
59 int c = 0;
60 for (ProblemStoreNode* node : std::as_const(nodes)) {
61 m_root->addChild(node);
62
63 c++;
64 QCOMPARE(m_root->count(), c);
65 QCOMPARE(m_root->children().count(), c);
66 QVERIFY(node->parent() == m_root.data());
67 QVERIFY(!node->isRoot());
68 }
69
70 for (int i = 0; i < c; i++) {
71 ProblemStoreNode *node = m_root->child(i);
72
73 QVERIFY(node);
74 QVERIFY(node == nodes[i]);
75 QCOMPARE(node->index(), i);
76 }
77
78 nodes.clear();
79 m_root->clear();
80 QCOMPARE(m_root->count(), 0);
81}
82
83void TestProblemStoreNode::testLabelNode()
84{

Callers

nothing calls this directly

Calls 9

addChildMethod · 0.80
push_backMethod · 0.45
countMethod · 0.45
childrenMethod · 0.45
parentMethod · 0.45
dataMethod · 0.45
childMethod · 0.45
indexMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected