Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
02ab69f9
Commit
02ab69f9
authored
Sep 28, 2017
by
Peterson, Peter
Browse files
Fixes for clang-tidy modernize-use-nullptr
parent
6a53e65b
Changes
642
Hide whitespace changes
Inline
Side-by-side
Framework/API/test/BinEdgeAxisTest.h
View file @
02ab69f9
...
...
@@ -16,7 +16,7 @@ public:
void
test_Clone_With_Only_Workspace_Returns_BinEdgeAxis_
()
{
BinEdgeAxis
ax1
(
10
);
Mantid
::
API
::
Axis
*
copy
=
ax1
.
clone
(
NULL
);
Mantid
::
API
::
Axis
*
copy
=
ax1
.
clone
(
nullptr
);
auto
*
typedCopy
=
dynamic_cast
<
BinEdgeAxis
*>
(
copy
);
TS_ASSERT
(
typedCopy
);
...
...
@@ -27,7 +27,7 @@ public:
void
test_Clone_With_Only_Length_And_Workspace_Returns_BinEdgeAxis_With_New_Length
()
{
BinEdgeAxis
ax1
(
10
);
Mantid
::
API
::
Axis
*
copy
=
ax1
.
clone
(
20
,
NULL
);
Mantid
::
API
::
Axis
*
copy
=
ax1
.
clone
(
20
,
nullptr
);
auto
*
typedCopy
=
dynamic_cast
<
BinEdgeAxis
*>
(
copy
);
TS_ASSERT
(
typedCopy
);
...
...
Framework/API/test/ExperimentInfoTest.h
View file @
02ab69f9
...
...
@@ -104,7 +104,7 @@ public:
void
test_Setting_A_New_Source_With_NULL_Ptr_Throws
()
{
ExperimentInfo
ws
;
TS_ASSERT_THROWS
(
ws
.
setModeratorModel
(
NULL
),
std
::
invalid_argument
);
TS_ASSERT_THROWS
(
ws
.
setModeratorModel
(
nullptr
),
std
::
invalid_argument
);
}
void
test_Retrieving_Source_Properties_Before_Set_Throws
()
{
...
...
@@ -191,7 +191,7 @@ public:
addRunWithLog
(
expt
,
actualLogName
,
logValue
);
addInstrumentWithParameter
(
expt
,
instPar
,
actualLogName
);
Property
*
log
(
NULL
);
Property
*
log
(
nullptr
);
TS_ASSERT_THROWS_NOTHING
(
log
=
expt
.
getLog
(
instPar
));
TS_ASSERT_EQUALS
(
log
->
name
(),
actualLogName
);
}
...
...
@@ -203,7 +203,7 @@ public:
addRunWithLog
(
expt
,
actualLogName
,
logValue
);
addInstrumentWithParameter
(
expt
,
actualLogName
,
"some value"
);
Property
*
log
(
NULL
);
Property
*
log
(
nullptr
);
TS_ASSERT_THROWS_NOTHING
(
log
=
expt
.
getLog
(
actualLogName
));
TS_ASSERT_EQUALS
(
log
->
name
(),
actualLogName
);
}
...
...
Framework/API/test/FileFinderTest.h
View file @
02ab69f9
...
...
@@ -469,7 +469,7 @@ public:
// Shun use of Poco, which is slower.
FILE
*
pFile
;
pFile
=
fopen
(
cstr
,
"w"
);
if
(
pFile
!=
NULL
)
{
if
(
pFile
!=
nullptr
)
{
fclose
(
pFile
);
}
}
...
...
Framework/API/test/ImplicitFunctionParameterParserFactoryTest.h
View file @
02ab69f9
...
...
@@ -70,7 +70,7 @@ public:
dynamic_cast
<
MockImplicitFunctionParameterParserA
*>
(
parser
);
TSM_ASSERT
(
"The correct implicit implicit function parameter parser type "
"has not been generated"
,
NULL
!=
a
);
nullptr
!=
a
);
delete
parser
;
}
...
...
@@ -82,7 +82,7 @@ public:
dynamic_cast
<
MockImplicitFunctionParameterParserB
*>
(
parser
);
TSM_ASSERT
(
"The correct implicit function parameter parser type has not "
"been generated"
,
NULL
!=
b
);
nullptr
!=
b
);
delete
parser
;
}
...
...
Framework/API/test/ImplicitFunctionParserFactoryTest.h
View file @
02ab69f9
...
...
@@ -19,7 +19,7 @@ private:
public:
Mantid
::
API
::
ImplicitFunctionParameter
*
createParameter
(
Poco
::
XML
::
Element
*
)
override
{
return
NULL
;
return
nullptr
;
}
void
setSuccessorParser
(
Mantid
::
API
::
ImplicitFunctionParameterParser
*
)
override
{}
...
...
@@ -34,7 +34,7 @@ private:
Mantid
::
API
::
ImplicitFunctionBuilder
*
createFunctionBuilder
(
Poco
::
XML
::
Element
*
)
override
{
return
NULL
;
return
nullptr
;
}
void
setSuccessorParser
(
Mantid
::
API
::
ImplicitFunctionParser
*
)
override
{}
void
setParameterParser
(
...
...
@@ -50,7 +50,7 @@ private:
Mantid
::
API
::
ImplicitFunctionBuilder
*
createFunctionBuilder
(
Poco
::
XML
::
Element
*
)
override
{
return
NULL
;
return
nullptr
;
}
void
setSuccessorParser
(
Mantid
::
API
::
ImplicitFunctionParser
*
)
override
{}
void
setParameterParser
(
...
...
@@ -73,7 +73,7 @@ public:
dynamic_cast
<
MockImplicitFunctionParserA
*>
(
parser
);
TSM_ASSERT
(
"The correct implicit parserparameter parser type has not been "
"generated"
,
NULL
!=
a
);
nullptr
!=
a
);
delete
parser
;
}
...
...
@@ -85,7 +85,7 @@ public:
dynamic_cast
<
MockImplicitFunctionParserB
*>
(
parser
);
TSM_ASSERT
(
"The correct implicit parserparameter parser type has not been "
"generated"
,
NULL
!=
b
);
nullptr
!=
b
);
delete
parser
;
}
...
...
Framework/API/test/LogManagerTest.h
View file @
02ab69f9
...
...
@@ -69,7 +69,7 @@ public:
Property
*
p
=
new
ConcreteProperty
();
TS_ASSERT_THROWS_NOTHING
(
runInfo
.
addProperty
(
p
));
Property
*
pp
=
NULL
;
Property
*
pp
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
pp
=
runInfo
.
getProperty
(
"Test"
));
TS_ASSERT_EQUALS
(
p
,
pp
);
TS_ASSERT
(
!
pp
->
name
().
compare
(
"Test"
));
...
...
@@ -184,7 +184,7 @@ public:
const
double
value
=
10.9
;
addTimeSeriesEntry
(
runInfo
,
name
,
value
);
TimeSeriesProperty
<
double
>
*
tsp
(
NULL
);
TimeSeriesProperty
<
double
>
*
tsp
(
nullptr
);
TS_ASSERT_THROWS_NOTHING
(
tsp
=
runInfo
.
getTimeSeriesProperty
<
double
>
(
name
));
TS_ASSERT_DELTA
(
tsp
->
firstValue
(),
value
,
1e-12
);
}
...
...
Framework/API/test/MDGeometryTest.h
View file @
02ab69f9
...
...
@@ -133,10 +133,10 @@ public:
g
.
getTransformToOriginal
(
0
));
TS_ASSERT_DIFFERS
(
g2
.
getTransformToOriginal
(
1
),
g
.
getTransformToOriginal
(
1
));
TS_ASSERT
(
g2
.
getTransformFromOriginal
(
0
)
!=
NULL
);
TS_ASSERT
(
g2
.
getTransformFromOriginal
(
1
)
!=
NULL
);
TS_ASSERT
(
g2
.
getTransformToOriginal
(
0
)
!=
NULL
);
TS_ASSERT
(
g2
.
getTransformToOriginal
(
1
)
!=
NULL
);
TS_ASSERT
(
g2
.
getTransformFromOriginal
(
0
)
!=
nullptr
);
TS_ASSERT
(
g2
.
getTransformFromOriginal
(
1
)
!=
nullptr
);
TS_ASSERT
(
g2
.
getTransformToOriginal
(
0
)
!=
nullptr
);
TS_ASSERT
(
g2
.
getTransformToOriginal
(
1
)
!=
nullptr
);
}
/** Adding dimension info and searching for it back */
...
...
Framework/API/test/MatrixWorkspaceMDIteratorTest.h
View file @
02ab69f9
...
...
@@ -51,7 +51,7 @@ public:
void
test_iterating
()
{
boost
::
shared_ptr
<
MatrixWorkspace
>
ws
=
makeFakeWS
();
IMDIterator
*
it
=
NULL
;
IMDIterator
*
it
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
it
=
ws
->
createIterator
(
NULL
));
TS_ASSERT_EQUALS
(
it
->
getDataSize
(),
20
);
TS_ASSERT_DELTA
(
it
->
getSignal
(),
0.0
,
1e-5
);
...
...
Framework/API/test/PeakFunctionIntegratorTest.h
View file @
02ab69f9
...
...
@@ -95,14 +95,14 @@ public:
void
testDefaultConstruction
()
{
TestablePeakFunctionIntegrator
integrator
;
TS_ASSERT
(
integrator
.
m_integrationWorkspace
!=
0
);
TS_ASSERT
(
integrator
.
m_integrationWorkspace
!=
nullptr
);
TS_ASSERT_EQUALS
(
integrator
.
m_relativePrecision
,
1e-8
);
}
void
testConstruction
()
{
TestablePeakFunctionIntegrator
integrator
(
1e-10
);
TS_ASSERT
(
integrator
.
m_integrationWorkspace
!=
0
);
TS_ASSERT
(
integrator
.
m_integrationWorkspace
!=
nullptr
);
TS_ASSERT_EQUALS
(
integrator
.
m_relativePrecision
,
1e-10
);
}
...
...
Framework/API/test/RunTest.h
View file @
02ab69f9
...
...
@@ -73,7 +73,7 @@ public:
Property
*
p
=
new
ConcreteProperty
();
TS_ASSERT_THROWS_NOTHING
(
runInfo
.
addProperty
(
p
));
Property
*
pp
=
NULL
;
Property
*
pp
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
pp
=
runInfo
.
getProperty
(
"Test"
));
TS_ASSERT_EQUALS
(
p
,
pp
);
TS_ASSERT
(
!
pp
->
name
().
compare
(
"Test"
));
...
...
@@ -142,7 +142,7 @@ public:
const
double
value
=
10.9
;
addTimeSeriesEntry
(
runInfo
,
name
,
value
);
TimeSeriesProperty
<
double
>
*
tsp
(
NULL
);
TimeSeriesProperty
<
double
>
*
tsp
(
nullptr
);
TS_ASSERT_THROWS_NOTHING
(
tsp
=
runInfo
.
getTimeSeriesProperty
<
double
>
(
name
));
TS_ASSERT_DELTA
(
tsp
->
firstValue
(),
value
,
1e-12
);
}
...
...
Framework/API/test/SpectrumDetectorMappingTest.h
View file @
02ab69f9
...
...
@@ -20,7 +20,7 @@ public:
static
void
destroySuite
(
SpectrumDetectorMappingTest
*
suite
)
{
delete
suite
;
}
void
test_workspace_constructor_null_pointer
()
{
TS_ASSERT_THROWS
(
SpectrumDetectorMapping
(
NULL
),
std
::
invalid_argument
);
TS_ASSERT_THROWS
(
SpectrumDetectorMapping
(
nullptr
),
std
::
invalid_argument
);
}
void
test_workspace_constructor_fills_map
()
{
...
...
@@ -114,9 +114,9 @@ public:
void
test_array_constructor_null_inputs
()
{
specnum_t
specs
[
2
];
detid_t
detids
[
2
];
TS_ASSERT_THROWS
(
SpectrumDetectorMapping
(
NULL
,
detids
,
10
),
TS_ASSERT_THROWS
(
SpectrumDetectorMapping
(
nullptr
,
detids
,
10
),
std
::
invalid_argument
);
TS_ASSERT_THROWS
(
SpectrumDetectorMapping
(
specs
,
NULL
,
10
),
TS_ASSERT_THROWS
(
SpectrumDetectorMapping
(
specs
,
nullptr
,
10
),
std
::
invalid_argument
);
}
...
...
Framework/API/test/VectorParameterParserTest.h
View file @
02ab69f9
...
...
@@ -70,7 +70,7 @@ public:
dynamic_cast
<
ConcreteVectorDblParam
*>
(
product
);
TSM_ASSERT
(
"The wrong product parameter has been produced"
,
(
actualProduct
!=
NULL
));
(
actualProduct
!=
nullptr
));
double
v1
=
(
*
actualProduct
)[
0
];
double
v2
=
(
*
actualProduct
)[
1
];
double
v3
=
(
*
actualProduct
)[
2
];
...
...
@@ -131,7 +131,7 @@ public:
dynamic_cast
<
ConcreteVectorBoolParam
*>
(
product
);
TSM_ASSERT
(
"The wrong product parameter has been produced"
,
(
actualProduct
!=
NULL
));
(
actualProduct
!=
nullptr
));
bool
v1
=
(
*
actualProduct
)[
0
];
bool
v2
=
(
*
actualProduct
)[
1
];
...
...
@@ -167,7 +167,7 @@ public:
ConcreteVectorDblParamParser
parser
;
ConcreteVectorDblParam
*
product
=
parser
.
createWithoutDelegation
(
pRootElem
);
TS_ASSERT
(
product
!=
NULL
);
TS_ASSERT
(
product
!=
nullptr
);
delete
product
;
}
};
...
...
Framework/Algorithms/test/AddLogDerivativeTest.h
View file @
02ab69f9
...
...
@@ -62,14 +62,14 @@ public:
TS_ASSERT_THROWS_NOTHING
(
alg
.
execute
(););
if
(
willFail
)
{
TS_ASSERT
(
!
alg
.
isExecuted
());
return
NULL
;
return
nullptr
;
}
else
TS_ASSERT
(
alg
.
isExecuted
());
Run
&
run
=
ws
->
mutableRun
();
TS_ASSERT
(
run
.
hasProperty
(
NewLogName
));
if
(
!
run
.
hasProperty
(
NewLogName
))
return
NULL
;
return
nullptr
;
p
=
dynamic_cast
<
TimeSeriesProperty
<
double
>
*>
(
run
.
getProperty
(
NewLogName
));
TS_ASSERT
(
p
);
return
p
;
...
...
Framework/Algorithms/test/AddSampleLogTest.h
View file @
02ab69f9
...
...
@@ -204,7 +204,7 @@ public:
alg
.
getProperty
(
"Workspace"
));
const
Run
&
wSpaceRun
=
output
->
run
();
Property
*
prop
=
NULL
;
Property
*
prop
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
prop
=
wSpaceRun
.
getLogData
(
LogName
);)
if
(
!
prop
)
return
;
...
...
Framework/Algorithms/test/ClearMaskFlagTest.h
View file @
02ab69f9
...
...
@@ -41,7 +41,7 @@ public:
const
int
nummask
=
5
;
Instrument_sptr
instr
=
boost
::
dynamic_pointer_cast
<
Instrument
>
(
ComponentCreationHelper
::
createTestInstrumentCylindrical
(
1
));
Detector
*
d
=
new
Detector
(
"det"
,
0
,
0
);
Detector
*
d
=
new
Detector
(
"det"
,
0
,
nullptr
);
instr
->
add
(
d
);
instr
->
markAsDetector
(
d
);
...
...
Framework/Algorithms/test/ConvertSpectrumAxis2Test.h
View file @
02ab69f9
...
...
@@ -48,7 +48,7 @@ private:
outputWSSignedTheta
));
// Check the signed theta axes of the workspaces.
const
Axis
*
thetaAxis
=
0
;
const
Axis
*
thetaAxis
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
thetaAxis
=
outputSignedTheta
->
getAxis
(
1
));
TS_ASSERT
(
thetaAxis
->
isNumeric
());
...
...
@@ -74,7 +74,7 @@ private:
outputWSTheta
));
// Workspaces should now have a numeric axes up the side, with units of
// angle.
const
Axis
*
thetaAxis
=
0
;
const
Axis
*
thetaAxis
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
thetaAxis
=
output
->
getAxis
(
1
));
TS_ASSERT
(
thetaAxis
->
isNumeric
());
TS_ASSERT_EQUALS
(
thetaAxis
->
unit
()
->
caption
(),
"Scattering angle"
);
...
...
@@ -212,7 +212,7 @@ public:
outputWS
));
// Should now have a numeric axis up the side, with units of Q
const
Axis
*
qAxis
=
0
;
const
Axis
*
qAxis
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
qAxis
=
output
->
getAxis
(
1
));
TS_ASSERT
(
qAxis
->
isNumeric
());
TS_ASSERT_EQUALS
(
qAxis
->
unit
()
->
unitID
(),
"MomentumTransfer"
);
...
...
@@ -254,7 +254,7 @@ public:
outputWS
));
// Should now have a numeric axis up the side, with units of d
const
Axis
*
qAxis
=
0
;
const
Axis
*
qAxis
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
qAxis
=
output
->
getAxis
(
1
));
TS_ASSERT
(
qAxis
->
isNumeric
());
TS_ASSERT_EQUALS
(
qAxis
->
unit
()
->
unitID
(),
"dSpacing"
);
...
...
@@ -296,7 +296,7 @@ public:
outputWS
));
// Should now have a numeric axis up the side, with units of Q^2
const
Axis
*
q2Axis
=
0
;
const
Axis
*
q2Axis
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
q2Axis
=
output
->
getAxis
(
1
));
TS_ASSERT
(
q2Axis
->
isNumeric
());
TS_ASSERT_EQUALS
(
q2Axis
->
unit
()
->
unitID
(),
"QSquared"
);
...
...
@@ -358,7 +358,7 @@ public:
outputWS
));
// Should now have a numeric axis up the side, with units of Q
const
Axis
*
qAxis
=
0
;
const
Axis
*
qAxis
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
qAxis
=
output
->
getAxis
(
1
));
TS_ASSERT
(
qAxis
->
isNumeric
());
TS_ASSERT_EQUALS
(
qAxis
->
unit
()
->
unitID
(),
"MomentumTransfer"
);
...
...
@@ -412,7 +412,7 @@ public:
outputWS
));
// Should now have a numeric axis up the side, with units of Q.
const
Axis
*
qAxis
=
0
;
const
Axis
*
qAxis
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
qAxis
=
output
->
getAxis
(
1
));
TS_ASSERT
(
qAxis
->
isNumeric
());
TS_ASSERT_EQUALS
(
qAxis
->
unit
()
->
unitID
(),
"MomentumTransfer"
);
...
...
Framework/Algorithms/test/ConvertSpectrumAxisTest.h
View file @
02ab69f9
...
...
@@ -70,7 +70,7 @@ public:
outputWS
));
// Should now have a numeric axis up the side, with units of angle
const
Axis
*
thetaAxis
=
0
;
const
Axis
*
thetaAxis
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
thetaAxis
=
output
->
getAxis
(
1
));
TS_ASSERT
(
thetaAxis
->
isNumeric
());
TS_ASSERT_EQUALS
(
thetaAxis
->
unit
()
->
caption
(),
"Scattering angle"
);
...
...
@@ -106,7 +106,7 @@ public:
outputSignedThetaAxisWS
));
// Check the signed theta axis
const
Axis
*
thetaAxis
=
0
;
const
Axis
*
thetaAxis
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
thetaAxis
=
outputSignedTheta
->
getAxis
(
1
));
TS_ASSERT
(
thetaAxis
->
isNumeric
());
TS_ASSERT_EQUALS
(
thetaAxis
->
unit
()
->
caption
(),
"Scattering angle"
);
...
...
@@ -152,7 +152,7 @@ public:
outputWS
));
// Should now have a numeric axis up the side, with units of angle
const
Axis
*
thetaAxis
=
0
;
const
Axis
*
thetaAxis
=
nullptr
;
TS_ASSERT_THROWS_NOTHING
(
thetaAxis
=
output
->
getAxis
(
1
));
TS_ASSERT
(
thetaAxis
->
isNumeric
());
TS_ASSERT_EQUALS
(
thetaAxis
->
unit
()
->
caption
(),
"Energy transfer"
);
...
...
Framework/Algorithms/test/CreateSingleValuedWorkspaceTest.h
View file @
02ab69f9
...
...
@@ -40,7 +40,7 @@ public:
boost
::
dynamic_pointer_cast
<
Mantid
::
DataObjects
::
WorkspaceSingleValue
>
(
ws
);
TS_ASSERT
(
ws
.
get
()
!=
0
);
TS_ASSERT
(
ws
.
get
()
!=
nullptr
);
// Test the data
TS_ASSERT_DELTA
(
single
->
x
(
0
)[
0
],
0.0
,
1e-08
);
...
...
@@ -82,7 +82,7 @@ public:
boost
::
dynamic_pointer_cast
<
Mantid
::
DataObjects
::
WorkspaceSingleValue
>
(
ws
);
TS_ASSERT
(
ws
.
get
()
!=
0
);
TS_ASSERT
(
ws
.
get
()
!=
nullptr
);
// Test the data
TS_ASSERT_DELTA
(
single
->
x
(
0
)[
0
],
0.0
,
1e-08
);
...
...
Framework/Algorithms/test/FindDeadDetectorsTest.h
View file @
02ab69f9
...
...
@@ -72,7 +72,7 @@ public:
work_in
->
getSpectrum
(
i
).
setSpectrumNo
(
i
);
Mantid
::
Geometry
::
Detector
*
det
=
new
Mantid
::
Geometry
::
Detector
(
""
,
i
,
NULL
);
new
Mantid
::
Geometry
::
Detector
(
""
,
i
,
nullptr
);
instr
->
add
(
det
);
instr
->
markAsDetector
(
det
);
work_in
->
getSpectrum
(
i
).
setDetectorID
(
i
);
...
...
Framework/Algorithms/test/FindDetectorsOutsideLimitsTest.h
View file @
02ab69f9
...
...
@@ -69,7 +69,7 @@ public:
work_in
->
getSpectrum
(
i
).
setSpectrumNo
(
i
);
Mantid
::
Geometry
::
Detector
*
det
=
new
Mantid
::
Geometry
::
Detector
(
""
,
i
,
NULL
);
new
Mantid
::
Geometry
::
Detector
(
""
,
i
,
nullptr
);
instr
->
add
(
det
);
instr
->
markAsDetector
(
det
);
work_in
->
getSpectrum
(
i
).
setDetectorID
(
i
);
...
...
Prev
1
2
3
4
5
…
33
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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