aboutsummaryrefslogtreecommitdiff
path: root/tests/client/modeltest.cpp
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-10-16 14:30:47 -0300
committerRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-10-16 14:30:47 -0300
commitcc79785d02cadd4066c967e7b373d6ac2bb39b1c (patch)
tree76870946c0f111959410407288be78ee4889fac5 /tests/client/modeltest.cpp
parenta98d5486c37d68e1c1ce8fc1b6ad0a9018dd534d (diff)
parentced307a448aeed3a20d1a1e4bdcbf4dcbe4b1e46 (diff)
downloadqmenumodel-cc79785d02cadd4066c967e7b373d6ac2bb39b1c.tar.gz
qmenumodel-cc79785d02cadd4066c967e7b373d6ac2bb39b1c.tar.bz2
qmenumodel-cc79785d02cadd4066c967e7b373d6ac2bb39b1c.zip
Merged mainline.
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 ebcec34..1c2eeca 100644
--- a/tests/client/modeltest.cpp
+++ b/tests/client/modeltest.cpp
@@ -214,6 +214,28 @@ private Q_SLOTS:
QCOMPARE(v.toMap(), map);
}
+ /*
+ * 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)