From 59410dd2f587945441791e76a5ac07acbe15989f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 5 Apr 2019 10:07:40 +0200 Subject: 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 Reviewed-by: Ulf Hermann --- tests/auto/qml/qqmlparser/tst_qqmlparser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/auto/qml/qqmlparser') diff --git a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp index 71dd900073..fead8c4ebc 100644 --- a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp +++ b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp @@ -234,8 +234,8 @@ void tst_qqmlparser::stringLiteral() auto *literal = QQmlJS::AST::cast(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(expression); QVERIFY(templateLiteral); - QCOMPARE(templateLiteral->firstSourceLocation().begin(), 0); + QCOMPARE(templateLiteral->firstSourceLocation().begin(), 0u); auto *e = templateLiteral->expression; QVERIFY(e); } -- cgit v1.2.3