tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp
branchRCL_3
changeset 7 3f74d0d4af4c
parent 4 3b1da2848fc7
equal deleted inserted replaced
6:dee5afe5301f 7:3f74d0d4af4c
    69 
    69 
    70     void cacheBenchmark();
    70     void cacheBenchmark();
    71     void contiguousCacheBenchmark();
    71     void contiguousCacheBenchmark();
    72 
    72 
    73     void setCapacity();
    73     void setCapacity();
       
    74 
       
    75     void zeroCapacity();
    74 };
    76 };
    75 
    77 
    76 QTEST_MAIN(tst_QContiguousCache)
    78 QTEST_MAIN(tst_QContiguousCache)
    77 
    79 
    78 void tst_QContiguousCache::empty()
    80 void tst_QContiguousCache::empty()
   474         QVERIFY(contiguousCache.containsIndex(i));
   476         QVERIFY(contiguousCache.containsIndex(i));
   475         QCOMPARE(contiguousCache.at(i), i);
   477         QCOMPARE(contiguousCache.at(i), i);
   476     }
   478     }
   477 }
   479 }
   478 
   480 
       
   481 void tst_QContiguousCache::zeroCapacity()
       
   482 {
       
   483     QContiguousCache<int> contiguousCache;
       
   484     QCOMPARE(contiguousCache.capacity(),0);
       
   485     contiguousCache.setCapacity(10);
       
   486     QCOMPARE(contiguousCache.capacity(),10);
       
   487     contiguousCache.setCapacity(0);
       
   488     QCOMPARE(contiguousCache.capacity(),0);
       
   489 }
       
   490 
   479 #include "tst_qcontiguouscache.moc"
   491 #include "tst_qcontiguouscache.moc"