diff options
author | Zeno Albisser <zeno.albisser@nokia.com> | 2010-02-12 08:15:10 (GMT) |
---|---|---|
committer | Zeno Albisser <zeno.albisser@nokia.com> | 2010-02-15 12:17:08 (GMT) |
commit | 81dae1c0f37ed0b9e4ec6bc1febad273391f518e (patch) | |
tree | 84ac8cf3769258c3e4964aef0769b99344fb85f1 /tests | |
parent | 6c16e4ddd2f5397095ab892872b24bb717ee9147 (diff) | |
download | Qt-81dae1c0f37ed0b9e4ec6bc1febad273391f518e.zip Qt-81dae1c0f37ed0b9e4ec6bc1febad273391f518e.tar.gz Qt-81dae1c0f37ed0b9e4ec6bc1febad273391f518e.tar.bz2 |
Fix for using QContiguousCache with default constructor or capacity=0
Reviewed-by: Peter Hartmann
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp | 12 |
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" |