diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index cb59f47..d6b5f0c 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -56,11 +56,11 @@ involve evaluating ECMAScript expressions and bindings. Evaluation of expressions and bindings is covered in qmlecmascript */ -class tst_qmllanguage : public QObject +class tst_qdeclarativelanguage : public QObject { Q_OBJECT public: - tst_qmllanguage() { + tst_qdeclarativelanguage() { QDeclarativeMetaType::registerCustomStringConverter(qMetaTypeId<MyCustomVariantType>(), myCustomVariantTypeConverter); QFileInfo fileInfo(__FILE__); engine.addImportPath(fileInfo.absoluteDir().filePath(QLatin1String("data/lib"))); @@ -180,12 +180,12 @@ inline QUrl TEST_FILE(const char *filename) return TEST_FILE(QLatin1String(filename)); } -void tst_qmllanguage::cleanupTestCase() +void tst_qdeclarativelanguage::cleanupTestCase() { QVERIFY(QFile::remove(TEST_FILE(QString::fromUtf8("I18nType\303\201\303\242\303\243\303\244\303\245.qml")).toLocalFile())); } -void tst_qmllanguage::errors_data() +void tst_qdeclarativelanguage::errors_data() { QTest::addColumn<QString>("file"); QTest::addColumn<QString>("errorFile"); @@ -306,7 +306,7 @@ void tst_qmllanguage::errors_data() } -void tst_qmllanguage::errors() +void tst_qdeclarativelanguage::errors() { QFETCH(QString, file); QFETCH(QString, errorFile); @@ -325,7 +325,7 @@ void tst_qmllanguage::errors() VERIFY_ERRORS(errorFile.toLatin1().constData()); } -void tst_qmllanguage::simpleObject() +void tst_qdeclarativelanguage::simpleObject() { QDeclarativeComponent component(&engine, TEST_FILE("simpleObject.qml")); VERIFY_ERRORS(0); @@ -333,7 +333,7 @@ void tst_qmllanguage::simpleObject() QVERIFY(object != 0); } -void tst_qmllanguage::simpleContainer() +void tst_qdeclarativelanguage::simpleContainer() { QDeclarativeComponent component(&engine, TEST_FILE("simpleContainer.qml")); VERIFY_ERRORS(0); @@ -342,7 +342,7 @@ void tst_qmllanguage::simpleContainer() QCOMPARE(container->getChildren()->count(),2); } -void tst_qmllanguage::interfaceProperty() +void tst_qdeclarativelanguage::interfaceProperty() { QDeclarativeComponent component(&engine, TEST_FILE("interfaceProperty.qml")); VERIFY_ERRORS(0); @@ -352,7 +352,7 @@ void tst_qmllanguage::interfaceProperty() QVERIFY(object->interface()->id == 913); } -void tst_qmllanguage::interfaceQList() +void tst_qdeclarativelanguage::interfaceQList() { QDeclarativeComponent component(&engine, TEST_FILE("interfaceQList.qml")); VERIFY_ERRORS(0); @@ -363,7 +363,7 @@ void tst_qmllanguage::interfaceQList() QVERIFY(container->getQListInterfaces()->at(ii)->id == 913); } -void tst_qmllanguage::assignObjectToSignal() +void tst_qdeclarativelanguage::assignObjectToSignal() { QDeclarativeComponent component(&engine, TEST_FILE("assignObjectToSignal.qml")); VERIFY_ERRORS(0); @@ -373,7 +373,7 @@ void tst_qmllanguage::assignObjectToSignal() emit object->basicSignal(); } -void tst_qmllanguage::assignObjectToVariant() +void tst_qdeclarativelanguage::assignObjectToVariant() { QDeclarativeComponent component(&engine, TEST_FILE("assignObjectToVariant.qml")); VERIFY_ERRORS(0); @@ -383,7 +383,7 @@ void tst_qmllanguage::assignObjectToVariant() QVERIFY(v.userType() == qMetaTypeId<QObject *>()); } -void tst_qmllanguage::assignLiteralSignalProperty() +void tst_qdeclarativelanguage::assignLiteralSignalProperty() { QDeclarativeComponent component(&engine, TEST_FILE("assignLiteralSignalProperty.qml")); VERIFY_ERRORS(0); @@ -393,7 +393,7 @@ void tst_qmllanguage::assignLiteralSignalProperty() } // Test is an external component can be loaded and assigned (to a qlist) -void tst_qmllanguage::assignQmlComponent() +void tst_qdeclarativelanguage::assignQmlComponent() { QDeclarativeComponent component(&engine, TEST_FILE("assignQmlComponent.qml")); VERIFY_ERRORS(0); @@ -406,7 +406,7 @@ void tst_qmllanguage::assignQmlComponent() } // Test literal assignment to all the basic types -void tst_qmllanguage::assignBasicTypes() +void tst_qdeclarativelanguage::assignBasicTypes() { QDeclarativeComponent component(&engine, TEST_FILE("assignBasicTypes.qml")); VERIFY_ERRORS(0); @@ -441,7 +441,7 @@ void tst_qmllanguage::assignBasicTypes() } // Test edge case type assignments -void tst_qmllanguage::assignTypeExtremes() +void tst_qdeclarativelanguage::assignTypeExtremes() { QDeclarativeComponent component(&engine, TEST_FILE("assignTypeExtremes.qml")); VERIFY_ERRORS(0); @@ -452,7 +452,7 @@ void tst_qmllanguage::assignTypeExtremes() } // Test that a composite type can assign to a property of its base type -void tst_qmllanguage::assignCompositeToType() +void tst_qdeclarativelanguage::assignCompositeToType() { QDeclarativeComponent component(&engine, TEST_FILE("assignCompositeToType.qml")); VERIFY_ERRORS(0); @@ -461,7 +461,7 @@ void tst_qmllanguage::assignCompositeToType() } // Tests that custom parser types can be instantiated -void tst_qmllanguage::customParserTypes() +void tst_qdeclarativelanguage::customParserTypes() { QDeclarativeComponent component(&engine, TEST_FILE("customParserTypes.qml")); VERIFY_ERRORS(0); @@ -471,7 +471,7 @@ void tst_qmllanguage::customParserTypes() } // Tests that the root item can be a custom component -void tst_qmllanguage::rootAsQmlComponent() +void tst_qdeclarativelanguage::rootAsQmlComponent() { QDeclarativeComponent component(&engine, TEST_FILE("rootAsQmlComponent.qml")); VERIFY_ERRORS(0); @@ -482,7 +482,7 @@ void tst_qmllanguage::rootAsQmlComponent() } // Tests that components can be specified inline -void tst_qmllanguage::inlineQmlComponents() +void tst_qdeclarativelanguage::inlineQmlComponents() { QDeclarativeComponent component(&engine, TEST_FILE("inlineQmlComponents.qml")); VERIFY_ERRORS(0); @@ -497,7 +497,7 @@ void tst_qmllanguage::inlineQmlComponents() } // Tests that types that have an id property have it set -void tst_qmllanguage::idProperty() +void tst_qdeclarativelanguage::idProperty() { QDeclarativeComponent component(&engine, TEST_FILE("idProperty.qml")); VERIFY_ERRORS(0); @@ -512,7 +512,7 @@ void tst_qmllanguage::idProperty() } // Tests that signals can be assigned to -void tst_qmllanguage::assignSignal() +void tst_qdeclarativelanguage::assignSignal() { QDeclarativeComponent component(&engine, TEST_FILE("assignSignal.qml")); VERIFY_ERRORS(0); @@ -525,7 +525,7 @@ void tst_qmllanguage::assignSignal() } // Tests the creation and assignment of dynamic properties -void tst_qmllanguage::dynamicProperties() +void tst_qdeclarativelanguage::dynamicProperties() { QDeclarativeComponent component(&engine, TEST_FILE("dynamicProperties.qml")); VERIFY_ERRORS(0); @@ -544,7 +544,7 @@ void tst_qmllanguage::dynamicProperties() } // Test that nested types can use dynamic properties -void tst_qmllanguage::dynamicPropertiesNested() +void tst_qdeclarativelanguage::dynamicPropertiesNested() { QDeclarativeComponent component(&engine, TEST_FILE("dynamicPropertiesNested.qml")); VERIFY_ERRORS(0); @@ -560,7 +560,7 @@ void tst_qmllanguage::dynamicPropertiesNested() } // Tests the creation and assignment to dynamic list properties -void tst_qmllanguage::listProperties() +void tst_qdeclarativelanguage::listProperties() { QDeclarativeComponent component(&engine, TEST_FILE("listProperties.qml")); VERIFY_ERRORS(0); @@ -572,7 +572,7 @@ void tst_qmllanguage::listProperties() // Tests the creation and assignment of dynamic object properties // ### Not complete -void tst_qmllanguage::dynamicObjectProperties() +void tst_qdeclarativelanguage::dynamicObjectProperties() { QDeclarativeComponent component(&engine, TEST_FILE("dynamicObjectProperties.qml")); VERIFY_ERRORS(0); @@ -584,7 +584,7 @@ void tst_qmllanguage::dynamicObjectProperties() } // Tests the declaration of dynamic signals and slots -void tst_qmllanguage::dynamicSignalsAndSlots() +void tst_qdeclarativelanguage::dynamicSignalsAndSlots() { QTest::ignoreMessage(QtDebugMsg, "1921"); @@ -602,7 +602,7 @@ void tst_qmllanguage::dynamicSignalsAndSlots() QCOMPARE(object->property("test").toInt(), 10); } -void tst_qmllanguage::simpleBindings() +void tst_qdeclarativelanguage::simpleBindings() { QDeclarativeComponent component(&engine, TEST_FILE("simpleBindings.qml")); VERIFY_ERRORS(0); @@ -615,7 +615,7 @@ void tst_qmllanguage::simpleBindings() QCOMPARE(object->property("objectProperty"), QVariant::fromValue(object)); } -void tst_qmllanguage::autoComponentCreation() +void tst_qdeclarativelanguage::autoComponentCreation() { QDeclarativeComponent component(&engine, TEST_FILE("autoComponentCreation.qml")); VERIFY_ERRORS(0); @@ -627,7 +627,7 @@ void tst_qmllanguage::autoComponentCreation() QCOMPARE(child->realProperty(), qreal(9)); } -void tst_qmllanguage::propertyValueSource() +void tst_qdeclarativelanguage::propertyValueSource() { { QDeclarativeComponent component(&engine, TEST_FILE("propertyValueSource.qml")); @@ -672,7 +672,7 @@ void tst_qmllanguage::propertyValueSource() } } -void tst_qmllanguage::attachedProperties() +void tst_qdeclarativelanguage::attachedProperties() { QDeclarativeComponent component(&engine, TEST_FILE("attachedProperties.qml")); VERIFY_ERRORS(0); @@ -685,7 +685,7 @@ void tst_qmllanguage::attachedProperties() } // Tests non-static object properties -void tst_qmllanguage::dynamicObjects() +void tst_qdeclarativelanguage::dynamicObjects() { QDeclarativeComponent component(&engine, TEST_FILE("dynamicObject.1.qml")); VERIFY_ERRORS(0); @@ -694,7 +694,7 @@ void tst_qmllanguage::dynamicObjects() } // Tests the registration of custom variant string converters -void tst_qmllanguage::customVariantTypes() +void tst_qdeclarativelanguage::customVariantTypes() { QDeclarativeComponent component(&engine, TEST_FILE("customVariantTypes.qml")); VERIFY_ERRORS(0); @@ -703,7 +703,7 @@ void tst_qmllanguage::customVariantTypes() QCOMPARE(object->customType().a, 10); } -void tst_qmllanguage::valueTypes() +void tst_qdeclarativelanguage::valueTypes() { QDeclarativeComponent component(&engine, TEST_FILE("valueTypes.qml")); VERIFY_ERRORS(0); @@ -739,7 +739,7 @@ void tst_qmllanguage::valueTypes() #endif } -void tst_qmllanguage::cppnamespace() +void tst_qdeclarativelanguage::cppnamespace() { { QDeclarativeComponent component(&engine, TEST_FILE("cppnamespace.qml")); @@ -758,7 +758,7 @@ void tst_qmllanguage::cppnamespace() } } -void tst_qmllanguage::aliasProperties() +void tst_qdeclarativelanguage::aliasProperties() { // Simple "int" alias { @@ -923,7 +923,7 @@ void tst_qmllanguage::aliasProperties() } // Test that the root element in a composite type can be a Component -void tst_qmllanguage::componentCompositeType() +void tst_qdeclarativelanguage::componentCompositeType() { QDeclarativeComponent component(&engine, TEST_FILE("componentCompositeType.qml")); VERIFY_ERRORS(0); @@ -943,7 +943,7 @@ public: TestType2(QObject *p=0) : QObject(p) {} }; -void tst_qmllanguage::i18n_data() +void tst_qdeclarativelanguage::i18n_data() { QTest::addColumn<QString>("file"); QTest::addColumn<QString>("stringProperty"); @@ -955,7 +955,7 @@ void tst_qmllanguage::i18n_data() QTest::newRow("i18nNameSpace") << "i18nNameSpace.qml" << QString::fromUtf8("Test \303\241\303\242\303\243\303\244\303\245: 40"); } -void tst_qmllanguage::i18n() +void tst_qdeclarativelanguage::i18n() { QFETCH(QString, file); QFETCH(QString, stringProperty); @@ -969,7 +969,7 @@ void tst_qmllanguage::i18n() } // Check that the Component::onCompleted attached property works -void tst_qmllanguage::onCompleted() +void tst_qdeclarativelanguage::onCompleted() { QDeclarativeComponent component(&engine, TEST_FILE("onCompleted.qml")); VERIFY_ERRORS(0); @@ -981,7 +981,7 @@ void tst_qmllanguage::onCompleted() } // Check that assignments to QDeclarativeScriptString properties work -void tst_qmllanguage::scriptString() +void tst_qdeclarativelanguage::scriptString() { QDeclarativeComponent component(&engine, TEST_FILE("scriptString.qml")); VERIFY_ERRORS(0); @@ -1000,7 +1000,7 @@ void tst_qmllanguage::scriptString() // Check that default property assignments are correctly spliced into explicit // property assignments -void tst_qmllanguage::defaultPropertyListOrder() +void tst_qdeclarativelanguage::defaultPropertyListOrder() { QDeclarativeComponent component(&engine, TEST_FILE("defaultPropertyListOrder.qml")); VERIFY_ERRORS(0); @@ -1017,7 +1017,7 @@ void tst_qmllanguage::defaultPropertyListOrder() QCOMPARE(container->getChildren()->at(5)->property("index"), QVariant(5)); } -void tst_qmllanguage::declaredPropertyValues() +void tst_qdeclarativelanguage::declaredPropertyValues() { QDeclarativeComponent component(&engine, TEST_FILE("declaredPropertyValues.qml")); QEXPECT_FAIL("", "QTBUG-7860", Abort); @@ -1025,7 +1025,7 @@ void tst_qmllanguage::declaredPropertyValues() } // Check that first child of qml is of given type. Empty type insists on error. -void tst_qmllanguage::testType(const QString& qml, const QString& type) +void tst_qdeclarativelanguage::testType(const QString& qml, const QString& type) { QDeclarativeComponent component(&engine); component.setData(qml.toUtf8(), TEST_FILE("empty.qml")); // just a file for relative local imports @@ -1047,7 +1047,7 @@ QML_DECLARE_TYPE(TestType2) // Import tests (QT-558) -void tst_qmllanguage::importsBuiltin_data() +void tst_qdeclarativelanguage::importsBuiltin_data() { // QT-610 @@ -1136,14 +1136,14 @@ void tst_qmllanguage::importsBuiltin_data() << "TestType2"; } -void tst_qmllanguage::importsBuiltin() +void tst_qdeclarativelanguage::importsBuiltin() { QFETCH(QString, qml); QFETCH(QString, type); testType(qml,type); } -void tst_qmllanguage::importsLocal_data() +void tst_qdeclarativelanguage::importsLocal_data() { QTest::addColumn<QString>("qml"); QTest::addColumn<QString>("type"); @@ -1183,14 +1183,14 @@ void tst_qmllanguage::importsLocal_data() << "TestType"; } -void tst_qmllanguage::importsLocal() +void tst_qdeclarativelanguage::importsLocal() { QFETCH(QString, qml); QFETCH(QString, type); testType(qml,type); } -void tst_qmllanguage::importsRemote_data() +void tst_qdeclarativelanguage::importsRemote_data() { QTest::addColumn<QString>("qml"); QTest::addColumn<QString>("type"); @@ -1204,7 +1204,7 @@ void tst_qmllanguage::importsRemote_data() #include "testhttpserver.h" -void tst_qmllanguage::importsRemote() +void tst_qdeclarativelanguage::importsRemote() { QFETCH(QString, qml); QFETCH(QString, type); @@ -1215,7 +1215,7 @@ void tst_qmllanguage::importsRemote() testType(qml,type); } -void tst_qmllanguage::importsInstalled_data() +void tst_qdeclarativelanguage::importsInstalled_data() { // QT-610 @@ -1253,7 +1253,7 @@ void tst_qmllanguage::importsInstalled_data() << ""; } -void tst_qmllanguage::importsInstalled() +void tst_qdeclarativelanguage::importsInstalled() { QFETCH(QString, qml); QFETCH(QString, type); @@ -1261,7 +1261,7 @@ void tst_qmllanguage::importsInstalled() } -void tst_qmllanguage::importsOrder_data() +void tst_qdeclarativelanguage::importsOrder_data() { QTest::addColumn<QString>("qml"); QTest::addColumn<QString>("type"); @@ -1312,14 +1312,14 @@ void tst_qmllanguage::importsOrder_data() << "QDeclarativeImage"; } -void tst_qmllanguage::importsOrder() +void tst_qdeclarativelanguage::importsOrder() { QFETCH(QString, qml); QFETCH(QString, type); testType(qml,type); } -void tst_qmllanguage::qmlAttachedPropertiesObjectMethod() +void tst_qdeclarativelanguage::qmlAttachedPropertiesObjectMethod() { QObject object; @@ -1347,19 +1347,19 @@ void tst_qmllanguage::qmlAttachedPropertiesObjectMethod() } } -void tst_qmllanguage::crash1() +void tst_qdeclarativelanguage::crash1() { QDeclarativeComponent component(&engine); component.setData("import Qt 4.6\nComponent {}", QUrl()); } -void tst_qmllanguage::crash2() +void tst_qdeclarativelanguage::crash2() { QDeclarativeComponent component(&engine, TEST_FILE("crash2.qml")); } -void tst_qmllanguage::initTestCase() +void tst_qdeclarativelanguage::initTestCase() { registerTypes(); @@ -1381,6 +1381,6 @@ void tst_qmllanguage::initTestCase() out.write(in.readAll()); } -QTEST_MAIN(tst_qmllanguage) +QTEST_MAIN(tst_qdeclarativelanguage) #include "tst_qdeclarativelanguage.moc" |