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 merge requests found
...@@ -15,8 +15,9 @@ namespace Mantid::DataHandling { ...@@ -15,8 +15,9 @@ namespace Mantid::DataHandling {
class DLLExport NexusFileLoader class DLLExport NexusFileLoader
: public API::IFileLoader<Mantid::Kernel::NexusHDF5Descriptor> { : public API::IFileLoader<Mantid::Kernel::NexusHDF5Descriptor> {
public: public:
void exec() override final; // makes sure the NexusHDF5Descriptor is initialized void
virtual void execLoader() = 0; // what would normally be called exec exec() override final; // makes sure the NexusHDF5Descriptor is initialized
virtual void execLoader() = 0; // what would normally be called exec
boost::shared_ptr<Algorithm> createChildAlgorithm( boost::shared_ptr<Algorithm> createChildAlgorithm(
const std::string &name, const double startProgress = -1., const std::string &name, const double startProgress = -1.,
const double endProgress = -1., const bool enableLogging = true, const double endProgress = -1., const bool enableLogging = true,
......
...@@ -10,8 +10,10 @@ namespace Mantid::DataHandling { ...@@ -10,8 +10,10 @@ namespace Mantid::DataHandling {
void NexusFileLoader::exec() { void NexusFileLoader::exec() {
// make sure the descriptor is initialized // make sure the descriptor is initialized
if (!m_fileInfo) { if (!m_fileInfo) {
const std::string filename = this->getPropertyValue("Filename"); // TODO be more generic const std::string filename =
m_fileInfo = std::make_shared<Mantid::Kernel::NexusHDF5Descriptor>(filename); this->getPropertyValue("Filename"); // TODO be more generic
m_fileInfo =
std::make_shared<Mantid::Kernel::NexusHDF5Descriptor>(filename);
} }
// execute the algorithm as normal // execute the algorithm as normal
...@@ -20,9 +22,8 @@ void NexusFileLoader::exec() { ...@@ -20,9 +22,8 @@ void NexusFileLoader::exec() {
boost::shared_ptr<Mantid::API::Algorithm> NexusFileLoader::createChildAlgorithm( boost::shared_ptr<Mantid::API::Algorithm> NexusFileLoader::createChildAlgorithm(
const std::string &name, const double startProgress, const std::string &name, const double startProgress,
const double endProgress, const bool enableLogging, const int &version) { const double endProgress, const bool enableLogging, const int &version) {
auto child = IFileLoader::createChildAlgorithm(name, auto child = IFileLoader::createChildAlgorithm(
startProgress, endProgress, name, startProgress, endProgress, enableLogging, version);
enableLogging, version);
// set the NexusHDF5Descriptor on the child algorithm // set the NexusHDF5Descriptor on the child algorithm
auto nfl = boost::dynamic_pointer_cast<NexusFileLoader>(child); auto nfl = boost::dynamic_pointer_cast<NexusFileLoader>(child);
......
...@@ -64,12 +64,12 @@ public: ...@@ -64,12 +64,12 @@ public:
//====================================== //======================================
void test_isReadable_Returns_False_For_Non_HDF_Filename() { void test_isReadable_Returns_False_For_Non_HDF_Filename() {
TS_ASSERT(!NexusDescriptor::isReadable(m_testNonHDFPath)); TS_ASSERT(!NexusDescriptor::isReadable(m_testNonHDFPath));
TS_ASSERT( TS_ASSERT(!NexusDescriptor::isReadable(m_testNonHDFPath,
!NexusDescriptor::isReadable(m_testNonHDFPath, NexusDescriptor::AnyVersion)); NexusDescriptor::AnyVersion));
TS_ASSERT( TS_ASSERT(!NexusDescriptor::isReadable(m_testNonHDFPath,
!NexusDescriptor::isReadable(m_testNonHDFPath, NexusDescriptor::Version4)); NexusDescriptor::Version4));
TS_ASSERT( TS_ASSERT(!NexusDescriptor::isReadable(m_testNonHDFPath,
!NexusDescriptor::isReadable(m_testNonHDFPath, NexusDescriptor::Version5)); NexusDescriptor::Version5));
} }
void test_isReadable_Defaults_To_All_Versions() { void test_isReadable_Defaults_To_All_Versions() {
...@@ -80,19 +80,20 @@ public: ...@@ -80,19 +80,20 @@ public:
void test_isReadable_With_Version4_Returns_True_Only_For_HDF4() { void test_isReadable_With_Version4_Returns_True_Only_For_HDF4() {
TS_ASSERT( TS_ASSERT(
NexusDescriptor::isReadable(m_testHDF4Path, NexusDescriptor::Version4)); NexusDescriptor::isReadable(m_testHDF4Path, NexusDescriptor::Version4));
TS_ASSERT( TS_ASSERT(!NexusDescriptor::isReadable(m_testHDF5Path,
!NexusDescriptor::isReadable(m_testHDF5Path, NexusDescriptor::Version4)); NexusDescriptor::Version4));
} }
void test_isReadable_With_Version5_Returns_True_Only_For_HDF4() { void test_isReadable_With_Version5_Returns_True_Only_For_HDF4() {
TS_ASSERT( TS_ASSERT(
NexusDescriptor::isReadable(m_testHDF5Path, NexusDescriptor::Version5)); NexusDescriptor::isReadable(m_testHDF5Path, NexusDescriptor::Version5));
TS_ASSERT( TS_ASSERT(!NexusDescriptor::isReadable(m_testHDF4Path,
!NexusDescriptor::isReadable(m_testHDF4Path, NexusDescriptor::Version5)); NexusDescriptor::Version5));
} }
void test_isReadable_Throws_With_Invalid_Filename() { 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 //=================================== 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