aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-04-05 10:07:40 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-04-08 08:39:30 +0000
commit59410dd2f587945441791e76a5ac07acbe15989f (patch)
treeb18c9dc1ea0fd27d3ea291d7719ec816611e9851 /tests/auto/qml
parent03c2f16d54bcab3eab5e0c244fa18dde708c64b7 (diff)
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>
Diffstat (limited to 'tests/auto/qml')
-rw-r--r--tests/auto/qml/qqmlparser/tst_qqmlparser.cpp10
-rw-r--r--tests/auto/qml/qv4identifiertable/tst_qv4identifiertable.cpp4
2 files changed, 7 insertions, 7 deletions
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<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);
}
diff --git a/tests/auto/qml/qv4identifiertable/tst_qv4identifiertable.cpp b/tests/auto/qml/qv4identifiertable/tst_qv4identifiertable.cpp
index 095943cdc7..308fba9049 100644
--- a/tests/auto/qml/qv4identifiertable/tst_qv4identifiertable.cpp
+++ b/tests/auto/qml/qv4identifiertable/tst_qv4identifiertable.cpp
@@ -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);