src/hbcore/core/hbsharedmemorymanagerut_p.cpp
changeset 3 11d3954df52a
parent 0 16d8024aca5e
child 6 c3690ec91ef8
--- a/src/hbcore/core/hbsharedmemorymanagerut_p.cpp	Fri May 14 16:09:54 2010 +0300
+++ b/src/hbcore/core/hbsharedmemorymanagerut_p.cpp	Thu May 27 13:10:59 2010 +0300
@@ -28,8 +28,8 @@
 #include <QString>
 #include <QDebug>
 
-
 #include "hbthemecommon_p.h"
+#include "hbsharedcache_p.h"
 
 #define HB_THEME_SHARED_AUTOTEST_CHUNK "hbthemesharedautotest"
 
@@ -74,6 +74,17 @@
             chunkHeader->subAllocatorOffset = alloc(SPACE_NEEDED_FOR_MULTISEGMENT_ALLOCATOR);
             subAllocator->initialize(chunk, chunkHeader->subAllocatorOffset, mainAllocator);
             chunkHeader->identifier = INITIALIZED_CHUNK_IDENTIFIER;
+
+            // Create empty shared cache for unit test purposes
+            HbSharedCache *cachePtr = createSharedCache(0, 0, 0);
+            if (cachePtr) {
+                const QString &appName = HbMemoryUtils::getCleanAppName();
+                if (appName == THEME_SERVER_NAME) {
+                    cachePtr->initServer();
+                } else {
+                    cachePtr->initClient();
+                }
+            }
         }
 		success = true;
 	}