diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-17 08:00:15 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-17 19:33:34 +0200 |
commit | f5205bd6a409d736942a4eed8869245cb9646d35 (patch) | |
tree | 110a1884b4e949eb1617bc606a42f1225c2d48b6 /tests/auto/corelib/tools | |
parent | 2742ceb1cd9b1a383049ac41970bc06e8955c8df (diff) |
tst_Q{BitArray,ContiguousCache}: check not only count(), but size(), too
Add at least a few, so size() isn't completely untested.
Pick-to: 6.4 6.2 5.15
Change-Id: I500d28f7efb30ab578808d8fefb6ea57949edc2e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r-- | tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp | 1 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp | 2 |
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 97c682c688..9cdf9a63bc 100644 --- a/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp +++ b/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp @@ -143,6 +143,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 22b44a027c..189b11107e 100644 --- a/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp +++ b/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp @@ -50,10 +50,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); |