From 42c52e6f2d9002e8191ada765d8a2509c7fae71b Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 21 Dec 2016 10:21:41 +0100 Subject: TestCase: make parent argument to createTemporaryObject optional This matches the behavior seen from Component's createObject() function. Change-Id: I83fe73a588d04c5efd30c49059bb19e7584bef48 Reviewed-by: J-P Nurmi --- src/imports/testlib/TestCase.qml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/imports') diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 1ead2f21b7..18c70e1169 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -567,7 +567,7 @@ Item { \qmlmethod object TestCase::createTemporaryObject(Component component, object parent, object properties) This function dynamically creates a QML object from the given - \a component with the specified \a parent and \a properties. + \a component with the specified optional \a parent and \a properties. The returned object will be destroyed (if it was not already) after \l cleanup() has finished executing, meaning that objects created with this function are guaranteed to be destroyed after each test, @@ -589,12 +589,6 @@ Item { throw new Error("QtQuickTest::fail"); } - if (!parent && parent !== null) { - qtest_results.fail("Second argument must be a parent object or null; actual type is " + typeof parent, - util.callerFile(), util.callerLine()); - throw new Error("QtQuickTest::fail"); - } - if (properties && typeof properties !== "object") { qtest_results.fail("Third argument must be an object; actual type is " + typeof properties, util.callerFile(), util.callerLine()); -- cgit v1.2.3