summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2020-09-08 10:09:33 +0200
committerJüri Valdmann <juri.valdmann@qt.io>2020-09-09 13:05:55 +0200
commit742132bb72514e16ad12ecb4e6b017fff25b697c (patch)
treed67c0356d43da2606b780dc3f5e7c266a8c6f6e0
parentdf1e1400b8b46909ac1cfd3f9245d1d5ed43fbb7 (diff)
downloadqtwebchannel-742132bb72514e16ad12ecb4e6b017fff25b697c.tar.gz
Fix TextWebChannel::testInvokeMethodConversion with latest qtbase
QVariant's comparison operator has been changed to no longer perform type conversions, except for primitive numerical types, which causes the test to fail in the QJsonValue case. The comparison QCOMPARE(retval, args.at(0).toVariant()) fails because retval is QVariant(QJsonValue, QJsonValue(double, 1000)), while args.at(0).toVariant() gives QVariant(qlonglong, 1000). Change args.at(0).toVariant() to QVariant(args.at(0)) to ensure that both QVariants contain a QJsonValue. Change-Id: I5c4102645b5c705ca5b68dc7d308f68c6630b1d5 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
-rw-r--r--tests/auto/webchannel/tst_webchannel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/webchannel/tst_webchannel.cpp b/tests/auto/webchannel/tst_webchannel.cpp
index 4941a7b..3f2c435 100644
--- a/tests/auto/webchannel/tst_webchannel.cpp
+++ b/tests/auto/webchannel/tst_webchannel.cpp
@@ -565,7 +565,7 @@ void TestWebChannel::testInvokeMethodConversion()
int getterMethod = metaObject()->indexOfMethod("readJsonValue()");
QVERIFY(getterMethod != -1);
auto retVal = channel.d_func()->publisher->invokeMethod(this, getterMethod, {});
- QCOMPARE(retVal, args.at(0).toVariant());
+ QCOMPARE(retVal, QVariant(args.at(0)));
}
{
QJsonObject object;