Improve reliability of GC related tests
authorSimon Hausmann <simon.hausmann@digia.com>
Fri, 26 Jul 2013 12:12:58 +0000 (14:12 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 29 Jul 2013 11:28:48 +0000 (13:28 +0200)
commit6d3fb85f969e6d16b1bf4941443ba90c42eccbd0
treee43f0070a2a754f84e16ef1a2ba084089ecce07d
parent60bb004ea2db69a61eff0ff80963064211885393
Improve reliability of GC related tests

Fixes propertyVarCircular2 in clang release builds for example.

Some of the QML/GC related tests had functions like

   function deassign()
   {
       someVariableThatWasholdingSomethingThatShouldBeCollectedNow = null;
       gc();
   }

which work fine with an exact GC like in v8, but with our conservative
collector they are not that reliable and much more vulnerable to a reference
to the object still being around somewhere. So to improve the reliability
of the test, this patch moves the gc() calls out of the JavaScript function
and back to the C++ caller side (these functions are invoked via QMetaObject::invokeMethod),
where the existing gc() helper function will call the collector and also
process posted deferred deletion events for QObjects.

Change-Id: I8c1f715d56d66bc567ea8bd1575f171460b15ac8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
tests/auto/qml/qqmlecmascript/data/PropertyVarOwnershipComponent.qml
tests/auto/qml/qqmlecmascript/data/propertyVar.circular.2.qml
tests/auto/qml/qqmlecmascript/data/propertyVar.circular.qml
tests/auto/qml/qqmlecmascript/data/propertyVar.inherit.qml
tests/auto/qml/qqmlecmascript/data/propertyVar.reparent.qml
tests/auto/qml/qqmlecmascript/data/propertyVarImplicitOwnership.qml
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp