@@ -86,6 +86,16 @@ private Q_SLOTS:
86 QCOMPARE(model2->model()->menuObjectPath(), QByteArray("/com/canonical/LP1328646"));
86 QCOMPARE(model2->model()->menuObjectPath(), QByteArray("/com/canonical/LP1328646"));
89+ // Tests that the cache is recreated if deleted.
90+ void testDeletedCache()
92+ QSharedPointer<SharedUnityMenuModel> model1(createFullModel("test1"));
94+ QCOMPARE(UnityMenuModelCache::singleton()->contains("/com/canonical/test1"), true);
95+ delete UnityMenuModelCache::singleton();
96+ QCOMPARE(UnityMenuModelCache::singleton()->contains("/com/canonical/test1"), false);
91QTEST_GUILESS_MAIN(SharedUnityMenuModelTest)
101QTEST_GUILESS_MAIN(SharedUnityMenuModelTest)