Skip to content

Commit

Permalink
Refs #4024. Further name clash removal on Win32
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Nov 23, 2011
1 parent 87d8cc4 commit a89112d
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
#include <Poco/Path.h>

using Mantid::DataHandling::GroupDetectors2;
using namespace Mantid;
using namespace Mantid::Kernel;
using namespace Mantid::API;
using namespace Mantid::Geometry;
using namespace Mantid::DataObjects;
using namespace Mantid::NeXus;
using Mantid::detid_t;

class GroupDetectors2Test : public CxxTest::TestSuite
{
Expand Down
29 changes: 13 additions & 16 deletions Code/Mantid/Framework/DataHandling/test/LoadEventNexusTest.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef LOADEVENTNEXUSTEST_H_
#define LOADEVENTNEXUSTEST_H_

#include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/FrameworkManager.h"
Expand All @@ -20,12 +19,10 @@
#include <cxxtest/TestSuite.h>
#include <iostream>

using namespace Mantid;
using namespace Mantid::Geometry;
using namespace Mantid::API;
using namespace Mantid::DataObjects;
using namespace Mantid::Kernel;
using namespace Mantid::NeXus;
using namespace Mantid::DataHandling;

class LoadEventNexusTest : public CxxTest::TestSuite
Expand Down Expand Up @@ -61,9 +58,9 @@ class LoadEventNexusTest : public CxxTest::TestSuite
ld.execute();
TS_ASSERT( ld.isExecuted() );

DataObjects::EventWorkspace_sptr WS;
EventWorkspace_sptr WS;
TS_ASSERT_THROWS_NOTHING(
WS = boost::dynamic_pointer_cast<DataObjects::EventWorkspace>(AnalysisDataService::Instance().retrieve(outws_name)) );
WS = boost::dynamic_pointer_cast<EventWorkspace>(AnalysisDataService::Instance().retrieve(outws_name)) );
//Valid WS and it is an EventWorkspace
TS_ASSERT( WS );
//Pixels have to be padded
Expand Down Expand Up @@ -92,7 +89,7 @@ class LoadEventNexusTest : public CxxTest::TestSuite
ld2.execute();
TS_ASSERT( ld2.isExecuted() );

DataObjects::EventWorkspace_sptr WS2 = boost::dynamic_pointer_cast<DataObjects::EventWorkspace>(AnalysisDataService::Instance().retrieve(outws_name2));
EventWorkspace_sptr WS2 = boost::dynamic_pointer_cast<EventWorkspace>(AnalysisDataService::Instance().retrieve(outws_name2));
//Valid WS and it is an EventWorkspace
TS_ASSERT( WS2 );

Expand All @@ -112,14 +109,14 @@ class LoadEventNexusTest : public CxxTest::TestSuite
load->setPropertyValue("MappingFilename","CNCS_TS_2008_08_18.dat");
load->execute();
TS_ASSERT( load->isExecuted() );
DataObjects::EventWorkspace_sptr WS2 = boost::dynamic_pointer_cast<DataObjects::EventWorkspace>(AnalysisDataService::Instance().retrieve("cncs_pre"));
EventWorkspace_sptr WS2 = boost::dynamic_pointer_cast<EventWorkspace>(AnalysisDataService::Instance().retrieve("cncs_pre"));
//Valid WS and it is an EventWorkspace
TS_ASSERT( WS2 );

//Let's compare the proton_charge logs
Kernel::TimeSeriesProperty<double> * log = dynamic_cast<Kernel::TimeSeriesProperty<double> *>( WS->mutableRun().getProperty("proton_charge") );
TimeSeriesProperty<double> * log = dynamic_cast<TimeSeriesProperty<double> *>( WS->mutableRun().getProperty("proton_charge") );
std::map<DateAndTime, double> logMap = log->valueAsCorrectMap();
Kernel::TimeSeriesProperty<double> * log2 = dynamic_cast<Kernel::TimeSeriesProperty<double> *>( WS2->mutableRun().getProperty("proton_charge") );
TimeSeriesProperty<double> * log2 = dynamic_cast<TimeSeriesProperty<double> *>( WS2->mutableRun().getProperty("proton_charge") );
std::map<DateAndTime, double> logMap2 = log2->valueAsCorrectMap();
std::map<DateAndTime, double>::iterator it, it2;

