aboutsummaryrefslogtreecommitdiff
path: root/tests/client/modeltest.cpp
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-10-09 15:44:25 -0300
committerRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-10-09 15:44:25 -0300
commitc07f87e35062e39e9d4b3b978362dbf94dd36fbb (patch)
treecd6a396074acc4049f694610d0519c1558bdc796 /tests/client/modeltest.cpp
parenta03e7e775a9751f87efb8fd7acf226b5eb25f4e3 (diff)
downloadqmenumodel-c07f87e35062e39e9d4b3b978362dbf94dd36fbb.tar.gz
qmenumodel-c07f87e35062e39e9d4b3b978362dbf94dd36fbb.tar.bz2
qmenumodel-c07f87e35062e39e9d4b3b978362dbf94dd36fbb.zip
Fixed crash during model destruction in QML.
Diffstat (limited to 'tests/client/modeltest.cpp')
-rw-r--r--tests/client/modeltest.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/client/modeltest.cpp b/tests/client/modeltest.cpp
index 542b38a..8f20bc3 100644
--- a/tests/client/modeltest.cpp
+++ b/tests/client/modeltest.cpp
@@ -209,6 +209,28 @@ private Q_SLOTS:
QCOMPARE(v.toString(), QString("42"));
}
+ /*
+ * Test if model is destroyed without crash
+ */
+ void testDestroyModel()
+ {
+ // Make menu available
+ m_script.publishMenu();
+ m_script.run();
+
+ // create a new model
+ QDBusMenuModel *model = new QDBusMenuModel();
+ model->setBusType(DBusEnums::SessionBus);
+ model->setBusName(MENU_SERVICE_NAME);
+ model->setObjectPath(MENU_OBJECT_PATH);
+ model->start();
+
+ // Wait for dbus sync
+ QTest::qWait(500);
+
+ delete model;
+ }
+
};
QTEST_MAIN(ModelTest)