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

Method testBasicInterface

kdevplatform/util/tests/test_objectlist.cpp:23–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23void TestObjectList::testBasicInterface()
24{
25 ObjectList<QObject> list;
26
27 QObject o;
28 list.append(&o);
29 QCOMPARE(list.data().size(), 1);
30 QCOMPARE(list.data().at(0), &o);
31 QCOMPARE(list.data().value(0), &o);
32
33 QCOMPARE(list.data().size(), 1);
34 QCOMPARE(list.data().at(0), &o);
35
36 QVERIFY(list.remove(&o));
37 QCOMPARE(list.data().size(), 0);
38 //QCOMPARE(list.at(0)), &o); // would crash
39 QVERIFY(!list.data().value(0));
40
41 QVERIFY(list.data().isEmpty());
42
43 // try removing it again
44 QVERIFY(!list.remove(&o));
45}
46
47void TestObjectList::testDeleteAll()
48{

Callers

nothing calls this directly

Calls 7

appendMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
atMethod · 0.45
valueMethod · 0.45
removeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected