diff --git a/Code/Mantid/API/test/AlgorithmProxyTest.h b/Code/Mantid/API/test/AlgorithmProxyTest.h index c2998a31397c3468b69c53b220ba084cb8b3dbbc..159db50e494b7686d95ccb4925231f892b748c25 100644 --- a/Code/Mantid/API/test/AlgorithmProxyTest.h +++ b/Code/Mantid/API/test/AlgorithmProxyTest.h @@ -37,10 +37,10 @@ public: progress(0.333,"Running"); interruption_point(); Algorithm* alg = dynamic_cast<Algorithm*>( this ); - TS_ASSERT( alg ) + TS_ASSERT( alg ); - TS_ASSERT_EQUALS( p1, "stuff" ) - TS_ASSERT_EQUALS( p2, 17 ) + TS_ASSERT_EQUALS( p1, "stuff" ); + TS_ASSERT_EQUALS( p2, 17 ); setProperty("out",28); } @@ -62,8 +62,8 @@ public: void progressHandle(const IAlgorithm* alg,double p,const std::string& msg) { progress = true; - TS_ASSERT_EQUALS( p, 0.333 ) - TS_ASSERT_EQUALS( msg, "Running" ) + TS_ASSERT_EQUALS( p, 0.333 ); + TS_ASSERT_EQUALS( msg, "Running" ); } void finishHandle(const IAlgorithm* alg) { @@ -77,64 +77,64 @@ public: void testCreateProxy() { IAlgorithm_sptr alg = AlgorithmManager::Instance().create("ToyAlgorithmProxy"); - TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) ) - TS_ASSERT_EQUALS( alg->name() , "ToyAlgorithmProxy" ) - TS_ASSERT_EQUALS( alg->version() , 1 ) - TS_ASSERT_EQUALS( alg->category() , "Cat" ) - TS_ASSERT( alg->isInitialized() ) + TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) ); + TS_ASSERT_EQUALS( alg->name() , "ToyAlgorithmProxy" ); + TS_ASSERT_EQUALS( alg->version() , 1 ); + TS_ASSERT_EQUALS( alg->category() , "Cat" ); + TS_ASSERT( alg->isInitialized() ); alg->setChild(true); - TS_ASSERT( !alg->isChild() ) - TS_ASSERT( alg->existsProperty("prop1") ) - TS_ASSERT( alg->existsProperty("prop2") ) - TS_ASSERT( !alg->isRunning() ) - TS_ASSERT( !alg->isRunningAsync() ) + TS_ASSERT( !alg->isChild() ); + TS_ASSERT( alg->existsProperty("prop1") ); + TS_ASSERT( alg->existsProperty("prop2") ); + TS_ASSERT( !alg->isRunning() ); + TS_ASSERT( !alg->isRunningAsync() ); alg->setProperty("prop1","stuff"); alg->setProperty("prop2",17); - TS_ASSERT_THROWS_NOTHING( alg->execute() ) - TS_ASSERT( alg->isExecuted() ) + TS_ASSERT_THROWS_NOTHING( alg->execute() ); + TS_ASSERT( alg->isExecuted() ); int out = alg->getProperty("out"); - TS_ASSERT_EQUALS(out,28) + TS_ASSERT_EQUALS(out,28); } void testRunning() { IAlgorithm_sptr alg = AlgorithmManager::Instance().create("ToyAlgorithmProxy"); - TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) ) + TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) ); alg->setProperty("prop1","stuff"); alg->setProperty("prop2",17); Poco::ActiveResult<bool> res = alg->executeAsync(); res.tryWait(100); - TS_ASSERT( alg->isRunning() ) - TS_ASSERT( alg->isRunningAsync() ) + TS_ASSERT( alg->isRunning() ); + TS_ASSERT( alg->isRunningAsync() ); res.wait(); - TS_ASSERT( res.data() ) - TS_ASSERT( alg->isExecuted() ) + TS_ASSERT( res.data() ); + TS_ASSERT( alg->isExecuted() ); } void testCancel() { IAlgorithm_sptr alg = AlgorithmManager::Instance().create("ToyAlgorithmProxy"); - TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) ) + TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) ); alg->setProperty("prop1","stuff"); alg->setProperty("prop2",17); Poco::ActiveResult<bool> res = alg->executeAsync(); res.tryWait(100); alg->cancel(); res.wait(); - TS_ASSERT( !alg->isExecuted() ) + TS_ASSERT( !alg->isExecuted() ); int out = alg->getProperty("out"); - TS_ASSERT_EQUALS(out,8) + TS_ASSERT_EQUALS(out,8); } void testAddObserver() { IAlgorithm_sptr alg = AlgorithmManager::Instance().create("ToyAlgorithmProxy"); - TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) ) + TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) ); alg->setProperty("prop1","stuff"); alg->setProperty("prop2",17); TestProxyObserver obs(alg); Poco::ActiveResult<bool> res = alg->executeAsync(); res.wait(); - TS_ASSERT( obs.start ) - TS_ASSERT( obs.progress ) - TS_ASSERT( obs.finish ) + TS_ASSERT( obs.start ); + TS_ASSERT( obs.progress ); + TS_ASSERT( obs.finish ); } };