summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-10-17 08:00:15 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-10-17 21:20:20 +0000
commit3640600518f54dc9e0f7010b7153a823c9756c28 (patch)
tree4445138902fe3000261c6a90900fa1b7c83ae9f8 /tests
parentda2151fa2e0c7875b85171991dbc2badf5644dc8 (diff)
tst_Q{BitArray,ContiguousCache}: check not only count(), but size(), too
Add at least a few, so size() isn't completely untested. Change-Id: I500d28f7efb30ab578808d8fefb6ea57949edc2e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit f5205bd6a409d736942a4eed8869245cb9646d35) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp1
-rw-r--r--tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp b/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp
index 9a7c099228..056fce881d 100644
--- a/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp
+++ b/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp
@@ -165,6 +165,7 @@ void tst_QBitArray::countBits()
bits.setBit(i);
}
+ QCOMPARE(bits.size(), numBits);
QCOMPARE(bits.count(), numBits);
QCOMPARE(bits.count(true), onBits);
QCOMPARE(bits.count(false), numBits - onBits);
diff --git a/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp b/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp
index f305d63d46..9910c9c329 100644
--- a/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp
+++ b/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp
@@ -75,10 +75,12 @@ void tst_QContiguousCache::empty()
{
QContiguousCache<int> c(10);
QCOMPARE(c.capacity(), 10);
+ QCOMPARE(c.size(), 0);
QCOMPARE(c.count(), 0);
QVERIFY(c.isEmpty());
c.append(1);
QCOMPARE(c.count(), 1);
+ QCOMPARE(c.size(), 1);
QVERIFY(!c.isEmpty());
c.clear();
QCOMPARE(c.capacity(), 10);