phonebookengines/cntlistmodel/tsrc/ut_cntlistmodel/src/ut_cntcache.cpp
changeset 71 7cc7d74059f9
parent 65 ae724a111993
equal deleted inserted replaced
65:ae724a111993 71:7cc7d74059f9
    19 #include "cntcache.h"
    19 #include "cntcache.h"
    20 #include "cntcache_p.h"
    20 #include "cntcache_p.h"
    21 
    21 
    22 void TestCntCache::initTestCase()
    22 void TestCntCache::initTestCase()
    23 {
    23 {
       
    24     // get contact manager
    24     mContactManager = new QContactManager("symbian");
    25     mContactManager = new QContactManager("symbian");
    25 
    26 
    26     // start with a clean database
    27     // start with a clean database
    27     cleanDatabase();
    28     cleanDatabase();
    28 
    29 
    63 
    64 
    64     // test data members
    65     // test data members
    65     QVERIFY(cache->mContactManager != NULL);
    66     QVERIFY(cache->mContactManager != NULL);
    66     QVERIFY(worker->mContactManager != NULL);
    67     QVERIFY(worker->mContactManager != NULL);
    67     QVERIFY(worker->mThumbnailManager != NULL);
    68     QVERIFY(worker->mThumbnailManager != NULL);
    68     QVERIFY(!worker->mStarted);
    69     QVERIFY(worker->mInfoProviders.count() >= 1);
    69     QVERIFY(!worker->mProcessingJobs);
       
    70     QVERIFY(!worker->mPostponeJobs);
       
    71     QVERIFY(worker->mDataProviders.count() >= 1);
       
    72 
    70 
    73     // test deletion
    71     // test deletion
    74     cache->onShutdown();
    72     cache->onShutdown();
    75     QVERIFY(cache == NULL);
    73     QVERIFY(CntCache::mInstance == NULL);
    76     QVERIFY(worker == NULL);
       
    77 }
    74 }
    78 
    75 
    79 /*
    76 /*
    80     Test case: Fetch contact info.
    77     Test case: Fetch contact info.
    81 
    78 
   156             }
   153             }
   157         }
   154         }
   158     }
   155     }
   159     QVERIFY(cacheItemCount == 2*2); // two images, both used by two contacts
   156     QVERIFY(cacheItemCount == 2*2); // two images, both used by two contacts
   160 
   157 
   161     delete cache;
   158     cache->onShutdown();
   162 }
   159 }
   163 
   160 
   164 /*
   161 /*
   165     Test case: Clear cache.
   162     Test case: Clear cache.
   166  */
   163  */