From bb2e9ce5803cd19a97175eedcb3c925b2c2325c9 Mon Sep 17 00:00:00 2001 From: Szabolcs David Date: Wed, 13 Aug 2014 04:21:36 -0700 Subject: Add QJSValue support to the public API test QJSValue is not a built-in QMetaType (it's ID is over 1024 [QMetaType::User]) and we can't get the QML type names from the QML engine, so I hardcoded it in this test. The check of the "void" is unnecessary, because that is built-in: QMetaType::Void Change-Id: I0d7668abedc8830b4bba39ff60bce644fe97888b Reviewed-by: Jocelyn Turcotte --- tests/auto/quick/publicapi/tst_publicapi.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp index 2f8644d48..f7cffb8b1 100644 --- a/tests/auto/quick/publicapi/tst_publicapi.cpp +++ b/tests/auto/quick/publicapi/tst_publicapi.cpp @@ -63,6 +63,10 @@ static QList typesToCheck = QList() static QList knownEnumNames = QList(); +static QStringList hardcodedTypes = QStringList() + << "QJSValue" + ; + static QStringList expectedAPI = QStringList() << "QQuickWebEngineView.AcceptRequest --> NavigationRequestAction" << "QQuickWebEngineView.IgnoreRequest --> NavigationRequestAction" @@ -160,7 +164,7 @@ static bool isCheckedClass(const QByteArray &typeName) static void checkKnownType(const QByteArray &typeName) { - if ((typeName != "void" && !QMetaType::type(typeName)) || QMetaType::type(typeName) >= QMetaType::User) { + if ((!hardcodedTypes.contains(typeName) && !QMetaType::type(typeName)) || QMetaType::type(typeName) >= QMetaType::User) { bool knownEnum = isCheckedEnum(typeName); bool knownClass = isCheckedClass(typeName); QVERIFY2(knownEnum || knownClass, qPrintable(QString("The API uses an unknown type [%1], you might have to add it to the typesToCheck list.").arg(typeName.constData()))); -- cgit v1.2.3