Expand Down Expand Up @@ -163,7 +160,7 @@ class LoadEventNexusTest : public CxxTest::TestSuite
void test_FilteredLoad_vs_LoadThenFilter()
{
Mantid::API::FrameworkManager::Instance();
DataObjects::EventWorkspace_sptr WS1, WS2;
EventWorkspace_sptr WS1, WS2;
std::string ws1Name = "cncs_filtered_on_load";
std::string ws2Name = "cncs_filtered_after";

Expand All @@ -179,7 +176,7 @@ class LoadEventNexusTest : public CxxTest::TestSuite
TS_ASSERT( ld->isExecuted() );

TS_ASSERT_THROWS_NOTHING(
WS1 = boost::dynamic_pointer_cast<DataObjects::EventWorkspace>(AnalysisDataService::Instance().retrieve(ws1Name)); )
WS1 = boost::dynamic_pointer_cast<EventWorkspace>(AnalysisDataService::Instance().retrieve(ws1Name)); )
//Valid WS and it is an EventWorkspace
TS_ASSERT( WS1 );
//Pixels have to be padded
Expand Down Expand Up @@ -224,7 +221,7 @@ class LoadEventNexusTest : public CxxTest::TestSuite
TS_ASSERT( alg->isExecuted() );

TS_ASSERT_THROWS_NOTHING(
WS2 = boost::dynamic_pointer_cast<DataObjects::EventWorkspace>(AnalysisDataService::Instance().retrieve(ws1Name)); )
WS2 = boost::dynamic_pointer_cast<EventWorkspace>(AnalysisDataService::Instance().retrieve(ws1Name)); )
TS_ASSERT( WS2 );
TS_ASSERT_EQUALS( WS2->getNumberHistograms(), 51200);
TS_ASSERT_EQUALS( WS2->getNumberEvents(), 29753);
Expand All @@ -248,9 +245,9 @@ class LoadEventNexusTest : public CxxTest::TestSuite
ld.execute();
TS_ASSERT( ld.isExecuted() );

DataObjects::EventWorkspace_sptr WS;
EventWorkspace_sptr WS;
TS_ASSERT_THROWS_NOTHING(
WS = boost::dynamic_pointer_cast<DataObjects::EventWorkspace>(AnalysisDataService::Instance().retrieve(outws_name)) );
WS = boost::dynamic_pointer_cast<EventWorkspace>(AnalysisDataService::Instance().retrieve(outws_name)) );
//Valid WS and it is an EventWorkspace
TS_ASSERT( WS );
//Pixels have to be padded
Expand Down Expand Up @@ -319,15 +316,15 @@ class LoadEventNexusTest : public CxxTest::TestSuite
ld.setProperty<bool>("Precount", Precount);
ld.execute();

DataObjects::EventWorkspace_sptr WS;
EventWorkspace_sptr WS;
if (willFail)
{
TS_ASSERT( !ld.isExecuted() );
return;
}

TS_ASSERT( ld.isExecuted() );
TS_ASSERT_THROWS_NOTHING( WS = boost::dynamic_pointer_cast<DataObjects::EventWorkspace>(AnalysisDataService::Instance().retrieve(outws_name)));
TS_ASSERT_THROWS_NOTHING( WS = boost::dynamic_pointer_cast<EventWorkspace>(AnalysisDataService::Instance().retrieve(outws_name)));
//Valid WS and it is an EventWorkspace
TS_ASSERT( WS );
if (!WS) return;
Expand Down
7 changes: 3 additions & 4 deletions Code/Mantid/Framework/DataHandling/test/LoadISISNexusTest.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
#ifndef LOADISISNEXUSTEST_H_
#define LOADISISNEXUSTEST_H_

