From e725a360a00d3643f21fd39e7fe051d269a512f7 Mon Sep 17 00:00:00 2001 From: Steven Hahn <hahnse@ornl.gov> Date: Tue, 21 Jun 2016 17:32:59 -0400 Subject: [PATCH] Replace supressions with a simpler macro. --- .../Algorithms/test/RebinByTimeBaseTest.h | 16 ++++++--------- Framework/Crystal/test/MockObjects.h | 14 +++++-------- Framework/DataObjects/test/MockObjects.h | 14 +++++-------- Framework/Geometry/test/MockObjects.h | 13 ++++-------- .../test/EnggDiffractionViewMock.h | 10 +++------- .../CustomInterfaces/test/ImageROIViewMock.h | 10 +++------- .../test/ReflMainViewMockObjects.h | 10 +++------- .../test/TomographyViewMock.h | 10 +++------- .../DataProcessorMockObjects.h | 10 +++------- MantidQt/SliceViewer/test/MockObjects.h | 20 ++++++++----------- 10 files changed, 43 insertions(+), 84 deletions(-) diff --git a/Framework/Algorithms/test/RebinByTimeBaseTest.h b/Framework/Algorithms/test/RebinByTimeBaseTest.h index 07d7de66878..2644ad5cac7 100644 --- a/Framework/Algorithms/test/RebinByTimeBaseTest.h +++ b/Framework/Algorithms/test/RebinByTimeBaseTest.h @@ -8,12 +8,13 @@ #include <cxxtest/TestSuite.h> -#include "MantidKernel/DateAndTime.h" -#include "MantidAlgorithms/RebinByTimeAtSample.h" #include "MantidAPI/Axis.h" -#include "MantidDataObjects/Workspace2D.h" +#include "MantidAlgorithms/RebinByTimeAtSample.h" #include "MantidDataObjects/EventWorkspace.h" #include "MantidDataObjects/Events.h" +#include "MantidDataObjects/Workspace2D.h" +#include "MantidKernel/DateAndTime.h" +#include "MantidKernel/WarningSuppressions.h" #include "MantidTestHelpers/WorkspaceCreationHelper.h" #include <boost/make_shared.hpp> #include <gmock/gmock.h> @@ -68,10 +69,7 @@ createEventWorkspace(const int numberspectra, const int nDistrubutedEvents, return retVal; } -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsuggest-override" -#endif +GCC_DIAG_OFF_SUGGEST_OVERRIDE /* This type is an IEventWorkspace, but not an EventWorkspace. @@ -110,9 +108,7 @@ private: }; } -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma gcc diagnostic pop -#endif +GCC_DIAG_ON_SUGGEST_OVERRIDE //===================================================================================== // Functional Tests diff --git a/Framework/Crystal/test/MockObjects.h b/Framework/Crystal/test/MockObjects.h index 87ec6f5f1e7..2ab37abf457 100644 --- a/Framework/Crystal/test/MockObjects.h +++ b/Framework/Crystal/test/MockObjects.h @@ -8,18 +8,16 @@ #ifndef MOCKOBJECTS_H_ #define MOCKOBJECTS_H_ -#include <gmock/gmock.h> -#include <stdexcept> #include "MantidCrystal/BackgroundStrategy.h" #include "MantidCrystal/ICluster.h" +#include "MantidKernel/WarningSuppressions.h" +#include <gmock/gmock.h> +#include <stdexcept> namespace Mantid { namespace Crystal { -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsuggest-override" -#endif +GCC_DIAG_OFF_SUGGEST_OVERRIDE // Mock Background strategy class MockBackgroundStrategy : public BackgroundStrategy { @@ -51,9 +49,7 @@ public: } }; -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic pop -#endif +GCC_DIAG_ON_SUGGEST_OVERRIDE } } diff --git a/Framework/DataObjects/test/MockObjects.h b/Framework/DataObjects/test/MockObjects.h index 5334dcbba19..6544bf76ad1 100644 --- a/Framework/DataObjects/test/MockObjects.h +++ b/Framework/DataObjects/test/MockObjects.h @@ -1,10 +1,11 @@ #ifndef MOCKOBJECTS_H_ #define MOCKOBJECTS_H_ -#include <gmock/gmock.h> -#include "MantidKernel/SpecialCoordinateSystem.h" #include "MantidDataObjects/PeakShapeFactory.h" #include "MantidGeometry/Crystal/PeakShape.h" +#include "MantidKernel/SpecialCoordinateSystem.h" +#include "MantidKernel/WarningSuppressions.h" +#include <gmock/gmock.h> namespace Mantid { namespace DataObjects { @@ -19,10 +20,7 @@ public: ~MockPeakShapeFactory() override {} }; -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsuggest-override" -#endif +GCC_DIAG_OFF_SUGGEST_OVERRIDE class MockPeakShape : public Mantid::Geometry::PeakShape { public: @@ -39,8 +37,6 @@ public: } } -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic pop -#endif +GCC_DIAG_ON_SUGGEST_OVERRIDE #endif /* MOCKOBJECTS_H_ */ diff --git a/Framework/Geometry/test/MockObjects.h b/Framework/Geometry/test/MockObjects.h index b9c362a80a0..6e377fb1b7d 100644 --- a/Framework/Geometry/test/MockObjects.h +++ b/Framework/Geometry/test/MockObjects.h @@ -8,10 +8,11 @@ #ifndef MANTIDGEOMETRYTEST_MOCKOBJECTS_H_ #define MANTIDGEOMETRYTEST_MOCKOBJECTS_H_ +#include "MantidGeometry/Crystal/IPeak.h" #include "MantidGeometry/Crystal/PeakTransform.h" #include "MantidGeometry/Crystal/PeakTransformFactory.h" -#include "MantidGeometry/Crystal/IPeak.h" #include "MantidKernel/SpecialCoordinateSystem.h" +#include "MantidKernel/WarningSuppressions.h" #include <boost/regex.hpp> #include <gmock/gmock.h> @@ -21,10 +22,7 @@ using boost::regex; namespace { -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsuggest-override" -#endif +GCC_DIAG_OFF_SUGGEST_OVERRIDE /*------------------------------------------------------------ Mock Peak Transform @@ -114,8 +112,5 @@ public: MOCK_CONST_METHOD0(getPeakShape, const Mantid::Geometry::PeakShape &()); }; } -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic pop -#endif - +GCC_DIAG_ON_SUGGEST_OVERRIDE #endif /* MANTIDGEOMETRYTEST_MOCKOBJECTS_H_ */ diff --git a/MantidQt/CustomInterfaces/test/EnggDiffractionViewMock.h b/MantidQt/CustomInterfaces/test/EnggDiffractionViewMock.h index 7068a14b57a..d0956af59b7 100644 --- a/MantidQt/CustomInterfaces/test/EnggDiffractionViewMock.h +++ b/MantidQt/CustomInterfaces/test/EnggDiffractionViewMock.h @@ -1,14 +1,12 @@ #ifndef MANTID_CUSTOMINTERFACES_ENGGDIFFRACTIONVIEWMOCK_H #define MANTID_CUSTOMINTERFACES_ENGGDIFFRACTIONVIEWMOCK_H +#include "MantidKernel/WarningSuppressions.h" #include "MantidQtCustomInterfaces/EnggDiffraction/IEnggDiffractionView.h" #include <gmock/gmock.h> -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsuggest-override" -#endif +GCC_DIAG_OFF_SUGGEST_OVERRIDE // This is a simple mock for the tomo interface view when using SCARF. class MockEnggDiffractionView @@ -240,8 +238,6 @@ public: // virtual void plotCalibOutput(); MOCK_METHOD1(plotCalibOutput, void(const std::string &pyCode)); }; -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic pop -#endif +GCC_DIAG_ON_SUGGEST_OVERRIDE #endif // MANTID_CUSTOMINTERFACES_ENGGDIFFRACTIONVIEWMOCK_H diff --git a/MantidQt/CustomInterfaces/test/ImageROIViewMock.h b/MantidQt/CustomInterfaces/test/ImageROIViewMock.h index 6879e2c6833..e71c31b6905 100644 --- a/MantidQt/CustomInterfaces/test/ImageROIViewMock.h +++ b/MantidQt/CustomInterfaces/test/ImageROIViewMock.h @@ -1,14 +1,12 @@ #ifndef MANTID_CUSTOMINTERFACES_IMAGEROIVIEWMOCK_H #define MANTID_CUSTOMINTERFACES_IMAGEROIVIEWMOCK_H +#include "MantidKernel/WarningSuppressions.h" #include "MantidQtCustomInterfaces/Tomography/ITomographyIfaceView.h" #include <gmock/gmock.h> -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsuggest-override" -#endif +GCC_DIAG_OFF_SUGGEST_OVERRIDE class MockImageROIView : public MantidQt::CustomInterfaces::IImageROIView { public: @@ -109,8 +107,6 @@ public: MOCK_METHOD0(resetWidgetsOnNewStack, void()); }; -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic pop -#endif +GCC_DIAG_ON_SUGGEST_OVERRIDE #endif // MANTID_CUSTOMINTERFACES_IMAGEROIVIEWMOCK_H diff --git a/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h b/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h index 706620ad063..2a729080556 100644 --- a/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h +++ b/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h @@ -3,6 +3,7 @@ #include "MantidKernel/ICatalogInfo.h" #include "MantidKernel/ProgressBase.h" +#include "MantidKernel/WarningSuppressions.h" #include "MantidQtCustomInterfaces/Reflectometry/ReflMainView.h" #include "MantidQtCustomInterfaces/Reflectometry/ReflSearchModel.h" #include "MantidQtMantidWidgets/DataProcessorUI/DataProcessorCommand.h" @@ -11,10 +12,7 @@ using namespace MantidQt::CustomInterfaces; using namespace Mantid::API; -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsuggest-override" -#endif +GCC_DIAG_OFF_SUGGEST_OVERRIDE class MockView : public ReflMainView { public: @@ -91,8 +89,6 @@ public: ~MockICatalogInfo() override {} }; -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic pop -#endif +GCC_DIAG_ON_SUGGEST_OVERRIDE #endif /*MANTID_CUSTOMINTERFACES_REFLMAINVIEWMOCKOBJECTS_H*/ diff --git a/MantidQt/CustomInterfaces/test/TomographyViewMock.h b/MantidQt/CustomInterfaces/test/TomographyViewMock.h index be6b8638d55..5c2b6de7ed0 100644 --- a/MantidQt/CustomInterfaces/test/TomographyViewMock.h +++ b/MantidQt/CustomInterfaces/test/TomographyViewMock.h @@ -1,14 +1,12 @@ #ifndef MANTID_CUSTOMINTERFACES_TOMOGRAPHYIFACEVIEWMOCK_H #define MANTID_CUSTOMINTERFACES_TOMOGRAPHYIFACEVIEWMOCK_H +#include "MantidKernel/WarningSuppressions.h" #include "MantidQtCustomInterfaces/Tomography/ITomographyIfaceView.h" #include <gmock/gmock.h> -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsuggest-override" -#endif +GCC_DIAG_OFF_SUGGEST_OVERRIDE // This is a simple mock for the tomo interface view when using SCARF. class MockTomographyIfaceView @@ -138,8 +136,6 @@ public: MOCK_METHOD1(runAggregateBands, void(Mantid::API::IAlgorithm_sptr alg)); }; -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic pop -#endif +GCC_DIAG_ON_SUGGEST_OVERRIDE #endif // MANTID_CUSTOMINTERFACES_TOMOGRAPHYIFACEVIEWMOCK_H diff --git a/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/DataProcessorUI/DataProcessorMockObjects.h b/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/DataProcessorUI/DataProcessorMockObjects.h index 69ab5361b28..2cb459be305 100644 --- a/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/DataProcessorUI/DataProcessorMockObjects.h +++ b/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/DataProcessorUI/DataProcessorMockObjects.h @@ -1,6 +1,7 @@ #ifndef MANTID_MANTIDWIDGETS_DATAPROCESSORVIEWMOCKOBJECTS_H #define MANTID_MANTIDWIDGETS_DATAPROCESSORVIEWMOCKOBJECTS_H +#include "MantidKernel/WarningSuppressions.h" #include "MantidKernel/make_unique.h" #include "MantidQtMantidWidgets/DataProcessorUI/DataProcessorAppendRowCommand.h" #include "MantidQtMantidWidgets/DataProcessorUI/DataProcessorView.h" @@ -21,10 +22,7 @@ const int ScaleCol = 6; const int GroupCol = 7; const int OptionsCol = 8; -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsuggest-override" -#endif +GCC_DIAG_OFF_SUGGEST_OVERRIDE class MockDataProcessorView : public DataProcessorView { public: @@ -115,8 +113,6 @@ private: std::map<std::string, QVariant> m_options; }; -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic pop -#endif +GCC_DIAG_ON_SUGGEST_OVERRIDE #endif /*MANTID_MANTIDWIDGETS_DATAPROCESSORVIEWMOCKOBJECTS_H*/ diff --git a/MantidQt/SliceViewer/test/MockObjects.h b/MantidQt/SliceViewer/test/MockObjects.h index edc778ac76f..dfea4c21f38 100644 --- a/MantidQt/SliceViewer/test/MockObjects.h +++ b/MantidQt/SliceViewer/test/MockObjects.h @@ -3,19 +3,20 @@ #include "MantidAPI/IMDWorkspace.h" #include "MantidAPI/IPeaksWorkspace.h" +#include "MantidGeometry/Crystal/IPeak.h" #include "MantidGeometry/Crystal/PeakTransform.h" #include "MantidGeometry/Crystal/PeakTransformFactory.h" -#include "MantidQtSliceViewer/PeaksPresenter.h" +#include "MantidKernel/UnitLabel.h" +#include "MantidKernel/WarningSuppressions.h" #include "MantidQtSliceViewer/PeakOverlayView.h" #include "MantidQtSliceViewer/PeakOverlayViewFactory.h" #include "MantidQtSliceViewer/PeakViewColor.h" -#include "MantidQtSliceViewer/ZoomablePeaksView.h" +#include "MantidQtSliceViewer/PeaksPresenter.h" #include "MantidQtSliceViewer/UpdateableOnDemand.h" -#include "MantidGeometry/Crystal/IPeak.h" -#include "MantidKernel/UnitLabel.h" +#include "MantidQtSliceViewer/ZoomablePeaksView.h" +#include <QColor> #include <boost/regex.hpp> #include <gmock/gmock.h> -#include <QColor> using namespace MantidQt::SliceViewer; using namespace Mantid::API; @@ -23,10 +24,7 @@ using namespace Mantid::Geometry; using namespace Mantid; using boost::regex; -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsuggest-override" -#endif +GCC_DIAG_OFF_SUGGEST_OVERRIDE namespace { /*------------------------------------------------------------ @@ -252,8 +250,6 @@ public: }; } -#if defined(GCC_VERSION) && GCC_VERSION >= 50000 -#pragma GCC diagnostic pop -#endif +GCC_DIAG_ON_SUGGEST_OVERRIDE #endif -- GitLab