[Ktutorial-commits] SF.net SVN: ktutorial:[106] trunk/ktutorial/ktutorial-library/test/ scripting/S
Status: Alpha
Brought to you by:
danxuliu
From: <dan...@us...> - 2010-02-25 05:40:06
|
Revision: 106 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=106&view=rev Author: danxuliu Date: 2010-02-25 05:40:00 +0000 (Thu, 25 Feb 2010) Log Message: ----------- Now it isn't needed to manually remove the WaitFor added in setup(). Anyway, verify that tearDown() "method" was executed. Modified Paths: -------------- trunk/ktutorial/ktutorial-library/test/scripting/ScriptingTest.cpp Modified: trunk/ktutorial/ktutorial-library/test/scripting/ScriptingTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/test/scripting/ScriptingTest.cpp 2010-02-25 05:02:43 UTC (rev 105) +++ trunk/ktutorial/ktutorial-library/test/scripting/ScriptingTest.cpp 2010-02-25 05:40:00 UTC (rev 106) @@ -48,6 +48,10 @@ return mBooleanValue; } + void setBooleanValue(bool booleanValue) { + mBooleanValue = booleanValue; + } + void dummySlot() { mDummySlotCallCount++; } @@ -144,17 +148,13 @@ void ScriptingTest::stepWithCustomSetup() { QTextStream out(mTemporaryFile); - out << "waitFor = null;\n"; - out << "function startStepSetup(step) {\n"; out << " waitFor = ktutorial.newWaitFor(\"WaitForSignal\");\n"; out << " waitFor.setSignal(testObject, \"dummySignal()\");\n"; out << " step.addWaitFor(waitFor, self, \"setFirstStep()\");\n"; out << "}\n"; out << "function startStepTearDown(step) {\n"; - out << " step.removeWaitFor(waitFor);\n"; - out << " waitFor.deleteLater();\n"; - out << " waitFor = null;\n"; + out << " testObject.setBooleanValue(true);\n"; out << "}\n"; out << "function setFirstStep() { tutorial.nextStep(\"first\"); }\n"; @@ -182,6 +182,7 @@ QCOMPARE(scriptedTutorial.mCurrentStep->id(), QString("first")); QCOMPARE(startStep->mWaitsFor.size(), 0); + QVERIFY(mBooleanValue); } void ScriptingTest::stepsWithOptions() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |