diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-09-24 03:56:43 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-09-24 03:56:43 (GMT) |
commit | 5536a86fdfc8e68c8541c0a9bb8fc20ccae3877f (patch) | |
tree | 5dcf13a6f03c64902aa3c657f368300941964834 /tests/auto/declarative/qdeclarativeinfo | |
parent | bbf8b8ee6cb202acc654b7a8aa85cb6c63460842 (diff) | |
download | Qt-5536a86fdfc8e68c8541c0a9bb8fc20ccae3877f.zip Qt-5536a86fdfc8e68c8541c0a9bb8fc20ccae3877f.tar.gz Qt-5536a86fdfc8e68c8541c0a9bb8fc20ccae3877f.tar.bz2 |
More declarative autotests.
Diffstat (limited to 'tests/auto/declarative/qdeclarativeinfo')
-rw-r--r-- | tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp b/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp index 03df71f..7fd6279 100644 --- a/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp +++ b/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp @@ -63,6 +63,8 @@ private slots: void nonQmlObject(); void nullObject(); void nonQmlContextedObject(); + void types(); + void chaining(); private: QDeclarativeEngine engine; @@ -139,6 +141,68 @@ void tst_qdeclarativeinfo::nonQmlContextedObject() qmlInfo(&object) << "Test Message"; } +void tst_qdeclarativeinfo::types() +{ + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: false"); + qmlInfo(0) << false; + + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: 1.1"); + qmlInfo(0) << 1.1; + + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: 1.2"); + qmlInfo(0) << 1.2f; + + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: 15"); + qmlInfo(0) << 15; + + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: 'b'"); + qmlInfo(0) << QChar('b'); + + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: \"Qt\""); + qmlInfo(0) << QByteArray("Qt"); + + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: true"); + qmlInfo(0) << QBool(true); + + //### do we actually want QUrl to show up in the output? + //### why the extra space at the end? + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QUrl(\"http://qt.nokia.com\") "); + qmlInfo(0) << QUrl("http://qt.nokia.com"); + + //### should this be quoted? + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: hello"); + qmlInfo(0) << QLatin1String("hello"); + + //### should this be quoted? + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: World"); + QString str("Hello World"); + QStringRef ref(&str, 6, 5); + qmlInfo(0) << ref; + + //### should this be quoted? + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: Quick"); + qmlInfo(0) << QString ("Quick"); +} + +void tst_qdeclarativeinfo::chaining() +{ + //### should more of these be automatically inserting spaces? + QString str("Hello World"); + QStringRef ref(&str, 6, 5); + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: false 1.1 1.2 15 hello 'b' QUrl(\"http://qt.nokia.com\") World \"Qt\" true Quick "); + qmlInfo(0) << false << ' ' + << 1.1 << ' ' + << 1.2f << ' ' + << 15 << ' ' + << QLatin1String("hello") << ' ' + << QChar('b') << ' ' + << QUrl("http://qt.nokia.com") + << ref + << QByteArray("Qt") + << QBool(true) + << QString ("Quick"); +} + QTEST_MAIN(tst_qdeclarativeinfo) #include "tst_qdeclarativeinfo.moc" |