#include "MantidDataHandling/LoadInstrument.h"
#include <cxxtest/TestSuite.h>

#include "MantidDataHandling/LoadISISNexus.h"
#include "MantidDataHandling/LoadISISNexus2.h"
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidAPI/SpectraDetectorMap.h"
#include "MantidKernel/TimeSeriesProperty.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidAPI/WorkspaceGroup.h"

using namespace Mantid::API;
using namespace Mantid::Kernel;
using namespace Mantid::DataHandling;

#include <cxxtest/TestSuite.h>
#include "MantidAPI/WorkspaceGroup.h"

class LoadISISNexusTest : public CxxTest::TestSuite
{
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
#include "MantidDataObjects/Workspace2D.h"
#include "MantidKernel/PhysicalConstants.h"

using namespace Mantid;
using namespace Mantid::Geometry;
using namespace Mantid::API;
using namespace Mantid::Kernel;
using namespace Mantid::DataHandling;
using Mantid::DataObjects::Workspace2D;
using Mantid::DataObjects::Workspace2D_sptr;

#include <cxxtest/TestSuite.h>
#include "MantidAPI/WorkspaceGroup.h"
Expand All @@ -33,7 +34,7 @@ class LoadLogsFromSNSNexusTest : public CxxTest::TestSuite
ld.setPropertyValue("Filename","REF_L_32035.nxs");

//Create an empty workspace with some fake size, to start from.
DataObjects::Workspace2D_sptr ws = boost::dynamic_pointer_cast<DataObjects::Workspace2D>
Workspace2D_sptr ws = boost::dynamic_pointer_cast<Workspace2D>
(WorkspaceFactory::Instance().create("Workspace2D",1000,18+1,18));
//Put it in the object.
ld.setProperty("Workspace", boost::dynamic_pointer_cast<MatrixWorkspace>(ws));
Expand Down Expand Up @@ -71,7 +72,7 @@ class LoadLogsFromSNSNexusTest : public CxxTest::TestSuite
TS_ASSERT_DELTA( tsp->nthValue(1), 13715.55, 2);

//The time diff between the 0th and 1st entry is 0.328 seconds
TS_ASSERT_DELTA( Kernel::DateAndTime::seconds_from_duration(tsp->nthInterval(0).length()), 0.328, 0.01);
TS_ASSERT_DELTA( DateAndTime::seconds_from_duration(tsp->nthInterval(0).length()), 0.328, 0.01);

//Now the stats

Expand Down
3 changes: 1 addition & 2 deletions Code/Mantid/Framework/DataHandling/test/LoadMuonNexus2Test.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
#include "MantidKernel/TimeSeriesProperty.h"
#include "MantidAPI/SpectraDetectorMap.h"

using namespace Mantid;
using namespace Mantid::API;
using namespace Mantid::Kernel;
using namespace Mantid::NeXus;
using namespace Mantid::DataHandling;
using namespace Mantid::DataObjects;
using Mantid::detid_t;

class LoadMuonNexus2Test : public CxxTest::TestSuite
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <Poco/File.h>
#include "MantidGeometry/IDTypes.h"

using namespace Mantid::NeXus;
using namespace Mantid::Kernel;
using namespace Mantid::DataObjects;
using namespace Mantid::API;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@
#include <fstream>
#include <Poco/Path.h>

using namespace Mantid;
using namespace Mantid::API;
using namespace Mantid::DataObjects;
using namespace Mantid::Geometry;
using namespace Mantid::Kernel;
using namespace Mantid::DataHandling;
using namespace Mantid::NeXus;

class LoadRSaveNLoadNcspTest : public CxxTest::TestSuite
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include <Poco/File.h>
#include "MantidAPI/IAlgorithm.h"

using namespace Mantid;
using namespace Mantid::API;
using namespace Mantid::Kernel;
using namespace Mantid::DataHandling;
using namespace Mantid::DataObjects;
using Mantid::MantidVec;

class LoadTOFRawNexusTest: public CxxTest::TestSuite
{
Expand Down

0 comments on commit a89112d

Please sign in to comment.