summaryrefslogtreecommitdiffstats
path: root/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp')
-rw-r--r--tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp b/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp
index 5a23274..f64e815 100644
--- a/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp
+++ b/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp
@@ -71,6 +71,8 @@ private slots:
void contiguousCacheBenchmark();
void setCapacity();
+
+ void zeroCapacity();
};
QTEST_MAIN(tst_QContiguousCache)
@@ -476,4 +478,14 @@ void tst_QContiguousCache::setCapacity()
}
}
+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"