Skip to content

Commit

Permalink
Turn dataarchivesearch off for the unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Jun 7, 2017
1 parent 608a761 commit 0488b19
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Framework/API/test/MultipleFilePropertyTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class MultipleFilePropertyTest : public CxxTest::TestSuite {
std::string m_dirWithWhitespace;
std::unordered_set<std::string> m_tempDirs;
std::vector<std::string> m_exts;
std::string m_oldArchiveSearchSetting;

Mantid::Kernel::ConfigServiceImpl &g_config;

Expand All @@ -97,6 +98,7 @@ class MultipleFilePropertyTest : public CxxTest::TestSuite {
: m_multiFileLoadingSetting(), m_oldDataSearchDirectories(),
m_oldDefaultFacility(), m_oldDefaultInstrument(), m_dummyFilesDir(),
m_dirWithWhitespace(), m_tempDirs(), m_exts{".raw", ".nxs"},
m_oldArchiveSearchSetting(),
g_config(Mantid::Kernel::ConfigService::Instance()) {
m_dummyFilesDir =
createAbsoluteDirectory("_MultipleFilePropertyTestDummyFiles");
Expand Down Expand Up @@ -157,11 +159,13 @@ class MultipleFilePropertyTest : public CxxTest::TestSuite {
m_oldDataSearchDirectories = g_config.getString("datasearch.directories");
m_oldDefaultFacility = g_config.getString("default.facilities");
m_oldDefaultInstrument = g_config.getString("default.instrument");
m_oldArchiveSearchSetting = g_config.getString("datasearch.searcharchive");

g_config.setString("datasearch.directories",
m_dummyFilesDir + ";" + m_dirWithWhitespace + ";");
g_config.setString("default.facility", "ISIS");
g_config.setString("default.instrument", "TOSCA");
g_config.setString("datasearch.searcharchive", "Off");

// Make sure that multi file loading is enabled for each test.
m_multiFileLoadingSetting =
Expand All @@ -173,6 +177,7 @@ class MultipleFilePropertyTest : public CxxTest::TestSuite {
g_config.setString("datasearch.directories", m_oldDataSearchDirectories);
g_config.setString("default.facility", m_oldDefaultFacility);
g_config.setString("default.instrument", m_oldDefaultInstrument);
g_config.setString("datasearch.searcharchive", m_oldArchiveSearchSetting);

// Replace user's preference after the test has run.
Kernel::ConfigService::Instance().setString("loading.multifile",
Expand Down

0 comments on commit 0488b19

Please sign in to comment.