From 62b6ecedcc3cca76d3a60841d04dfa69fb3023fb Mon Sep 17 00:00:00 2001 From: Steven Hahn <hahnse@ornl.gov> Date: Mon, 20 Jun 2016 14:15:30 -0700 Subject: [PATCH] Suppress -Wsuppress-override warnings from Gmock. --- Framework/Algorithms/test/RebinByTimeBaseTest.h | 5 +++++ Framework/Crystal/test/MockObjects.h | 5 +++++ Framework/Crystal/test/PeakBackgroundTest.h | 5 +++++ Framework/DataHandling/test/CMakeLists.txt | 3 ++- Framework/DataObjects/test/MockObjects.h | 5 +++++ Framework/Geometry/test/MockObjects.h | 5 +++++ .../MantidSINQ/PoldiUtilities/PoldiMockInstrumentHelpers.h | 5 +++++ Framework/SINQ/test/PoldiSpectrumPawleyFunctionTest.h | 5 +++++ MantidQt/API/test/SignalRangeTest.h | 5 ++++- .../test/ALCBaselineModellingPresenterTest.h | 5 ++++- MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h | 5 +++++ MantidQt/CustomInterfaces/test/EnggDiffractionViewMock.h | 5 ++++- MantidQt/CustomInterfaces/test/ImageROIViewMock.h | 5 +++++ MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h | 5 ++++- MantidQt/CustomInterfaces/test/TomographyViewMock.h | 5 ++++- .../DataProcessorUI/DataProcessorMockObjects.h | 4 ++++ MantidQt/SliceViewer/test/MockObjects.h | 4 +++- Vates/VatesAPI/test/MockObjects.h | 5 +++++ Vates/VatesAPI/test/vtkPeakMarkerFactoryTest.h | 5 ++++- 19 files changed, 83 insertions(+), 8 deletions(-) diff --git a/Framework/Algorithms/test/RebinByTimeBaseTest.h b/Framework/Algorithms/test/RebinByTimeBaseTest.h index a4e49989517..a93ac7133c1 100644 --- a/Framework/Algorithms/test/RebinByTimeBaseTest.h +++ b/Framework/Algorithms/test/RebinByTimeBaseTest.h @@ -68,6 +68,9 @@ createEventWorkspace(const int numberspectra, const int nDistrubutedEvents, return retVal; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + /* This type is an IEventWorkspace, but not an EventWorkspace. */ @@ -104,6 +107,8 @@ private: } }; } + +#pragma gcc diagnostic pop //===================================================================================== // Functional Tests //===================================================================================== diff --git a/Framework/Crystal/test/MockObjects.h b/Framework/Crystal/test/MockObjects.h index 0a4217f1ca7..17813b5b467 100644 --- a/Framework/Crystal/test/MockObjects.h +++ b/Framework/Crystal/test/MockObjects.h @@ -16,6 +16,9 @@ namespace Mantid { namespace Crystal { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + // Mock Background strategy class MockBackgroundStrategy : public BackgroundStrategy { public: @@ -45,6 +48,8 @@ public: return this->getLabel() == label; } }; + +#pragma GCC diagnostic pop } } diff --git a/Framework/Crystal/test/PeakBackgroundTest.h b/Framework/Crystal/test/PeakBackgroundTest.h index 4c5fb2dfb8c..b1111ec4389 100644 --- a/Framework/Crystal/test/PeakBackgroundTest.h +++ b/Framework/Crystal/test/PeakBackgroundTest.h @@ -32,6 +32,9 @@ IPeaksWorkspace_sptr make_peaks_workspace(const V3D &hklPeak) { return peakWS; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + // Mock Background strategy class MockIMDIterator : public IMDIterator { public: @@ -158,4 +161,6 @@ public: } }; +#pragma GCC diagnostic pop + #endif /* MANTID_CRYSTAL_PEAKBACKGROUNDTEST_H_ */ diff --git a/Framework/DataHandling/test/CMakeLists.txt b/Framework/DataHandling/test/CMakeLists.txt index dad857f2033..bef764ad20f 100644 --- a/Framework/DataHandling/test/CMakeLists.txt +++ b/Framework/DataHandling/test/CMakeLists.txt @@ -1,5 +1,5 @@ if ( CXXTEST_FOUND ) - include_directories ( SYSTEM ${CXXTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR} ) + include_directories ( SYSTEM ${CXXTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR}) include_directories ( ../../TestHelpers/inc ) # This variable is used within the cxxtest_add_test macro to build this helper class into the test executable. @@ -14,6 +14,7 @@ if ( CXXTEST_FOUND ) ) cxxtest_add_test ( DataHandlingTest ${TEST_FILES} ) + target_include_directories( DataHandlingTest SYSTEM PRIVATE ${HDF5_INCLUDE_DIRS} ) target_link_libraries( DataHandlingTest LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME} API DataHandling diff --git a/Framework/DataObjects/test/MockObjects.h b/Framework/DataObjects/test/MockObjects.h index 9e60b097f6c..88aa562a9f4 100644 --- a/Framework/DataObjects/test/MockObjects.h +++ b/Framework/DataObjects/test/MockObjects.h @@ -19,6 +19,9 @@ public: ~MockPeakShapeFactory() override {} }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + class MockPeakShape : public Mantid::Geometry::PeakShape { public: MOCK_CONST_METHOD0(frame, Mantid::Kernel::SpecialCoordinateSystem()); @@ -34,4 +37,6 @@ public: } } +#pragma GCC diagnostic pop + #endif /* MOCKOBJECTS_H_ */ diff --git a/Framework/Geometry/test/MockObjects.h b/Framework/Geometry/test/MockObjects.h index 473bd91e3ce..c530db2b0c6 100644 --- a/Framework/Geometry/test/MockObjects.h +++ b/Framework/Geometry/test/MockObjects.h @@ -21,6 +21,9 @@ using boost::regex; namespace { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + /*------------------------------------------------------------ Mock Peak Transform ------------------------------------------------------------*/ @@ -109,4 +112,6 @@ public: MOCK_CONST_METHOD0(getPeakShape, const Mantid::Geometry::PeakShape &()); }; } + +#pragma GCC diagnostic pop #endif /* MANTIDGEOMETRYTEST_MOCKOBJECTS_H_ */ diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiMockInstrumentHelpers.h b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiMockInstrumentHelpers.h index 92d1323c283..f581c005189 100644 --- a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiMockInstrumentHelpers.h +++ b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiMockInstrumentHelpers.h @@ -35,6 +35,9 @@ using namespace Geometry; typedef std::pair<double, double> DoublePair; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + class MockDetector : public PoldiAbstractDetector { protected: std::vector<int> m_availableElements; @@ -388,6 +391,8 @@ public: } }; +#pragma GCC diagnostic pop + class PoldiPeakCollectionHelpers { /* This class contains some static helper function to create * peak collections and related components for testing purposes. diff --git a/Framework/SINQ/test/PoldiSpectrumPawleyFunctionTest.h b/Framework/SINQ/test/PoldiSpectrumPawleyFunctionTest.h index 6a0e873e303..a00dc544343 100644 --- a/Framework/SINQ/test/PoldiSpectrumPawleyFunctionTest.h +++ b/Framework/SINQ/test/PoldiSpectrumPawleyFunctionTest.h @@ -21,6 +21,9 @@ using namespace Mantid::Kernel; using ::testing::_; using ::testing::Mock; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + class MockPawleyFunction : public IPawleyFunction { public: MockPawleyFunction() {} @@ -188,4 +191,6 @@ private: PoldiInstrumentAdapter_sptr m_instrument; }; +#pragma GCC diagnostic pop + #endif /* MANTID_SINQ_POLDISPECTRUMPAWLEYFUNCTIONTEST_H_ */ diff --git a/MantidQt/API/test/SignalRangeTest.h b/MantidQt/API/test/SignalRangeTest.h index 9beaf50bc2a..2cad8ac81d0 100644 --- a/MantidQt/API/test/SignalRangeTest.h +++ b/MantidQt/API/test/SignalRangeTest.h @@ -10,6 +10,9 @@ #include "MantidAPI/IMDIterator.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + class SignalRangeTest : public CxxTest::TestSuite { private: class MockMDWorkspace : public Mantid::API::IMDWorkspace { @@ -199,5 +202,5 @@ public: TS_ASSERT_DELTA(5.0, range.maxValue(), 1e-10); } }; - +#pragma GCC diagnostic pop #endif /* MANTIDQT_API_SIGNALRANGETEST */ diff --git a/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h b/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h index 4e0f8d09b5f..c2605b34530 100644 --- a/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h +++ b/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h @@ -17,6 +17,9 @@ using namespace MantidQt::CustomInterfaces; using namespace testing; using boost::scoped_ptr; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + class MockALCBaselineModellingView : public IALCBaselineModellingView { public: void requestFit() { emit fitRequested(); } @@ -361,5 +364,5 @@ public: m_view->help(); } }; - +#pragma GCC diagnostic pop #endif /* MANTIDQT_CUSTOMINTERFACES_ALCBASELINEMODELLINGTEST_H_ */ diff --git a/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h b/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h index 8dfda5b8aad..98161259f6c 100644 --- a/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h +++ b/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h @@ -24,6 +24,9 @@ operator<<(std::basic_ostream<CharType, CharTrait> &out, } } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + class MockALCDataLoadingView : public IALCDataLoadingView { // XXX: A workaround, needed because of the way the comma is treated in a // macro @@ -365,4 +368,6 @@ public: } }; +#pragma GCC diagnostic pop + #endif /* MANTID_CUSTOMINTERFACES_ALCDATALOADINGTEST_H_ */ diff --git a/MantidQt/CustomInterfaces/test/EnggDiffractionViewMock.h b/MantidQt/CustomInterfaces/test/EnggDiffractionViewMock.h index 1f954b4b082..9d318521c4d 100644 --- a/MantidQt/CustomInterfaces/test/EnggDiffractionViewMock.h +++ b/MantidQt/CustomInterfaces/test/EnggDiffractionViewMock.h @@ -5,6 +5,9 @@ #include <gmock/gmock.h> +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + // This is a simple mock for the tomo interface view when using SCARF. class MockEnggDiffractionView : public MantidQt::CustomInterfaces::IEnggDiffractionView { @@ -235,5 +238,5 @@ public: // virtual void plotCalibOutput(); MOCK_METHOD1(plotCalibOutput, void(const std::string &pyCode)); }; - +#pragma GCC diagnostic pop #endif // MANTID_CUSTOMINTERFACES_ENGGDIFFRACTIONVIEWMOCK_H diff --git a/MantidQt/CustomInterfaces/test/ImageROIViewMock.h b/MantidQt/CustomInterfaces/test/ImageROIViewMock.h index a9ec2b431f2..631680350b8 100644 --- a/MantidQt/CustomInterfaces/test/ImageROIViewMock.h +++ b/MantidQt/CustomInterfaces/test/ImageROIViewMock.h @@ -5,6 +5,9 @@ #include <gmock/gmock.h> +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + class MockImageROIView : public MantidQt::CustomInterfaces::IImageROIView { public: // void initParams(ImageStackPreParams ¶ms) @@ -104,4 +107,6 @@ public: MOCK_METHOD0(resetWidgetsOnNewStack, void()); }; +#pragma GCC diagnostic pop + #endif // MANTID_CUSTOMINTERFACES_IMAGEROIVIEWMOCK_H diff --git a/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h b/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h index 573c66d01d1..85db977dd9f 100644 --- a/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h +++ b/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h @@ -11,6 +11,9 @@ using namespace MantidQt::CustomInterfaces; using namespace Mantid::API; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + class MockView : public ReflMainView { public: MockView(){}; @@ -85,5 +88,5 @@ public: MOCK_CONST_METHOD1(transformArchivePath, std::string(const std::string &)); ~MockICatalogInfo() override {} }; - +#pragma GCC diagnostic pop #endif /*MANTID_CUSTOMINTERFACES_REFLMAINVIEWMOCKOBJECTS_H*/ diff --git a/MantidQt/CustomInterfaces/test/TomographyViewMock.h b/MantidQt/CustomInterfaces/test/TomographyViewMock.h index fd33f5a01ca..be077d65df3 100644 --- a/MantidQt/CustomInterfaces/test/TomographyViewMock.h +++ b/MantidQt/CustomInterfaces/test/TomographyViewMock.h @@ -5,6 +5,9 @@ #include <gmock/gmock.h> +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + // This is a simple mock for the tomo interface view when using SCARF. class MockTomographyIfaceView : public MantidQt::CustomInterfaces::ITomographyIfaceView { @@ -132,5 +135,5 @@ public: // virtual void runAggregateBands(Mantid::API::IAlgorithm_sptr alg) MOCK_METHOD1(runAggregateBands, void(Mantid::API::IAlgorithm_sptr alg)); }; - +#pragma GCC diagnostic pop #endif // MANTID_CUSTOMINTERFACES_TOMOGRAPHYIFACEVIEWMOCK_H diff --git a/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/DataProcessorUI/DataProcessorMockObjects.h b/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/DataProcessorUI/DataProcessorMockObjects.h index 16ade5f9e26..d4109cc6d68 100644 --- a/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/DataProcessorUI/DataProcessorMockObjects.h +++ b/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/DataProcessorUI/DataProcessorMockObjects.h @@ -21,6 +21,9 @@ const int ScaleCol = 6; const int GroupCol = 7; const int OptionsCol = 8; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + class MockDataProcessorView : public DataProcessorView { public: MockDataProcessorView(){}; @@ -110,4 +113,5 @@ private: std::map<std::string, QVariant> m_options; }; +#pragma GCC diagnostic pop #endif /*MANTID_MANTIDWIDGETS_DATAPROCESSORVIEWMOCKOBJECTS_H*/ diff --git a/MantidQt/SliceViewer/test/MockObjects.h b/MantidQt/SliceViewer/test/MockObjects.h index ee19bc3ce5e..f96988fa450 100644 --- a/MantidQt/SliceViewer/test/MockObjects.h +++ b/MantidQt/SliceViewer/test/MockObjects.h @@ -23,8 +23,10 @@ using namespace Mantid::Geometry; using namespace Mantid; using boost::regex; -namespace { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" +namespace { /*------------------------------------------------------------ Zoomable Peaks View ------------------------------------------------------------*/ diff --git a/Vates/VatesAPI/test/MockObjects.h b/Vates/VatesAPI/test/MockObjects.h index a7535656176..5409de39ec1 100644 --- a/Vates/VatesAPI/test/MockObjects.h +++ b/Vates/VatesAPI/test/MockObjects.h @@ -73,6 +73,9 @@ public: ~FakeIMDDimension() override {} }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + //================================================================================================= /// Concrete mocked implementation of IMDWorkspace for testing. class MockIMDWorkspace : public Mantid::API::IMDWorkspace { @@ -177,6 +180,8 @@ public: MOCK_METHOD1(eventRaised, void(double)); }; +#pragma GCC diagnostic pop + class FakeProgressAction : public Mantid::VATES::ProgressAction { void eventRaised(double) override {} }; diff --git a/Vates/VatesAPI/test/vtkPeakMarkerFactoryTest.h b/Vates/VatesAPI/test/vtkPeakMarkerFactoryTest.h index e589941eae6..1cee1a91d4c 100644 --- a/Vates/VatesAPI/test/vtkPeakMarkerFactoryTest.h +++ b/Vates/VatesAPI/test/vtkPeakMarkerFactoryTest.h @@ -23,6 +23,9 @@ using namespace ::testing; using namespace Mantid::VATES; using Mantid::VATES::vtkPeakMarkerFactory; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" + class MockPeakShape : public Peak { public: MOCK_CONST_METHOD0(getHKL, Mantid::Kernel::V3D(void)); @@ -310,5 +313,5 @@ public: } } }; - +#pragma GCC diagnostic pop #endif -- GitLab