From 4cf0962dc4d8d48aa600c5b56b160c8553782140 Mon Sep 17 00:00:00 2001 From: Maximilian Goldstein Date: Wed, 1 Apr 2020 08:14:52 +0200 Subject: Warn if too many parameters are passed to a C++ function Change-Id: I8ddf55d48d9276be5880e89e7b854f3355891f8e Reviewed-by: Ulf Hermann --- tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index fbb344f9a0..5dfe76c2f2 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -2694,6 +2694,8 @@ void tst_qqmlecmascript::callQtInvokables() QCOMPARE(o->actuals().count(), 0); // Excessive arguments + QTest::ignoreMessage(QtWarningMsg, qPrintable("Too many arguments, ignoring 1")); + o->reset(); QVERIFY(EVALUATE_VALUE("object.method_int(10, 11)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); @@ -2701,6 +2703,8 @@ void tst_qqmlecmascript::callQtInvokables() QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(10)); + QTest::ignoreMessage(QtWarningMsg, qPrintable("Too many arguments, ignoring 1")); + o->reset(); QVERIFY(EVALUATE_VALUE("object.method_intint(10, 11, 12)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); -- cgit v1.2.3