QList: avoid a iterator->pointer conversion in the test
Being a test, I'm going to abuse operator-> on end() to check that we get what we want (a pointer past the end). Change-Id: I7ab8d017b0fe320018820eff336d496328ade481 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
5417186692
commit
a45bc2d123
@ -3439,7 +3439,7 @@ void tst_QList::fromReadOnlyData() const
|
||||
QCOMPARE(v.size(), qsizetype(11));
|
||||
// v.capacity() is unspecified, for now
|
||||
|
||||
QCOMPARE((void*)(const char*)(v.constBegin() + v.size()), (void*)(const char*)v.constEnd());
|
||||
QCOMPARE((void*)(v.constBegin() + v.size()).operator->(), (void*)v.constEnd().operator->());
|
||||
|
||||
for (int i = 0; i < 10; ++i)
|
||||
QCOMPARE(v[i], char('A' + i));
|
||||
|
Loading…
x
Reference in New Issue
Block a user