MCPcopy Create free account
hub / github.com/buggins/coolreader / runFileCacheTest

Function runFileCacheTest

crengine/src/lvtinydom.cpp:11019–11051  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11017#endif
11018
11019void runFileCacheTest()
11020{
11021#if BUILD_LITE!=1
11022 CRLog::info("====Cache test started =====");
11023
11024 // init and clear cache
11025 ldomDocCache::init(lString16("/tmp/cr3cache"), 100);
11026 MYASSERT(ldomDocCache::enabled(), "clear cache");
11027
11028 {
11029 CRLog::info("====Open document and save to cache=====");
11030 LVDocView view(4);
11031 view.Resize(600, 800);
11032 bool res = view.LoadDocument(TEST_FN_TO_OPEN);
11033 MYASSERT(res, "load document");
11034 view.getPageImage(0);
11035 view.getDocProps()->setInt(PROP_FORCED_MIN_FILE_SIZE_TO_CACHE, 30000);
11036 view.swapToCache();
11037 //MYASSERT(res, "swap to cache");
11038 view.getDocument()->dumpStatistics();
11039 }
11040 {
11041 CRLog::info("====Open document from cache=====");
11042 LVDocView view(4);
11043 view.Resize(600, 800);
11044 bool res = view.LoadDocument(TEST_FN_TO_OPEN);
11045 MYASSERT(res, "load document");
11046 view.getDocument()->dumpStatistics();
11047 view.getPageImage(0);
11048 }
11049 CRLog::info("====Cache test finished=====");
11050#endif
11051}
11052
11053void runBasicTinyDomUnitTests()
11054{

Callers 1

runTinyDomUnitTestsFunction · 0.85

Calls 9

lString16Class · 0.85
getDocPropsMethod · 0.80
ResizeMethod · 0.45
LoadDocumentMethod · 0.45
getPageImageMethod · 0.45
setIntMethod · 0.45
swapToCacheMethod · 0.45
dumpStatisticsMethod · 0.45
getDocumentMethod · 0.45

Tested by

no test coverage detected