Don't pass invalid strings to strcmp()

The address behind a string doesn't point to a string.

Change-Id: Ic54f652ae781fea278f60cc49d219c1c610ba29f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
This commit is contained in:
Peter Kümmel 2012-12-01 12:21:20 +01:00 committed by The Qt Project
parent c7dddf2ae5
commit 24013d8a87

View File

@ -1561,7 +1561,7 @@ void tst_QArrayData::literals()
#endif
QVERIFY(v.isSharable());
QCOMPARE((const char *)(v.constBegin() + v.size()), (const char *)v.constEnd());
QCOMPARE((void*)(v.constBegin() + v.size()), (void*)v.constEnd());
for (int i = 0; i < 10; ++i)
QCOMPARE(const_(v)[i], char('A' + i));