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

Method testTakeRow

kdevplatform/project/tests/test_projectmodel.cpp:307–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305}
306
307void TestProjectModel::testTakeRow()
308{
309 QScopedPointer<ProjectBaseItem> parent(new ProjectBaseItem( nullptr, QStringLiteral("test") ));
310 QScopedPointer<ProjectBaseItem> child(new ProjectBaseItem( nullptr, QStringLiteral("test"), parent.data() ));
311 QScopedPointer<ProjectBaseItem> subchild(new ProjectBaseItem( nullptr, QStringLiteral("subtest"), child.data() ));
312
313 model->appendRow( parent.data() );
314
315 QCOMPARE( parent->model(), model );
316 QCOMPARE( child->model(), model );
317 QCOMPARE( subchild->model(), model );
318
319 parent->takeRow( child->row() );
320
321 QCOMPARE( child->model(), static_cast<ProjectModel*>(nullptr) );
322 QCOMPARE( subchild->model(), static_cast<ProjectModel*>(nullptr) );
323}
324
325void TestProjectModel::testRename()
326{

Callers

nothing calls this directly

Calls 5

appendRowMethod · 0.80
takeRowMethod · 0.80
dataMethod · 0.45
modelMethod · 0.45
rowMethod · 0.45

Tested by

no test coverage detected