diff options
author | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2013-01-10 15:54:35 -0300 |
---|---|---|
committer | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2013-01-10 15:54:35 -0300 |
commit | 33147e96ae17a01a3f025a5b7b78bff7943b4851 (patch) | |
tree | 5b9f5421585d19516f0b8f964eb878e0695f5d43 /tests/client/treetest.cpp | |
parent | 2d050cddb8a4aa3ada8f956e071efed9d53898fd (diff) | |
download | qmenumodel-33147e96ae17a01a3f025a5b7b78bff7943b4851.tar.gz qmenumodel-33147e96ae17a01a3f025a5b7b78bff7943b4851.tar.bz2 qmenumodel-33147e96ae17a01a3f025a5b7b78bff7943b4851.zip |
Fixed item removal and insertion.
Removed debug messages.
Fixed tests to work with new tree model structure.
Diffstat (limited to 'tests/client/treetest.cpp')
-rw-r--r-- | tests/client/treetest.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/client/treetest.cpp b/tests/client/treetest.cpp index 3fce236..b6fec3c 100644 --- a/tests/client/treetest.cpp +++ b/tests/client/treetest.cpp @@ -83,29 +83,33 @@ private Q_SLOTS: QModelIndex row4 = row3.child(0, 0); QVERIFY(row4.isValid()); QCOMPARE(menu.rowCount(row4), 0); + QCOMPARE(menu.data(row4, QMenuModel::Depth).toInt(), 1); QCOMPARE(menu.data(row4, QMenuModel::Label).toString(), QString("menu4")); QModelIndex row5 = row3.child(1, 0); QVERIFY(row5.isValid()); QCOMPARE(menu.rowCount(row5), 2); + QCOMPARE(menu.data(row5, QMenuModel::Depth).toInt(), 1); QCOMPARE(menu.data(row5, QMenuModel::Label).toString(), QString("menu5")); QModelIndex row6 = row5.child(0, 0); QVERIFY(row6.isValid()); QCOMPARE(menu.rowCount(row6), 0); + QCOMPARE(menu.data(row6, QMenuModel::Depth).toInt(), 2); QCOMPARE(menu.data(row6, QMenuModel::Label).toString(), QString("menu6")); QModelIndex row7 = row5.child(1, 0); QVERIFY(row7.isValid()); QCOMPARE(menu.rowCount(row7), 0); + QCOMPARE(menu.data(row7, QMenuModel::Depth).toInt(), 2); QCOMPARE(menu.data(row7, QMenuModel::Label).toString(), QString("menu7")); QModelIndex parent_6 = menu.parent(row6); QVERIFY(parent_6.isValid()); QCOMPARE(menu.rowCount(parent_6), 2); + QCOMPARE(menu.data(parent_6, QMenuModel::Depth).toInt(), 1); QCOMPARE(menu.data(parent_6, QMenuModel::Label).toString(), QString("menu5")); } - }; QTEST_MAIN(TreeTest) |