Tests: Fix warnings about comparing signed/unsigned

Fix warnings like:
qtestcase.h: In instantiation of 'bool QTest::qCompare(const T1&, const T2&, const char*, const char*, const char*, int) [with T1 = unsigned int; T2 = int]':
tst_qquickrectangle.cpp:137:1559:   required from here
qtestcase.h:423:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Change-Id: I1039e70a2933f196266512a1f5880ee409c1548b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Friedemann Kleint 2019-04-05 10:07:40 +02:00
parent 03c2f16d54
commit 59410dd2f5
3 changed files with 8 additions and 8 deletions

View File

@ -234,8 +234,8 @@ void tst_qqmlparser::stringLiteral()
auto *literal = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(expression);
QVERIFY(literal);
QCOMPARE(literal->value, "hello string");
QCOMPARE(literal->firstSourceLocation().begin(), 0);
QCOMPARE(literal->lastSourceLocation().end(), code.size());
QCOMPARE(literal->firstSourceLocation().begin(), 0u);
QCOMPARE(literal->lastSourceLocation().end(), quint32(code.size()));
}
void tst_qqmlparser::noSubstitutionTemplateLiteral()
@ -255,8 +255,8 @@ void tst_qqmlparser::noSubstitutionTemplateLiteral()
QVERIFY(literal);
QCOMPARE(literal->value, "hello template");
QCOMPARE(literal->firstSourceLocation().begin(), 0);
QCOMPARE(literal->lastSourceLocation().end(), code.size());
QCOMPARE(literal->firstSourceLocation().begin(), 0u);
QCOMPARE(literal->lastSourceLocation().end(), quint32(code.size()));
}
void tst_qqmlparser::templateLiteral()
@ -275,7 +275,7 @@ void tst_qqmlparser::templateLiteral()
auto *templateLiteral = QQmlJS::AST::cast<QQmlJS::AST::TemplateLiteral *>(expression);
QVERIFY(templateLiteral);
QCOMPARE(templateLiteral->firstSourceLocation().begin(), 0);
QCOMPARE(templateLiteral->firstSourceLocation().begin(), 0u);
auto *e = templateLiteral->expression;
QVERIFY(e);
}

View File

@ -67,8 +67,8 @@ void tst_qv4identifiertable::sweepFirstEntryInBucket()
table.asPropertyKey(entry2);
table.asPropertyKey(entry3);
QCOMPARE(table.size, 3);
QCOMPARE(table.alloc, 5);
QCOMPARE(table.size, 3u);
QCOMPARE(table.alloc, 5u);
QCOMPARE(table.entriesByHash[0], entry1);
QCOMPARE(table.entriesByHash[1], entry2);

View File

@ -134,7 +134,7 @@ void tst_qquickrectangle::gradient_separate()
// Start off clean
QQuickItemPrivate *rectPriv = QQuickItemPrivate::get(rect);
QTRY_COMPARE(rectPriv->dirtyAttributes & QQuickItemPrivate::Content, 0);
QTRY_COMPARE(rectPriv->dirtyAttributes & QQuickItemPrivate::Content, 0u);
QMetaObject::invokeMethod(rect, "changeGradient");