Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
a2faeda2
Commit
a2faeda2
authored
Jul 19, 2018
by
Samuel Jackson
Browse files
Update all clang & gcc warnings to macros
parent
6aeec190
Changes
134
Hide whitespace changes
Inline
Side-by-side
Framework/API/test/FunctionParameterDecoratorTest.h
View file @
a2faeda2
...
...
@@ -443,9 +443,9 @@ private:
class
MockTestableFunctionParameterDecorator
:
public
TestableFunctionParameterDecorator
{
public:
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_METHOD1
(
beforeDecoratedFunctionSet
,
void
(
const
IFunction_sptr
&
));
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
};
};
...
...
Framework/API/test/ILatticeFunctionTest.h
View file @
a2faeda2
...
...
@@ -73,7 +73,7 @@ public:
private:
std
::
vector
<
V3D
>
getTestHKLs
()
{
return
{{
1
,
1
,
0
}};
}
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
// Mock function to check whether the correct methods are called
class
MockLatticeFunction
:
public
ILatticeFunction
{
public:
...
...
@@ -104,6 +104,6 @@ private:
};
};
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
#endif
/* MANTID_API_ILATTICEFUNCTIONTEST_H_ */
Framework/API/test/ImplicitFunctionFactoryTest.h
View file @
a2faeda2
...
...
@@ -16,7 +16,7 @@
#include <memory>
#include <vector>
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
class
ImplicitFunctionFactoryTest
:
public
CxxTest
::
TestSuite
{
private:
...
...
@@ -107,7 +107,7 @@ private:
MOCK_METHOD1
(
setSuccessorParser
,
void
(
Mantid
::
API
::
ImplicitFunctionParameterParser
*
successor
));
};
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
class
MockImplicitFunctionBuilderA
:
public
Mantid
::
API
::
ImplicitFunctionBuilder
{
...
...
Framework/API/test/ImplicitFunctionParameterParserFactoryTest.h
View file @
a2faeda2
...
...
@@ -17,11 +17,11 @@ private:
class
MockImplicitFunctionParameter
:
public
Mantid
::
API
::
ImplicitFunctionParameter
{
public:
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD0
(
getName
,
std
::
string
());
MOCK_CONST_METHOD0
(
isValid
,
bool
());
MOCK_CONST_METHOD0
(
toXMLString
,
std
::
string
());
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
protected:
ImplicitFunctionParameter
*
clone
()
const
override
{
return
new
MockImplicitFunctionParameter
;
...
...
Framework/API/test/LiveListenerTest.h
View file @
a2faeda2
...
...
@@ -14,7 +14,7 @@ public:
// Set this flag to true for testing
m_dataReset
=
true
;
}
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD0
(
name
,
std
::
string
());
MOCK_CONST_METHOD0
(
supportsHistory
,
bool
());
MOCK_CONST_METHOD0
(
buffersEvents
,
bool
());
...
...
@@ -25,7 +25,7 @@ public:
MOCK_METHOD0
(
runStatus
,
RunStatus
());
MOCK_CONST_METHOD0
(
runNumber
,
int
());
MOCK_METHOD1
(
setAlgorithm
,
void
(
const
Mantid
::
API
::
IAlgorithm
&
));
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
};
class
LiveListenerTest
:
public
CxxTest
::
TestSuite
{
...
...
Framework/API/test/ModeratorModelTest.h
View file @
a2faeda2
...
...
@@ -13,13 +13,13 @@ public:
boost
::
shared_ptr
<
ModeratorModel
>
clone
()
const
override
{
return
boost
::
shared_ptr
<
MockModerator
>
();
}
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD0
(
emissionTimeMean
,
double
());
MOCK_CONST_METHOD0
(
emissionTimeVariance
,
double
());
MOCK_CONST_METHOD1
(
sampleTimeDistribution
,
double
(
const
double
));
MOCK_METHOD2
(
setParameterValue
,
void
(
const
std
::
string
&
,
const
std
::
string
&
));
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
};
class
ModeratorModelTest
:
public
CxxTest
::
TestSuite
{
...
...
Framework/API/test/WorkspaceFactoryTest.h
View file @
a2faeda2
...
...
@@ -9,6 +9,7 @@
#include "MantidAPI/Sample.h"
#include "MantidAPI/WorkspaceFactory.h"
#include "MantidKernel/ConfigService.h"
#include "MantidKernel/WarningSuppressions.h"
#include "MantidTestHelpers/FakeObjects.h"
using
Mantid
::
MantidVec
;
...
...
@@ -55,15 +56,13 @@ public:
MatrixWorkspace_sptr
space
;
TS_ASSERT_THROWS_NOTHING
(
space
=
WorkspaceFactory
::
Instance
().
create
(
"work"
,
1
,
1
,
1
));
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
// clang-format off
DIAG_OFF
(
unused
-
value
)
// clang-format on
TS_ASSERT_THROWS_NOTHING
(
dynamic_cast
<
WorkspaceTester
*>
(
space
.
get
()));
#if __clang__
#pragma clang diagnostic pop
#endif
// clang-format off
DIAG_ON
(
unused
-
value
)
// clang-format on
}
/** Make a parent, have the child be created with the same sizes */
...
...
Framework/API/test/WorkspaceGroupTest.h
View file @
a2faeda2
...
...
@@ -58,13 +58,13 @@ private:
// Helper type, representing some concrete workspace type.
class
MockWorkspace
:
public
Mantid
::
API
::
Workspace
{
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD0
(
id
,
const
std
::
string
());
MOCK_CONST_METHOD0
(
name
,
const
std
::
string
());
MOCK_CONST_METHOD0
(
threadSafe
,
bool
());
MOCK_CONST_METHOD0
(
toString
,
const
std
::
string
());
MOCK_CONST_METHOD0
(
getMemorySize
,
size_t
());
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
private:
MockWorkspace
*
doClone
()
const
override
{
throw
std
::
runtime_error
(
"Cloning of MockWorkspace is not implemented."
);
...
...
Framework/Algorithms/test/MCAbsorptionStrategyTest.h
View file @
a2faeda2
...
...
@@ -87,7 +87,7 @@ private:
class
MockBeamProfile
final
:
public
Mantid
::
Algorithms
::
IBeamProfile
{
public:
using
Mantid
::
Algorithms
::
IBeamProfile
::
Ray
;
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD1
(
generatePoint
,
Ray
(
Mantid
::
Kernel
::
PseudoRandomNumberGenerator
&
));
MOCK_CONST_METHOD2
(
generatePoint
,
...
...
@@ -95,7 +95,7 @@ private:
const
Mantid
::
Geometry
::
BoundingBox
&
));
MOCK_CONST_METHOD1
(
defineActiveRegion
,
Mantid
::
Geometry
::
BoundingBox
(
const
Mantid
::
API
::
Sample
&
));
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
};
};
...
...
Framework/Algorithms/test/MaxEnt/MaxentCalculatorTest.h
View file @
a2faeda2
...
...
@@ -13,7 +13,7 @@ using namespace Mantid::Algorithms;
using
namespace
testing
;
class
MockEntropy
:
public
MaxentEntropy
{
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
public:
MOCK_METHOD2
(
derivative
,
std
::
vector
<
double
>
(
const
std
::
vector
<
double
>
&
,
double
));
...
...
@@ -29,7 +29,7 @@ public:
MOCK_METHOD1
(
imageToData
,
std
::
vector
<
double
>
(
const
std
::
vector
<
double
>
&
));
MOCK_METHOD1
(
dataToImage
,
std
::
vector
<
double
>
(
const
std
::
vector
<
double
>
&
));
};
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
using
MockEntropy_sptr
=
std
::
shared_ptr
<
MockEntropy
>
;
class
MaxentCalculatorTest
:
public
CxxTest
::
TestSuite
{
...
...
Framework/Algorithms/test/MonteCarloTesting.h
View file @
a2faeda2
...
...
@@ -25,7 +25,7 @@ namespace MonteCarloTesting {
// -----------------------------------------------------------------------------
class
MockRNG
final
:
public
Mantid
::
Kernel
::
PseudoRandomNumberGenerator
{
public:
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_METHOD0
(
nextValue
,
double
());
MOCK_METHOD2
(
nextValue
,
double
(
double
,
double
));
MOCK_METHOD2
(
nextInt
,
int
(
int
,
int
));
...
...
@@ -36,7 +36,7 @@ public:
MOCK_METHOD2
(
setRange
,
void
(
const
double
,
const
double
));
MOCK_CONST_METHOD0
(
min
,
double
());
MOCK_CONST_METHOD0
(
max
,
double
());
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
};
// -----------------------------------------------------------------------------
...
...
Framework/Algorithms/test/RebinByTimeBaseTest.h
View file @
a2faeda2
...
...
@@ -72,7 +72,7 @@ createEventWorkspace(const int numberspectra, const int nDistrubutedEvents,
return
retVal
;
}
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
/*
This type is an IEventWorkspace, but not an EventWorkspace.
...
...
@@ -115,7 +115,7 @@ private:
};
}
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
//=====================================================================================
// Functional Tests
...
...
Framework/Crystal/test/FindSXPeaksHelperTest.h
View file @
a2faeda2
...
...
@@ -16,14 +16,14 @@ using namespace testing;
namespace
{
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
class
MockProgressBase
:
public
Mantid
::
Kernel
::
ProgressBase
{
public:
MOCK_METHOD1
(
doReport
,
void
(
const
std
::
string
&
));
};
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
}
class
FindSXPeaksHelperTest
:
public
CxxTest
::
TestSuite
{
...
...
Framework/Crystal/test/MockObjects.h
View file @
a2faeda2
...
...
@@ -17,7 +17,7 @@
namespace
Mantid
{
namespace
Crystal
{
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
// Mock Background strategy
class
MockBackgroundStrategy
:
public
BackgroundStrategy
{
...
...
@@ -49,7 +49,7 @@ public:
}
};
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
}
}
...
...
Framework/Crystal/test/PeakBackgroundTest.h
View file @
a2faeda2
...
...
@@ -33,7 +33,7 @@ IPeaksWorkspace_sptr make_peaks_workspace(const V3D &hklPeak) {
return
peakWS
;
}
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
// Mock Background strategy
class
MockIMDIterator
:
public
IMDIterator
{
...
...
@@ -68,7 +68,7 @@ public:
MOCK_CONST_METHOD1
(
isWithinBounds
,
bool
(
size_t
));
};
}
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
class
PeakBackgroundTest
:
public
CxxTest
::
TestSuite
{
public:
...
...
Framework/CurveFitting/src/Functions/CrystalElectricField.cpp
View file @
a2faeda2
...
...
@@ -2,6 +2,7 @@
// Includes
//----------------------------------------------------------------------
#include "MantidCurveFitting/Functions/CrystalElectricField.h"
#include "MantidKernel/WarningSuppressions.h"
#include <algorithm>
#include <array>
...
...
@@ -14,12 +15,11 @@ namespace Functions {
namespace
{
#ifdef __clang__
// The missing braces warning is a false positive -
// https://llvm.org/bugs/show_bug.cgi?id=21629
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-W
missing-braces
"
#endif
// clang-format off
DIAG_OFF
(
missing
-
braces
)
// clang-format on
// Get a complex conjugate of the value returned by
// ComplexMatrix::operator(i,j)
...
...
@@ -636,9 +636,9 @@ void diagonalise(const ComplexFortranMatrix &hamiltonian,
eigenvalues
+=
-
eshift
;
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// clang-format off
DIAG_OFF
(
missing
-
braces
)
// clang-format on
}
// anonymous namespace
...
...
Framework/DataObjects/inc/MantidDataObjects/MDGridBox.tcc
View file @
a2faeda2
...
...
@@ -1287,7 +1287,7 @@ TMDE(void MDGridBox)::centroidSphere(API::CoordTransform &radiusTransform,
}
//-----------------------------------------------------------------------------------------------
// clang-format off
GCC_
DIAG_OFF(array-bounds)
DIAG_OFF(array-bounds)
// clang-format on
/** Integrate the signal within a sphere; for example, to perform single-crystal
* peak integration.
...
...
@@ -1493,7 +1493,7 @@ TMDE(void MDGridBox)::integrateCylinder(
delete[] boxMightTouch;
}
// clang-format off
GCC_
DIAG_ON(array-bounds)
DIAG_ON(array-bounds)
// clang-format on
/**
...
...
Framework/DataObjects/src/MDHistoWorkspace.cpp
View file @
a2faeda2
...
...
@@ -1347,7 +1347,7 @@ uint64_t MDHistoWorkspace::sumNContribEvents() const {
* Get the Q frame system (if any) to use.
*/
// clang-format off
GCC_
DIAG_OFF
(
strict
-
aliasing
)
DIAG_OFF
(
strict
-
aliasing
)
// clang-format on
Kernel
::
SpecialCoordinateSystem
MDHistoWorkspace
::
getSpecialCoordinateSystem
()
const
{
...
...
Framework/DataObjects/test/MDBoxIteratorTest.h
View file @
a2faeda2
...
...
@@ -492,9 +492,9 @@ public:
pBC
(
MDBox
<
MDLeanEvent
<
2
>
,
2
>::
getBoxController
())
{}
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD0
(
getIsMasked
,
bool
());
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
~
MockMDBox
()
override
{
delete
pBC
;
}
};
...
...
@@ -570,10 +570,10 @@ public:
/// Mock Skipping Policy Type to inject.
class
MockSkippingPolicy
:
public
SkippingPolicy
{
public:
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD0
(
keepGoing
,
bool
());
MOCK_METHOD0
(
Die
,
void
());
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
~
MockSkippingPolicy
()
override
{
Die
();
}
};
...
...
Framework/DataObjects/test/MDGridBoxTest.h
View file @
a2faeda2
...
...
@@ -47,12 +47,12 @@ private:
MockMDBox
()
:
MDBox
<
MDLeanEvent
<
1
>
,
1
>
(
new
API
::
BoxController
(
1
)),
pBC
(
MDBox
<
MDLeanEvent
<
1
>
,
1
>::
getBoxController
())
{}
GCC_
DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD0
(
getIsMasked
,
bool
());
MOCK_METHOD0
(
mask
,
void
());
MOCK_METHOD0
(
unmask
,
void
());
~
MockMDBox
()
override
{
delete
pBC
;
}
GCC_
DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
};
// the sp to a box controller used as general reference to all tested
...
...
Prev
1
2
3
4
5
…
7
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment