From 02cfba5c7f3781bb2d7cd2a4a55948efa4ed7918 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Tue, 4 Dec 2012 09:14:04 +0100 Subject: Add a test to verify that normal menu items are not cached (only sub-menus are). --- tests/client/cachetest.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/client/cachetest.cpp b/tests/client/cachetest.cpp index abd3331..8d5bd14 100644 --- a/tests/client/cachetest.cpp +++ b/tests/client/cachetest.cpp @@ -81,6 +81,19 @@ private Q_SLOTS: g_type_init(); } + // Verify that normal menu items are not cached (only sub-menus are) + void testCacheContents() + { + TestModel menu; + QVERIFY(menu.cacheIndexes().isEmpty()); + + menu.data(menu.index(1), QMenuModel::Label); + QVERIFY(menu.cacheIndexes().isEmpty()); + + menu.data(menu.index(2), QMenuModel::Action); + QVERIFY(menu.cacheIndexes().isEmpty()); + } + // Verify that the link attribute always returns the same cached menu void testStaticMenuCache() { -- cgit v1.2.3