diff --git a/Code/Mantid/Framework/API/test/WorkspaceHistoryTest.h b/Code/Mantid/Framework/API/test/WorkspaceHistoryTest.h index cb564b9c9ca7..14f0deec94db 100644 --- a/Code/Mantid/Framework/API/test/WorkspaceHistoryTest.h +++ b/Code/Mantid/Framework/API/test/WorkspaceHistoryTest.h @@ -371,8 +371,8 @@ class WorkspaceHistoryTest : public CxxTest::TestSuite const auto & histories = wsHistory.getAlgorithmHistories(); TS_ASSERT_EQUALS(3,histories.size()); - - const auto history = wsHistory.getAlgorithmHistory(1); + + auto history = wsHistory.getAlgorithmHistory(1); TS_ASSERT_EQUALS("CreateTransmissionWorkspaceAuto", history->name()); TS_ASSERT_EQUALS(1, history->version()); @@ -382,6 +382,11 @@ class WorkspaceHistoryTest : public CxxTest::TestSuite TS_ASSERT_EQUALS("CreateTransmissionWorkspace", childHistory->name()); TS_ASSERT_EQUALS(1, childHistory->version()); + history = wsHistory.getAlgorithmHistory(2); + + TS_ASSERT_EQUALS("SaveNexusProcessed", history->name()); + TS_ASSERT_EQUALS(1, history->version()); + loadhandle->close(); } diff --git a/Code/Mantid/Framework/API/test/WorkspacePropertyTest.h b/Code/Mantid/Framework/API/test/WorkspacePropertyTest.h index 03114eeee31b..eb5ffe00d5e9 100644 --- a/Code/Mantid/Framework/API/test/WorkspacePropertyTest.h +++ b/Code/Mantid/Framework/API/test/WorkspacePropertyTest.h @@ -191,17 +191,6 @@ class WorkspacePropertyTest : public CxxTest::TestSuite TS_ASSERT( ! history2.isDefault() ) TS_ASSERT_EQUALS( history2.type(), wsp2->type() ) TS_ASSERT_EQUALS( history2.direction(), 1 ) - - wsp3->setValue(""); - PropertyHistory history3 = wsp3->createHistory(); - TS_ASSERT_EQUALS( history3.name(), "workspace3" ) - TS_ASSERT( !history3.value().empty() ) - TS_ASSERT_EQUALS( history3.value().substr(0,5), "__TMP" ) - //TS_ASSERT( history3.isDefault() ) - TS_ASSERT_EQUALS( history3.type(), wsp3->type() ) - TS_ASSERT_EQUALS( history3.direction(), 2 ) - wsp3->setValue("ws3"); - } void testStore() @@ -230,6 +219,19 @@ class WorkspacePropertyTest : public CxxTest::TestSuite TS_ASSERT( ! wsp3->operator()() ) } + void testTempName() + { + wsp4->setValue(""); + // Create and assign the workspace + Workspace_sptr space; + TS_ASSERT_THROWS_NOTHING(space = WorkspaceFactory::Instance().create("WorkspacePropertyTest",1,1,1) ); + *wsp4 = space; + + PropertyHistory history = wsp4->createHistory(); + TS_ASSERT( !history.value().empty() ) + TS_ASSERT_EQUALS( history.value().substr(0,5), "__TMP" ) + } + void testDirection() { TS_ASSERT_EQUALS( wsp1->direction(), 0 ); diff --git a/Code/Mantid/Framework/Algorithms/test/GeneratePythonScriptTest.h b/Code/Mantid/Framework/Algorithms/test/GeneratePythonScriptTest.h index 9a0f948cb008..0a78a47d6ced 100644 --- a/Code/Mantid/Framework/Algorithms/test/GeneratePythonScriptTest.h +++ b/Code/Mantid/Framework/Algorithms/test/GeneratePythonScriptTest.h @@ -68,6 +68,8 @@ class GeneratePythonScriptTest : public CxxTest::TestSuite "#Python Script Generated by GeneratePythonScript Algorithm", "######################################################################", "ERROR: MISSING ALGORITHM: NonExistingAlgorithm with parameters Algorithm: NonExistingAlgorithm v1", + " Execution Date: 1970-Jan-01 00:00:00", + " Execution Duration: -1 seconds", " Parameters:", " Name: InputWorkspace, Value: [\\_A-Za-z0-9]*, Default\\?: Yes, Direction: Input", " Name: OutputWorkspace, Value: [\\_A-Za-z0-9]*, Default\\?: Yes, Direction: Output", @@ -107,7 +109,7 @@ class GeneratePythonScriptTest : public CxxTest::TestSuite } // Verify that if we set the content of ScriptText that it is set correctly. - alg.setPropertyValue("ScriptText", result[10]); + alg.setPropertyValue("ScriptText", result[12]); TS_ASSERT_EQUALS(alg.getPropertyValue("ScriptText"), "CropWorkspace\\(InputWorkspace='testGeneratePython',OutputWorkspace='testGeneratePython',XMin='2',XMax='5'\\)"); file.close(); diff --git a/Test/AutoTestData/HistoryTest_CreateTransmissionAuto.nxs b/Test/AutoTestData/HistoryTest_CreateTransmissionAuto.nxs new file mode 100644 index 000000000000..a6488bdf7565 Binary files /dev/null and b/Test/AutoTestData/HistoryTest_CreateTransmissionAuto.nxs differ