Commit 03755aad authored by Stephen's avatar Stephen
Browse files

Fix LLVM warnings

parent b15287c2
......@@ -73,8 +73,6 @@ private:
std::string m_filename;
/// The number of the input entry
int64_t m_entrynumber;
/// The number of periods in the raw file
int m_numberOfPeriods;
// Is file multi period
bool m_isFileMultiPeriod;
// Are multi periods loaded
......
......@@ -33,8 +33,8 @@ using namespace DataObjects;
/// Empty default constructor
LoadMuonNexusV2::LoadMuonNexusV2()
: m_filename(), m_isFileMultiPeriod(false), m_multiPeriodsLoaded(false),
m_entrynumber(0), m_numberOfPeriods(0) {}
: m_filename(), m_entrynumber(0), m_isFileMultiPeriod(false),
m_multiPeriodsLoaded(false) {}
/**
* Return the confidence criteria for this algorithm can load the file
......
......@@ -29,8 +29,8 @@ SinglePeriodLoadMuonStrategy::SinglePeriodLoadMuonStrategy(
Kernel::Logger &g_log, const std::string &filename, NXEntry &entry,
Workspace2D_sptr workspace, int entryNumber, bool isFileMultiPeriod)
: LoadMuonStrategy(g_log, filename), m_entry(entry), m_workspace(workspace),
m_detectors(getLoadedDetectors()), m_entryNumber(entryNumber),
m_isFileMultiPeriod(isFileMultiPeriod) {}
m_entryNumber(entryNumber), m_isFileMultiPeriod(isFileMultiPeriod),
m_detectors(getLoadedDetectors()) {}
/**
* Loads Muon specific logs into the stored workspace
......@@ -159,7 +159,7 @@ void SinglePeriodLoadMuonStrategy::applyTimeZeroCorrection() {
m_workspace->getAxis(0)->unit() = newUnit;
auto numHistograms = m_workspace->getNumberHistograms();
for (auto i = 0; i < numHistograms; ++i) {
for (size_t i = 0; i < numHistograms; ++i) {
auto &timeAxis = m_workspace->mutableX(i);
timeAxis = timeAxis - timeZero;
}
......
......@@ -7,13 +7,16 @@
#pragma once
#include "MantidAPI/AnalysisDataService.h"
#include <cxxtest/TestSuite.h>
#include "MantidAPI/Axis.h"
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidAPI/Run.h"
#include "MantidAPI/WorkspaceGroup.h"
#include "MantidDataHandling/LoadMuonNexusV2.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidKernel/UnitFactory.h"
#include "MantidKernel/UnitLabelTypes.h"
#include <cxxtest/TestSuite.h>
#include <cmath>
......@@ -42,18 +45,30 @@ public:
output_ws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
"outWS"));
Workspace2D_sptr output2D_1 =
Workspace2D_sptr output2D =
std::dynamic_pointer_cast<Workspace2D>(output_ws);
const Mantid::API::Run &run1 = output2D_1->run();
int goodfrm = run1.getPropertyAsIntegerValue("goodfrm");
const Mantid::API::Run &run = output2D->run();
int goodfrm = run.getPropertyAsIntegerValue("goodfrm");
TS_ASSERT_EQUALS(goodfrm, 36197);
double firstGoodData = ld.getProperty("FirstGoodData");
TS_ASSERT_EQUALS(firstGoodData, 0.384);
double timeZero = ld.getProperty("TimeZero");
TS_ASSERT_DELTA(timeZero, 0.1599999, 1e-5);
// check time zero applied to time axis
// Check the unit has been set correctly
TS_ASSERT_EQUALS(output2D->getAxis(0)->unit()->unitID(), "Label");
TS_ASSERT(!output2D->isDistribution());
// Check that sample temp and field set
double temperature = run.getPropertyAsSingleValue("sample_temp");
TS_ASSERT_EQUALS(100.0, temperature);
double field = run.getPropertyAsSingleValue("sample_magn_field");
TS_ASSERT_EQUALS(0.0, field);
}
void testExecWithGroupingTable() {}
};
//------------------------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment