tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp
branchRCL_3
changeset 7 3f74d0d4af4c
parent 4 3b1da2848fc7
--- a/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp	Mon Mar 15 12:43:09 2010 +0200
+++ b/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp	Thu Apr 08 14:19:33 2010 +0300
@@ -71,6 +71,8 @@
     void contiguousCacheBenchmark();
 
     void setCapacity();
+
+    void zeroCapacity();
 };
 
 QTEST_MAIN(tst_QContiguousCache)
@@ -476,4 +478,14 @@
     }
 }
 
+void tst_QContiguousCache::zeroCapacity()
+{
+    QContiguousCache<int> contiguousCache;
+    QCOMPARE(contiguousCache.capacity(),0);
+    contiguousCache.setCapacity(10);
+    QCOMPARE(contiguousCache.capacity(),10);
+    contiguousCache.setCapacity(0);
+    QCOMPARE(contiguousCache.capacity(),0);
+}
+
 #include "tst_qcontiguouscache.moc"