diff --git a/Code/Mantid/Framework/Nexus/test/LoadNexusProcessedTest.h b/Code/Mantid/Framework/Nexus/test/LoadNexusProcessedTest.h index a16c4bbc66f509e2a9bdeffc8ec85fe1d20280f1..4bcbf904c4c12d00aef212816625b9e24621bbd4 100644 --- a/Code/Mantid/Framework/Nexus/test/LoadNexusProcessedTest.h +++ b/Code/Mantid/Framework/Nexus/test/LoadNexusProcessedTest.h @@ -363,16 +363,13 @@ public: std::string filename_root = "LoadNexusProcessed_ExecEvent_"; // Call a function that writes out the file - EventWorkspace_sptr origWS = SaveNexusProcessedTest::do_testExec_EventWorkspaces(filename_root, type, false, false); + std::string outputFile; + EventWorkspace_sptr origWS = SaveNexusProcessedTest::do_testExec_EventWorkspaces(filename_root, type, outputFile, false, false); LoadNexusProcessed alg; TS_ASSERT_THROWS_NOTHING(alg.initialize()); TS_ASSERT( alg.isInitialized() ); - std::ostringstream filename; - filename << filename_root << static_cast<int>(type) << ".nxs"; - testFile= filename.str(); - alg.setPropertyValue("Filename", testFile); - std::string outputFile = alg.getPropertyValue("Filename"); + alg.setPropertyValue("Filename", outputFile); alg.setPropertyValue("OutputWorkspace", output_ws); TS_ASSERT_THROWS_NOTHING(alg.execute()); @@ -422,7 +419,7 @@ public: //TS_ASSERT( equals(origWS, ws, 1e-4) ); //Clear old file - //if( Poco::File(outputFile).exists() ) Poco::File(outputFile).remove(); + if( Poco::File(outputFile).exists() ) Poco::File(outputFile).remove(); } diff --git a/Code/Mantid/Framework/Nexus/test/SaveNexusProcessedTest.h b/Code/Mantid/Framework/Nexus/test/SaveNexusProcessedTest.h index c228a26b1bd310f4927ea6dec8fd351a6eb90e60..915499e3fc23b05f57ee007018380918f448d04f 100644 --- a/Code/Mantid/Framework/Nexus/test/SaveNexusProcessedTest.h +++ b/Code/Mantid/Framework/Nexus/test/SaveNexusProcessedTest.h @@ -307,7 +307,7 @@ public: static EventWorkspace_sptr do_testExec_EventWorkspaces(std::string filename_root, EventType type, - bool makeDifferentTypes=false, bool clearfiles=false) + std::string & outputFile, bool makeDifferentTypes, bool clearfiles) { std::vector< std::vector<int> > groups(5); groups[0].push_back(10); @@ -345,7 +345,7 @@ public: // specify name of file to save workspace to std::ostringstream mess; mess << filename_root << static_cast<int>(type) << ".nxs"; - std::string outputFile = mess.str(); + outputFile = mess.str(); std::string dataName = "spectra"; std::string title = "A simple workspace saved in Processed Nexus format"; @@ -368,22 +368,26 @@ public: void testExec_EventWorkspace_TofEvent() { - do_testExec_EventWorkspaces("SaveNexusProcessed_", TOF, false, clearfiles); + std::string outputFile; + do_testExec_EventWorkspaces("SaveNexusProcessed_", TOF, outputFile, false, clearfiles); } void testExec_EventWorkspace_WeightedEvent() { - do_testExec_EventWorkspaces("SaveNexusProcessed_", WEIGHTED, false, clearfiles); + std::string outputFile; + do_testExec_EventWorkspaces("SaveNexusProcessed_", WEIGHTED, outputFile, false, clearfiles); } void testExec_EventWorkspace_WeightedEventNoTime() { - do_testExec_EventWorkspaces("SaveNexusProcessed_", WEIGHTED_NOTIME, false, clearfiles); + std::string outputFile; + do_testExec_EventWorkspaces("SaveNexusProcessed_", WEIGHTED_NOTIME, outputFile, false, clearfiles); } void testExec_EventWorkspace_DifferentTypes() { - do_testExec_EventWorkspaces("SaveNexusProcessed_DifferentTypes_", WEIGHTED_NOTIME, true, clearfiles); + std::string outputFile; + do_testExec_EventWorkspaces("SaveNexusProcessed_DifferentTypes_", WEIGHTED_NOTIME, outputFile, true, clearfiles); }