From 4f1bfbdd4623d0909e4b2c94bd0b69e20d99d6f1 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 13 May 2013 16:59:40 +0200 Subject: [PATCH] Fix build of tst_qqmlecmascript Comment out v8 persistent and weak reference handling related bits and tests. Otherwise this auto test contains a lot of stuff we need. Change-Id: Ieafd9c8ea5200e5429d6354243ccaddba4f4772e Reviewed-by: Lars Knoll --- tests/auto/qml/qqmlecmascript/testtypes.cpp | 4 +++- tests/auto/qml/qqmlecmascript/testtypes.h | 4 +++- tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 20 +++++++++++++++----- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/tests/auto/qml/qqmlecmascript/testtypes.cpp b/tests/auto/qml/qqmlecmascript/testtypes.cpp index 8b02783..ee801ef 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.cpp +++ b/tests/auto/qml/qqmlecmascript/testtypes.cpp @@ -104,7 +104,7 @@ public: void setWidth(int) { } }; -void MyQmlObject::v8function(QQmlV8Function *) +void MyQmlObject::v8function(QQmlV4Function *) { const char *error = "Exception thrown from within QObject slot"; v8::ThrowException(v8::Exception::Error(v8::String::New(error))); @@ -299,8 +299,10 @@ void registerTypes() qRegisterMetaType("MyEnum2"); qRegisterMetaType("Qt::MouseButtons"); +#if 0 qmlRegisterType("Qt.test", 1, 0, "CircularReferenceObject"); qmlRegisterType("Qt.test", 1, 0, "CircularReferenceHandle"); +#endif qmlRegisterType("Qt.test", 1, 0, "MyDynamicCreationDestructionObject"); qmlRegisterType("Qt.test", 1, 0, "WriteCounter"); diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h index e4dd1e3..ca8f97a 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.h +++ b/tests/auto/qml/qqmlecmascript/testtypes.h @@ -265,7 +265,7 @@ public slots: void myinvokable(MyQmlObject *o) { myinvokableObject = o; } void variantMethod(const QVariant &v) { m_variant = v; } void qjsvalueMethod(const QJSValue &v) { m_qjsvalue = v; } - void v8function(QQmlV8Function*); + void v8function(QQmlV4Function*); void registeredFlagMethod(Qt::MouseButtons v) { m_buttons = v; } private: @@ -1172,6 +1172,7 @@ private: int m_value; }; +#if 0 class CircularReferenceObject : public QObject, public QV8GCCallback::Node { @@ -1285,6 +1286,7 @@ private: QV8Engine* m_engine; }; Q_DECLARE_METATYPE(CircularReferenceHandle*) +#endif class MyDynamicCreationDestructionObject : public QObject { diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 364359f..5c0e277 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -156,8 +156,10 @@ private slots: void singletonTypeCaching(); void singletonTypeImportOrder(); void singletonTypeResolution(); +#if 0 void importScripts_data(); void importScripts(); +#endif void scarceResources(); void scarceResources_data(); void scarceResources_other(); @@ -173,13 +175,13 @@ private slots: void propertyVarReparentNullContext(); void propertyVarCircular(); void propertyVarCircular2(); - void propertyVarInheritance(); - void propertyVarInheritance2(); +// void propertyVarInheritance(); +// void propertyVarInheritance2(); void elementAssign(); void objectPassThroughSignals(); void objectConversion(); void booleanConversion(); - void handleReferenceManagement(); +// void handleReferenceManagement(); void stringArg(); void readonlyDeclaration(); void sequenceConversionRead(); @@ -291,8 +293,8 @@ private slots: void stringParsing(); private: - static void propertyVarWeakRefCallback(v8::Persistent object, void* parameter); - static void verifyContextLifetime(QQmlContextData *ctxt); +// static void propertyVarWeakRefCallback(v8::Persistent object, void* parameter); +// static void verifyContextLifetime(QQmlContextData *ctxt); QQmlEngine engine; }; @@ -3767,6 +3769,7 @@ void tst_qqmlecmascript::singletonTypeResolution() delete object; } +#if 0 void tst_qqmlecmascript::verifyContextLifetime(QQmlContextData *ctxt) { QQmlContextData *childCtxt = ctxt->childContexts; @@ -3797,7 +3800,9 @@ void tst_qqmlecmascript::verifyContextLifetime(QQmlContextData *ctxt) { childCtxt = childCtxt->nextChild; } } +#endif +#if 0 void tst_qqmlecmascript::importScripts_data() { QTest::addColumn("testfile"); @@ -4040,6 +4045,7 @@ void tst_qqmlecmascript::importScripts() engine.setImportPathList(importPathList); } +#endif void tst_qqmlecmascript::scarceResources_other() { @@ -4840,6 +4846,7 @@ void tst_qqmlecmascript::propertyVarCircular2() delete object; } +#if 0 void tst_qqmlecmascript::propertyVarWeakRefCallback(v8::Persistent object, void* parameter) { *(int*)(parameter) += 1; @@ -4923,6 +4930,7 @@ void tst_qqmlecmascript::propertyVarInheritance2() QVERIFY(propertyVarWeakRefCallbackCount == 1); // should have been collected now. delete object; } +#endif // Ensure that QObject type conversion works on binding assignment void tst_qqmlecmascript::elementAssign() @@ -4986,6 +4994,7 @@ void tst_qqmlecmascript::booleanConversion() delete object; } +#if 0 void tst_qqmlecmascript::handleReferenceManagement() { @@ -5304,6 +5313,7 @@ void tst_qqmlecmascript::handleReferenceManagement() delete object; } } +#endif void tst_qqmlecmascript::stringArg() { -- 2.7.4