diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-12-28 18:15:01 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-05-24 11:38:47 +0200 |
commit | 2f0aa9e35a6881f6cc47c451bb5658c02cf8fb7c (patch) | |
tree | 562786646db25f816173733d53dfd6b9143be28f /tests/auto/core | |
parent | 4ccdf85931d97188c68b54b09a4e2ffbeff6b2a2 (diff) |
tst_QFrameAllocator: actually test something
The old code created 30 'composed' objects, but failed to add them
to the 'composedValues' container, over which it iterated later to
perform some checks. Since the objects were never added in the first
place, nothing was actually checked.
Fix a wrong expected value, now that the test is actually testing
something.
Change-Id: I69a91af1f609ad1b6fa147aa6c5733a6a91c7ca0
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/auto/core')
-rw-r--r-- | tests/auto/core/qframeallocator/tst_qframeallocator.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/core/qframeallocator/tst_qframeallocator.cpp b/tests/auto/core/qframeallocator/tst_qframeallocator.cpp index a098792ee..0f50b5d38 100644 --- a/tests/auto/core/qframeallocator/tst_qframeallocator.cpp +++ b/tests/auto/core/qframeallocator/tst_qframeallocator.cpp @@ -566,19 +566,19 @@ void tst_QFrameAllocator::testAllocationComposedValues() t.list.append(i); } - QList<composed *> composedValues; + composed *composedValues[30]; - for (int i = 0; i < 30; i++) { - composed *v = f.allocate<composed>(); + for (auto &v : composedValues) { + v = f.allocate<composed>(); QVERIFY(v); - for (int j = 0; j < 1; j++) { + for (int j = 0; j < 100; j++) { v->vec.append(j); v->list.append(j); v->t = 100; } } - Q_FOREACH (composed *c, composedValues) { + for (composed *c : composedValues) { QCOMPARE(c->vec.size(), 100); QCOMPARE(c->list.size(), 100); QCOMPARE(c->t, 100); |