Ignore test warnings
authorAaron Kennedy <aaron.kennedy@nokia.com>
Thu, 1 Dec 2011 13:22:12 +0000 (13:22 +0000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 1 Dec 2011 14:05:14 +0000 (15:05 +0100)
Change-Id: Ib22ea43970e2e4c9635063dc3af6d6f130cc2a18
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>

tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp

index 52e7661..c4b9c74 100644 (file)
@@ -4885,8 +4885,17 @@ void tst_qdeclarativeecmascript::in()
 void tst_qdeclarativeecmascript::typeOf()
 {
     QDeclarativeComponent component(&engine, TEST_FILE("typeOf.qml"));
+
+    // These warnings should not happen once QTBUG-21864 is fixed
+    QString warning1 = component.url().toString() + QLatin1String(":16: Error: Cannot assign [undefined] to QString");
+    QString warning2 = component.url().resolved(QUrl("typeOf.js")).toString() + QLatin1String(":1: ReferenceError: Can't find variable: a");
+
+    QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+    QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+
     QObject *o = component.create();
     QVERIFY(o != 0);
+
     QEXPECT_FAIL("", "QTBUG-21864", Abort);
     QCOMPARE(o->property("test1").toString(), QLatin1String("undefined"));
     QCOMPARE(o->property("test2").toString(), QLatin1String("object"));
@@ -5381,6 +5390,10 @@ void tst_qdeclarativeecmascript::switchStatement()
 
     {
         QDeclarativeComponent component(&engine, TEST_FILE("switchStatement.4.qml"));
+
+        QString warning = component.url().toString() + ":4: Unable to assign [undefined] to int";
+        QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+
         MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
         QVERIFY(object != 0);
 
@@ -5398,7 +5411,6 @@ void tst_qdeclarativeecmascript::switchStatement()
         object->setStringProperty("F");
         QCOMPARE(object->value(), 3);
 
-        QString warning = component.url().toString() + ":4: Unable to assign [undefined] to int";
         QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
 
         object->setStringProperty("something else");