Skip to content
Snippets Groups Projects
Commit cc53bf6b authored by Anton Piccardo-Selg's avatar Anton Piccardo-Selg
Browse files

Refs #13872 handle gcc warnings because of optional

parent c639106f
No related branches found
No related tags found
No related merge requests found
#include "MantidDataObjects/MDFramesToSpecialCoordinateSystem.h"
#include "MantidAPI/IMDEventWorkspace.h"
#include "MantidAPI/IMDHistoWorkspace.h"
#include "MantidKernel/WarningSuppressions.h"
namespace Mantid {
namespace DataObjects {
......@@ -9,6 +10,8 @@ MDFramesToSpecialCoordinateSystem::MDFramesToSpecialCoordinateSystem() {}
MDFramesToSpecialCoordinateSystem::~MDFramesToSpecialCoordinateSystem() {}
// Need to turn off the warnings because of boost optional being used.
GCC_DIAG_OFF(maybe-uninitialized)
/**
* Get the Special Coordinate System based on the MDFrame information.
* @param workspace: the workspace which is being queried
......@@ -57,6 +60,7 @@ boost::optional<Mantid::Kernel::SpecialCoordinateSystem>
return output;
}
GCC_DIAG_ON(maybe-uninitialized)
/**
* Make sure that the QFrame types are the same.
......
......@@ -3,6 +3,7 @@
#include "MantidKernel/System.h"
#include "MantidKernel/Utils.h"
#include "MantidKernel/VMD.h"
#include "MantidKernel/WarningSuppressions.h"
#include "MantidDataObjects/MDHistoWorkspace.h"
#include "MantidDataObjects/MDHistoWorkspaceIterator.h"
#include "MantidDataObjects/MDFramesToSpecialCoordinateSystem.h"
......@@ -1213,9 +1214,11 @@ uint64_t MDHistoWorkspace::sumNContribEvents() const {
return sum;
}
/**
* Get the Q frame system (if any) to use.
*/
GCC_DIAG_OFF(strict-aliasing)
Kernel::SpecialCoordinateSystem
MDHistoWorkspace::getSpecialCoordinateSystem() const {
MDFramesToSpecialCoordinateSystem converter;
......@@ -1227,6 +1230,8 @@ MDHistoWorkspace::getSpecialCoordinateSystem() const {
return coordinates;
}
GCC_DIAG_ON(strict-aliasing)
/**
Set the special coordinate system (if any) to use.
......
......@@ -160,9 +160,6 @@ public:
const auto &frame0 = ws->getDimension(0)->getMDFrame();
TSM_ASSERT_EQUALS("Should be a QLab frame",
Mantid::Geometry::QLab::QLabName, frame0.name());
TSM_ASSERT_THROWS_NOTHING(
"Should be a QLab frame",
const auto &tmp = dynamic_cast<const Mantid::Geometry::QLab &>(frame0));
TSM_ASSERT_EQUALS(
"Should have a special coordinate system selection of QLab",
ws->getSpecialCoordinateSystem(), Mantid::Kernel::QLab);
......
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