Skip to content
Snippets Groups Projects
Commit 9d76ea9a authored by mantid-builder's avatar mantid-builder Committed by Peterson, Peter
Browse files

clang-format PR28432 7b3b65b3

parent 7b3b65b3
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,9 @@ namespace Mantid::DataHandling {
class DLLExport NexusFileLoader
: public API::IFileLoader<Mantid::Kernel::NexusHDF5Descriptor> {
public:
void exec() override final; // makes sure the NexusHDF5Descriptor is initialized
virtual void execLoader() = 0; // what would normally be called exec
void
exec() override final; // makes sure the NexusHDF5Descriptor is initialized
virtual void execLoader() = 0; // what would normally be called exec
boost::shared_ptr<Algorithm> createChildAlgorithm(
const std::string &name, const double startProgress = -1.,
const double endProgress = -1., const bool enableLogging = true,
......
......@@ -10,8 +10,10 @@ namespace Mantid::DataHandling {
void NexusFileLoader::exec() {
// make sure the descriptor is initialized
if (!m_fileInfo) {
const std::string filename = this->getPropertyValue("Filename"); // TODO be more generic
m_fileInfo = std::make_shared<Mantid::Kernel::NexusHDF5Descriptor>(filename);
const std::string filename =
this->getPropertyValue("Filename"); // TODO be more generic
m_fileInfo =
std::make_shared<Mantid::Kernel::NexusHDF5Descriptor>(filename);
}
// execute the algorithm as normal
......@@ -20,9 +22,8 @@ void NexusFileLoader::exec() {
boost::shared_ptr<Mantid::API::Algorithm> NexusFileLoader::createChildAlgorithm(
const std::string &name, const double startProgress,
const double endProgress, const bool enableLogging, const int &version) {
auto child = IFileLoader::createChildAlgorithm(name,
startProgress, endProgress,
enableLogging, version);
auto child = IFileLoader::createChildAlgorithm(
name, startProgress, endProgress, enableLogging, version);
// set the NexusHDF5Descriptor on the child algorithm
auto nfl = boost::dynamic_pointer_cast<NexusFileLoader>(child);
......
......@@ -64,12 +64,12 @@ public:
//======================================
void test_isReadable_Returns_False_For_Non_HDF_Filename() {
TS_ASSERT(!NexusDescriptor::isReadable(m_testNonHDFPath));
TS_ASSERT(
!NexusDescriptor::isReadable(m_testNonHDFPath, NexusDescriptor::AnyVersion));
TS_ASSERT(
!NexusDescriptor::isReadable(m_testNonHDFPath, NexusDescriptor::Version4));
TS_ASSERT(
!NexusDescriptor::isReadable(m_testNonHDFPath, NexusDescriptor::Version5));
TS_ASSERT(!NexusDescriptor::isReadable(m_testNonHDFPath,
NexusDescriptor::AnyVersion));
TS_ASSERT(!NexusDescriptor::isReadable(m_testNonHDFPath,
NexusDescriptor::Version4));
TS_ASSERT(!NexusDescriptor::isReadable(m_testNonHDFPath,
NexusDescriptor::Version5));
}
void test_isReadable_Defaults_To_All_Versions() {
......@@ -80,19 +80,20 @@ public:
void test_isReadable_With_Version4_Returns_True_Only_For_HDF4() {
TS_ASSERT(
NexusDescriptor::isReadable(m_testHDF4Path, NexusDescriptor::Version4));
TS_ASSERT(
!NexusDescriptor::isReadable(m_testHDF5Path, NexusDescriptor::Version4));
TS_ASSERT(!NexusDescriptor::isReadable(m_testHDF5Path,
NexusDescriptor::Version4));
}
void test_isReadable_With_Version5_Returns_True_Only_For_HDF4() {
TS_ASSERT(
NexusDescriptor::isReadable(m_testHDF5Path, NexusDescriptor::Version5));
TS_ASSERT(
!NexusDescriptor::isReadable(m_testHDF4Path, NexusDescriptor::Version5));
TS_ASSERT(!NexusDescriptor::isReadable(m_testHDF4Path,
NexusDescriptor::Version5));
}
void test_isReadable_Throws_With_Invalid_Filename() {
TS_ASSERT_THROWS(NexusDescriptor::isReadable(""), const std::invalid_argument &);
TS_ASSERT_THROWS(NexusDescriptor::isReadable(""),
const std::invalid_argument &);
}
//=================================== NexusDescriptor methods
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment