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
bfca7296
Commit
bfca7296
authored
May 22, 2019
by
Samuel Jones
Browse files
GCC8 fixes catch exception by refference, no const casting etc
parent
9df9fa71
Changes
601
Hide whitespace changes
Inline
Side-by-side
Framework/API/test/AlgorithmFactoryTest.h
View file @
bfca7296
...
...
@@ -126,7 +126,7 @@ public:
auto
&
algFactory
=
AlgorithmFactory
::
Instance
();
TS_ASSERT_THROWS
(
algFactory
.
highestVersion
(
"ToyAlgorithm"
),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
algFactory
.
subscribe
<
ToyAlgorithm
>
();
TS_ASSERT_EQUALS
(
1
,
algFactory
.
highestVersion
(
"ToyAlgorithm"
));
...
...
Framework/API/test/AlgorithmManagerTest.h
View file @
bfca7296
...
...
@@ -111,7 +111,7 @@ public:
void
testVersionFail
()
{
const
size_t
nalgs
=
AlgorithmFactory
::
Instance
().
getKeys
().
size
();
TS_ASSERT_THROWS
(
AlgorithmFactory
::
Instance
().
subscribe
<
AlgTestFail
>
(),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
// Size should be the same
TS_ASSERT_EQUALS
(
AlgorithmFactory
::
Instance
().
getKeys
().
size
(),
nalgs
);
}
...
...
@@ -124,9 +124,9 @@ public:
void
testInstance
()
{
TS_ASSERT_THROWS_NOTHING
(
AlgorithmManager
::
Instance
().
create
(
"AlgTest"
));
TS_ASSERT_THROWS
(
AlgorithmManager
::
Instance
().
create
(
"AlgTest"
,
3
),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS
(
AlgorithmManager
::
Instance
().
create
(
"aaaaaa"
),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
}
void
testClear
()
{
...
...
Framework/API/test/AlgorithmPropertyTest.h
View file @
bfca7296
...
...
@@ -142,7 +142,7 @@ public:
IAlgorithm_sptr
adder
=
Mantid
::
API
::
AlgorithmFactory
::
Instance
().
create
(
"SimpleSum"
,
1
);
TS_ASSERT_THROWS
(
testAlg
.
setProperty
(
"CalculateStep"
,
adder
),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
// Add the required property so now it should pass
adder
->
initialize
();
TS_ASSERT_THROWS_NOTHING
(
testAlg
.
setProperty
(
"CalculateStep"
,
adder
));
...
...
Framework/API/test/AlgorithmTest.h
View file @
bfca7296
...
...
@@ -293,7 +293,7 @@ public:
void
testExecute
()
{
ToyAlgorithm
myAlg
;
TS_ASSERT_THROWS
(
myAlg
.
execute
(),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
myAlg
.
execute
(),
const
std
::
runtime_error
&
);
TS_ASSERT
(
!
myAlg
.
isExecuted
());
TS_ASSERT_THROWS_NOTHING
(
myAlg
.
initialize
());
TS_ASSERT_THROWS_NOTHING
(
myAlg
.
execute
());
...
...
@@ -303,7 +303,7 @@ public:
void
testSetPropertyValue
()
{
TS_ASSERT_THROWS_NOTHING
(
alg
.
setPropertyValue
(
"prop1"
,
"val"
))
TS_ASSERT_THROWS
(
alg
.
setPropertyValue
(
"prop3"
,
"1"
),
Exception
::
NotFoundError
)
const
Exception
::
NotFoundError
&
)
}
void
testExistsProperty
()
{
...
...
@@ -315,7 +315,8 @@ public:
std
::
string
value
;
TS_ASSERT_THROWS_NOTHING
(
value
=
alg
.
getPropertyValue
(
"prop2"
))
TS_ASSERT
(
!
value
.
compare
(
"1"
))
TS_ASSERT_THROWS
(
alg
.
getPropertyValue
(
"ghjkgh"
),
Exception
::
NotFoundError
)
TS_ASSERT_THROWS
(
alg
.
getPropertyValue
(
"ghjkgh"
),
const
Exception
::
NotFoundError
&
)
}
void
testGetProperties
()
{
...
...
@@ -373,7 +374,7 @@ public:
void
test_From_String_With_Invalid_Input_Throws
()
{
const
std
::
string
input
=
"()"
;
TS_ASSERT_THROWS
(
Algorithm
::
fromString
(
input
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
Algorithm
::
fromString
(
input
),
const
std
::
runtime_error
&
);
}
void
test_Construction_Via_Valid_String_With_No_Properties
()
{
...
...
@@ -988,11 +989,11 @@ public:
TS_ASSERT_THROWS
(
indexAlg
.
getWorkspaceAndIndices
<
MatrixWorkspace
>
(
"InputWorkspace2"
),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS
(
(
indexAlg
.
setWorkspaceInputProperties
<
MatrixWorkspace
,
std
::
string
>
(
"InputWorkspace2"
,
"wksp"
,
IndexType
::
SpectrumNum
,
"1:5"
)),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
}
void
testIndexingAlgorithm_failExistingIndexProperty
()
{
...
...
@@ -1001,7 +1002,7 @@ public:
TS_ASSERT_THROWS
(
indexAlg
.
declareProperty
(
make_unique
<
WorkspaceProperty
<
MatrixWorkspace
>>
(
"InputWorkspace"
,
""
,
Direction
::
Input
)),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
}
private:
...
...
Framework/API/test/AnalysisDataServiceTest.h
View file @
bfca7296
...
...
@@ -79,7 +79,7 @@ public:
TS_ASSERT_THROWS_NOTHING
(
ads
.
retrieve
(
"Z"
));
ads
.
remove
(
"Z"
);
TS_ASSERT_THROWS
(
ads
.
retrieve
(
"z"
),
Exception
::
NotFoundError
);
TS_ASSERT_THROWS
(
ads
.
retrieve
(
"z"
),
const
Exception
::
NotFoundError
&
);
}
void
test_retrieveWorkspaces_with_empty_list_returns_empty_list
()
{
...
...
@@ -88,16 +88,17 @@ public:
}
void
test_retrieveWorkspaces_with_all_missing_items_throws_exception
()
{
TS_ASSERT_THROWS
(
ads
.
retrieveWorkspaces
({
"a"
}),
Exception
::
NotFoundError
);
TS_ASSERT_THROWS
(
ads
.
retrieveWorkspaces
({
"a"
}),
const
Exception
::
NotFoundError
&
);
TS_ASSERT_THROWS
(
ads
.
retrieveWorkspaces
({
"a"
,
"b"
}),
Exception
::
NotFoundError
);
const
Exception
::
NotFoundError
&
);
}
void
test_retrieveWorkspaces_with_some_missing_items_throws_exception
()
{
const
std
::
string
name
(
"test_some_missing_items"
);
addToADS
(
name
);
TS_ASSERT_THROWS
(
ads
.
retrieveWorkspaces
({
"a"
,
"b"
}),
Exception
::
NotFoundError
);
const
Exception
::
NotFoundError
&
);
ads
.
remove
(
name
);
}
...
...
@@ -148,7 +149,7 @@ public:
const
std
::
string
name
=
"SameName"
;
TS_ASSERT_THROWS_NOTHING
(
addToADS
(
name
));
// Adding again will throw
TS_ASSERT_THROWS
(
addToADS
(
name
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
addToADS
(
name
),
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS_NOTHING
(
ads
.
remove
(
name
));
}
...
...
@@ -173,7 +174,7 @@ public:
TS_ASSERT_EQUALS
(
ads
.
doesExist
(
name
),
true
);
std
::
string
banned
=
"Also.Contains.Illegal"
;
// This should not be allowed now.
TS_ASSERT_THROWS
(
addToADS
(
banned
),
std
::
invalid_argument
);
TS_ASSERT_THROWS
(
addToADS
(
banned
),
const
std
::
invalid_argument
&
);
// Clear up
ads
.
setIllegalCharacterList
(
""
);
}
...
...
@@ -182,7 +183,7 @@ public:
test_AddOrReplace_Does_Not_Throw_When_Adding_Object_That_Has_A_Name_That_Already_Exists
()
{
const
std
::
string
name
(
"MySpaceAddOrReplace"
);
TS_ASSERT_THROWS_NOTHING
(
addOrReplaceToADS
(
name
));
TS_ASSERT_THROWS
(
addToADS
(
name
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
addToADS
(
name
),
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS_NOTHING
(
addOrReplaceToADS
(
name
));
TS_ASSERT_THROWS_NOTHING
(
ads
.
remove
(
name
));
}
...
...
@@ -191,7 +192,7 @@ public:
const
std
::
string
name
(
"MySpace"
);
addToADS
(
name
);
TS_ASSERT_THROWS_NOTHING
(
ads
.
remove
(
name
));
TS_ASSERT_THROWS
(
ads
.
retrieve
(
name
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
ads
.
retrieve
(
name
),
const
std
::
runtime_error
&
);
// Remove should not throw but give a warning in the log file, changed by
// LCC 05/2008
TS_ASSERT_THROWS_NOTHING
(
ads
.
remove
(
"ttttt"
));
...
...
@@ -328,7 +329,7 @@ public:
group
->
addWorkspace
(
ws2
);
// ADS must have 2 workspaces
TS_ASSERT_EQUALS
(
ads
.
size
(),
2
);
TS_ASSERT_THROWS
(
ads
.
add
(
"Group"
,
group
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
ads
.
add
(
"Group"
,
group
),
const
std
::
runtime_error
&
);
// there must be 4 workspaces in the ADS
TS_ASSERT_EQUALS
(
ads
.
size
(),
4
);
TS_ASSERT
(
ads
.
doesExist
(
"Group"
));
...
...
@@ -400,9 +401,10 @@ public:
TS_ASSERT_EQUALS
(
ads
.
size
(),
4
);
// name doesn't exist
TS_ASSERT_THROWS
(
ads
.
deepRemoveGroup
(
"abc"
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
ads
.
deepRemoveGroup
(
"abc"
),
const
std
::
runtime_error
&
);
// workspace isn't a group
TS_ASSERT_THROWS
(
ads
.
deepRemoveGroup
(
"group_1"
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
ads
.
deepRemoveGroup
(
"group_1"
),
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS_NOTHING
(
ads
.
deepRemoveGroup
(
"group"
));
TS_ASSERT_EQUALS
(
ads
.
size
(),
1
);
...
...
@@ -423,11 +425,11 @@ public:
TS_ASSERT_EQUALS
(
group
->
size
(),
1
);
TS_ASSERT_THROWS
(
ads
.
removeFromGroup
(
"group"
,
"noworkspace"
),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS
(
ads
.
removeFromGroup
(
"nogroup"
,
"noworkspace"
),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS
(
ads
.
removeFromGroup
(
"nogroup"
,
"group_1"
),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
ads
.
clear
();
}
...
...
@@ -493,9 +495,10 @@ public:
auto
nullWS
=
MockWorkspace_sptr
();
// Shouldn't be able to add null pointers
TS_ASSERT_THROWS
(
ads
.
add
(
"null_workspace"
,
nullWS
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
ads
.
add
(
"null_workspace"
,
nullWS
),
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS
(
ads
.
addOrReplace
(
"null_workspace"
,
nullWS
),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
TS_ASSERT
(
!
ads
.
doesExist
(
"null_workspace"
));
}
...
...
@@ -519,10 +522,10 @@ private:
<<
" is not allowed but ADS did not throw."
;
if
(
replace
)
{
TSM_ASSERT_THROWS
(
errorMsg
.
str
(),
addToADS
(
name
.
str
()),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
}
else
{
TSM_ASSERT_THROWS
(
errorMsg
.
str
(),
addOrReplaceToADS
(
name
.
str
()),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
}
bool
stored
=
ads
.
doesExist
(
name
.
str
());
TS_ASSERT_EQUALS
(
stored
,
false
);
...
...
Framework/API/test/BinEdgeAxisTest.h
View file @
bfca7296
...
...
@@ -77,8 +77,8 @@ public:
ax1
.
setValue
(
i
,
static_cast
<
double
>
(
i
+
1
));
}
TS_ASSERT_THROWS
(
ax1
.
indexOfValue
(
0.9
),
std
::
out_of_range
);
// start
TS_ASSERT_THROWS
(
ax1
.
indexOfValue
(
10.1
),
std
::
out_of_range
);
// end
TS_ASSERT_THROWS
(
ax1
.
indexOfValue
(
0.9
),
const
std
::
out_of_range
&
);
// start
TS_ASSERT_THROWS
(
ax1
.
indexOfValue
(
10.1
),
const
std
::
out_of_range
&
);
// end
}
};
...
...
Framework/API/test/BoxControllerTest.h
View file @
bfca7296
...
...
@@ -122,7 +122,7 @@ public:
void
test_setSplitTopIntoThrowsForWrongDimension
()
{
BoxController
sc
(
1
);
TSM_ASSERT_THROWS
(
"Should throw for setting a wrong dimension"
,
sc
.
setSplitTopInto
(
1
,
10
),
std
::
invalid_argument
);
sc
.
setSplitTopInto
(
1
,
10
),
const
std
::
invalid_argument
&
);
}
void
doTest_numBoxes
(
BoxController
&
bc
,
size_t
expectedNumEntries
)
{
...
...
Framework/API/test/CompositeFunctionTest.h
View file @
bfca7296
...
...
@@ -528,12 +528,12 @@ public:
mfun
->
fix
(
10
);
// g2->fix(1); // This doesn't work
TS_ASSERT_THROWS
(
mfun
->
setActiveParameter
(
0
,
0
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
mfun
->
setActiveParameter
(
1
,
0
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
mfun
->
setActiveParameter
(
4
,
0
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
mfun
->
setActiveParameter
(
6
,
0
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
mfun
->
setActiveParameter
(
7
,
0
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
mfun
->
setActiveParameter
(
10
,
0
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
mfun
->
setActiveParameter
(
0
,
0
),
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS
(
mfun
->
setActiveParameter
(
1
,
0
),
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS
(
mfun
->
setActiveParameter
(
4
,
0
),
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS
(
mfun
->
setActiveParameter
(
6
,
0
),
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS
(
mfun
->
setActiveParameter
(
7
,
0
),
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS
(
mfun
->
setActiveParameter
(
10
,
0
),
const
std
::
runtime_error
&
);
mfun
->
setActiveParameter
(
2
,
100
);
mfun
->
setActiveParameter
(
3
,
101
);
...
...
Framework/API/test/DetectorInfoTest.h
View file @
bfca7296
...
...
@@ -72,7 +72,7 @@ public:
void
test_l1_no_instrument
()
{
TS_ASSERT_THROWS
(
m_workspaceNoInstrument
.
detectorInfo
().
l1
(),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
}
void
test_l1_no_instrument_call_once_regression
()
{
...
...
@@ -82,9 +82,9 @@ public:
// call to `l1` can be repeated. If the bug is reintroduced this test will
// not fail but FREEZE.
TS_ASSERT_THROWS
(
m_workspaceNoInstrument
.
detectorInfo
().
l1
(),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS
(
m_workspaceNoInstrument
.
detectorInfo
().
l1
(),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
}
void
test_isMonitor
()
{
...
...
@@ -141,8 +141,8 @@ public:
TS_ASSERT_DELTA
(
detectorInfo
.
twoTheta
(
1
),
0.0
,
1e-6
);
TS_ASSERT_DELTA
(
detectorInfo
.
twoTheta
(
2
),
0.0199973
,
1e-6
);
// Monitors
TS_ASSERT_THROWS
(
detectorInfo
.
twoTheta
(
3
),
std
::
logic_error
);
TS_ASSERT_THROWS
(
detectorInfo
.
twoTheta
(
4
),
std
::
logic_error
);
TS_ASSERT_THROWS
(
detectorInfo
.
twoTheta
(
3
),
const
std
::
logic_error
&
);
TS_ASSERT_THROWS
(
detectorInfo
.
twoTheta
(
4
),
const
std
::
logic_error
&
);
}
// Legacy test via the workspace method detectorTwoTheta(), which might be
...
...
@@ -160,8 +160,8 @@ public:
TS_ASSERT_DELTA
(
detectorInfo
.
signedTwoTheta
(
1
),
0.0
,
1e-6
);
TS_ASSERT_DELTA
(
detectorInfo
.
signedTwoTheta
(
2
),
0.0199973
,
1e-6
);
// Monitors
TS_ASSERT_THROWS
(
detectorInfo
.
signedTwoTheta
(
3
),
std
::
logic_error
);
TS_ASSERT_THROWS
(
detectorInfo
.
signedTwoTheta
(
4
),
std
::
logic_error
);
TS_ASSERT_THROWS
(
detectorInfo
.
signedTwoTheta
(
3
),
const
std
::
logic_error
&
);
TS_ASSERT_THROWS
(
detectorInfo
.
signedTwoTheta
(
4
),
const
std
::
logic_error
&
);
}
void
test_position
()
{
...
...
@@ -432,7 +432,7 @@ public:
auto
ws1
=
makeWorkspace
(
1
);
auto
ws2
=
makeWorkspace
(
2
);
TS_ASSERT_THROWS
(
ws2
->
mutableDetectorInfo
()
=
ws1
->
detectorInfo
(),
std
::
runtime_error
);
const
std
::
runtime_error
&
);
}
private:
...
...
Framework/API/test/ExperimentInfoTest.h
View file @
bfca7296
...
...
@@ -113,13 +113,14 @@ public:
void
test_Setting_A_New_Source_With_NULL_Ptr_Throws
()
{
ExperimentInfo
ws
;
TS_ASSERT_THROWS
(
ws
.
setModeratorModel
(
nullptr
),
std
::
invalid_argument
);
TS_ASSERT_THROWS
(
ws
.
setModeratorModel
(
nullptr
),
const
std
::
invalid_argument
&
);
}
void
test_Retrieving_Source_Properties_Before_Set_Throws
()
{
ExperimentInfo
ws
;
TS_ASSERT_THROWS
(
ws
.
moderatorModel
(),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
ws
.
moderatorModel
(),
const
std
::
runtime_error
&
);
}
void
test_Setting_New_Source_Description_With_Valid_Object_Does_Not_Throw
()
{
...
...
@@ -137,7 +138,8 @@ public:
void
test_Setting_A_New_Chopper_With_NULL_Ptr_Throws
()
{
ExperimentInfo_sptr
ws
=
createTestInfoWithChopperPoints
(
1
);
TS_ASSERT_THROWS
(
ws
->
setChopperModel
(
nullptr
),
std
::
invalid_argument
);
TS_ASSERT_THROWS
(
ws
->
setChopperModel
(
nullptr
),
const
std
::
invalid_argument
&
);
}
void
test_Setting_A_New_Chopper_To_Point_Lower_Point_Succeeds
()
{
...
...
@@ -151,13 +153,13 @@ public:
ExperimentInfo_sptr
ws
=
createTestInfoWithChopperPoints
(
1
);
TS_ASSERT_THROWS_NOTHING
(
ws
->
setChopperModel
(
new
FakeChopper
));
TS_ASSERT_THROWS
(
ws
->
chopperModel
(
1
),
std
::
invalid_argument
);
TS_ASSERT_THROWS
(
ws
->
chopperModel
(
1
),
const
std
::
invalid_argument
&
);
}
void
test_Getting_Chopper_At_Index_Greater_Than_Descriptions_Added_Throws
()
{
ExperimentInfo_sptr
ws
=
createTestInfoWithChopperPoints
(
1
);
TS_ASSERT_THROWS
(
ws
->
chopperModel
(
2
),
std
::
invalid_argument
);
TS_ASSERT_THROWS
(
ws
->
chopperModel
(
2
),
const
std
::
invalid_argument
&
);
}
void
test_GetSetSample
()
{
...
...
@@ -175,7 +177,7 @@ public:
void
test_GetLog_Throws_If_No_Log_Or_Instrument_Parameter_Exists
()
{
ExperimentInfo
expt
;
TS_ASSERT_THROWS
(
expt
.
getLog
(
"__NOTALOG__"
),
std
::
invalid_argument
);
TS_ASSERT_THROWS
(
expt
.
getLog
(
"__NOTALOG__"
),
const
std
::
invalid_argument
&
);
}
void
...
...
@@ -186,7 +188,7 @@ public:
addInstrumentWithParameter
(
expt
,
instPar
,
actualLogName
);
TS_ASSERT_THROWS
(
expt
.
getLog
(
instPar
),
Mantid
::
Kernel
::
Exception
::
NotFoundError
);
const
Mantid
::
Kernel
::
Exception
::
NotFoundError
&
);
}
void
...
...
@@ -222,7 +224,7 @@ public:
ExperimentInfo
expt
;
TS_ASSERT_THROWS
(
expt
.
getLogAsSingleValue
(
"__NOTALOG__"
),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
}
void
...
...
@@ -233,7 +235,7 @@ public:
addInstrumentWithParameter
(
expt
,
instPar
,
actualLogName
);
TS_ASSERT_THROWS
(
expt
.
getLogAsSingleValue
(
instPar
),
Mantid
::
Kernel
::
Exception
::
NotFoundError
);
const
Mantid
::
Kernel
::
Exception
::
NotFoundError
&
);
}
void
...
...
@@ -373,7 +375,7 @@ public:
ExperimentInfo_sptr
exptInfo
=
createTestInfoWithDirectEModeLog
();
TS_ASSERT_THROWS
(
exptInfo
->
getEFixed
(
1
),
Mantid
::
Kernel
::
Exception
::
NotFoundError
);
const
Mantid
::
Kernel
::
Exception
::
NotFoundError
&
);
}
void
test_correct_efixed_value_is_returned_for_direct_run
()
{
...
...
@@ -388,7 +390,7 @@ public:
ExperimentInfo_sptr
exptInfo
(
new
ExperimentInfo
);
Instrument_sptr
inst
=
addInstrumentWithIndirectEmodeParameter
(
exptInfo
);
TS_ASSERT_THROWS
(
exptInfo
->
getEFixed
(),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
exptInfo
->
getEFixed
(),
const
std
::
runtime_error
&
);
}
void
...
...
@@ -397,7 +399,7 @@ public:
addInstrumentWithIndirectEmodeParameter
(
exptInfo
);
IDetector_const_sptr
det
=
exptInfo
->
getInstrument
()
->
getDetector
(
3
);
TS_ASSERT_THROWS
(
exptInfo
->
getEFixed
(
det
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
exptInfo
->
getEFixed
(
det
),
const
std
::
runtime_error
&
);
}
void
...
...
@@ -466,7 +468,7 @@ public:
void
test_Getting_Group_For_Unknown_ID_Throws
()
{
ExperimentInfo
expt
;
TS_ASSERT_THROWS
(
expt
.
groupOfDetectorID
(
1
),
std
::
out_of_range
);
TS_ASSERT_THROWS
(
expt
.
groupOfDetectorID
(
1
),
const
std
::
out_of_range
&
);
}
void
...
...
Framework/API/test/ExpressionTest.h
View file @
bfca7296
...
...
@@ -50,8 +50,8 @@ public:
void
testMismatchedBrackets
()
{
Expression
expr
;
TS_ASSERT_THROWS
(
expr
.
parse
(
"b*(c+a"
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
expr
.
parse
(
"b*c+a)"
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
expr
.
parse
(
"b*(c+a"
),
const
std
::
runtime_error
&
);
TS_ASSERT_THROWS
(
expr
.
parse
(
"b*c+a)"
),
const
std
::
runtime_error
&
);
}
void
testFunctions
()
{
...
...
@@ -247,10 +247,10 @@ public:
TS_ASSERT_EQUALS
(
e12
[
1
].
name
(),
"%%"
);
Expression
e13
(
bin_ops1
,
un_ops1
);
TS_ASSERT_THROWS
(
e13
.
parse
(
"x==%%"
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
e13
.
parse
(
"x==%%"
),
const
std
::
runtime_error
&
);
Expression
e14
(
bin_ops1
,
un_ops1
);
TS_ASSERT_THROWS
(
e14
.
parse
(
"x==%% "
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
e14
.
parse
(
"x==%% "
),
const
std
::
runtime_error
&
);
std
::
vector
<
std
::
string
>
bin_ops2
{
"-"
,
"--"
};
std
::
unordered_set
<
std
::
string
>
un_ops2
{
"-"
,
"--"
};
...
...
@@ -324,7 +324,7 @@ public:
TS_ASSERT_EQUALS
(
expression
[
0
][
0
][
0
].
name
(),
"1"
);
Expression
e1
;
TS_ASSERT_THROWS
(
e1
.
parse
(
"---1"
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
e1
.
parse
(
"---1"
),
const
std
::
runtime_error
&
);
}
void
testRemoveBrackets
()
{
...
...
@@ -402,15 +402,15 @@ public:
void
testEndOnOperator
()
{
{
Expression
expression
;
TS_ASSERT_THROWS
(
expression
.
parse
(
"x+y+z + "
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
expression
.
parse
(
"x+y+z + "
),
const
std
::
runtime_error
&
);
}
{
Expression
expression
;
TS_ASSERT_THROWS
(
expression
.
parse
(
"x*z-"
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
expression
.
parse
(
"x*z-"
),
const
std
::
runtime_error
&
);
}
{
Expression
expression
;
TS_ASSERT_THROWS
(
expression
.
parse
(
"x*z="
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
expression
.
parse
(
"x*z="
),
const
std
::
runtime_error
&
);
}
{
Expression
expression
;
...
...
Framework/API/test/FermiChopperModelTest.h
View file @
bfca7296
...
...
@@ -22,7 +22,7 @@ public:
void
test_Default_Object_Throws_When_Computing_Pulse_Variance
()
{
using
namespace
Mantid
::
API
;
FermiChopperModel
chopper
;
TS_ASSERT_THROWS
(
chopper
.
pulseTimeVariance
(),
std
::
invalid_argument
);
TS_ASSERT_THROWS
(
chopper
.
pulseTimeVariance
(),
const
std
::
invalid_argument
&
);
}
void
test_Getters_Produce_Expected_Values_When_Set_By_Settings
()
{
...
...
@@ -67,7 +67,7 @@ public:
chopper
->
setAngularVelocityInHz
(
350
);
chopper
->
setChopperRadius
(
155.0
/
1000.
);
TS_ASSERT_THROWS
(
chopper
->
pulseTimeVariance
(),
std
::
invalid_argument
);
TS_ASSERT_THROWS
(
chopper
->
pulseTimeVariance
(),
const
std
::
invalid_argument
&
);
}
void
...
...
@@ -76,9 +76,9 @@ public:
FermiChopperModel_sptr
chopper
=
createTestChopperBySetters
();
TS_ASSERT_THROWS
(
chopper
->
sampleTimeDistribution
(
-
0.01
),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
TS_ASSERT_THROWS
(
chopper
->
sampleTimeDistribution
(
1.01
),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
}
void
...
...
Framework/API/test/FileBackedExperimentInfoTest.h
View file @
bfca7296
...
...
@@ -167,7 +167,7 @@ public:
void
test_getEFixed
()
{
auto
fileBacked
=
createTestObject
();
TS_ASSERT_THROWS
(
fileBacked
->
getEFixed
(
10100
),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
fileBacked
->
getEFixed
(
10100
),
const
std
::
runtime_error
&
);
}
void
test_setEFixed
()
{
...
...
@@ -183,7 +183,7 @@ public:
// Create the file backed experiment info, shouldn't be loaded yet
FileBackedExperimentInfo
fileBacked
(
m_filename
,
"/not/right/path"
);
TS_ASSERT_THROWS
(
fileBacked
.
toString
(),
std
::
runtime_error
);
TS_ASSERT_THROWS
(
fileBacked
.
toString
(),
const
std
::
runtime_error
&
);
}
private:
...
...
Framework/API/test/FileFinderTest.h
View file @
bfca7296
...
...
@@ -175,10 +175,10 @@ public:
TS_ASSERT_THROWS
(
fName
=
FileFinder
::
Instance
().
makeFileName
(
"ABCD"
,
instrument
),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
TS_ASSERT_THROWS
(
fName
=
FileFinder
::
Instance
().
makeFileName
(
"123456"
,
instrument
),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
fName
=
FileFinder
::
Instance
().
makeFileName
(
"0"
,
instrument
);
TS_ASSERT_EQUALS
(
fName
,
"HRP00000"
);
...
...
@@ -310,19 +310,19 @@ public:
std
::
vector
<
std
::
string
>
files
;
TS_ASSERT_THROWS
(
files
=
FileFinder
::
Instance
().
findRuns
(
"MUSR15189-n15193"
),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
TS_ASSERT_THROWS
(
files
=
FileFinder
::
Instance
().
findRuns
(
"MUSR15189n-15193"
),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
TS_ASSERT_THROWS
(
files
=
FileFinder
::
Instance
().
findRuns
(
"MUSR15189-15193n"
),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
TS_ASSERT_THROWS
(
files
=
FileFinder
::
Instance
().
findRuns
(
"MUSR15189-151n93"
),
std
::
invalid_argument
);
const
std
::
invalid_argument
&
);
TS_ASSERT_THROWS
(
files
=
FileFinder
::
Instance
().
findRuns
(
"MUSR15n189-151n93"
),
Exception
::
NotFoundError
);
const
Exception
::
NotFoundError
&
);
TS_ASSERT_THROWS_NOTHING
(
files
=
FileFinder
::
Instance
().
findRuns
(
"MUSR15189-15193"
));
TS_ASSERT_EQUALS
(
files
.
size
(),
5
);
...
...
@@ -622,7 +622,7 @@ public:
std
::
string
accidentalEndOfRange
=
"99999"
;
range
<<
startOfRange
<<
"-"
<<
accidentalEndOfRange
;
TS_ASSERT_THROWS
(
files
=
fileFinder
.
findRuns
(
range
.
str
().
c_str
()),
Mantid
::
Kernel
::
Exception
::
NotFoundError
);
const
Mantid
::
Kernel
::
Exception
::
NotFoundError
&
);
fileFinder
.
setCaseSensitive
(
startingCaseOption
);
}
...
...
Framework/API/test/FrameworkManagerTest.h
View file @
bfca7296
...
...
@@ -71,9 +71,9 @@ public:
FrameworkManager
::
Instance
().
createAlgorithm
(
"ToyAlgorithm2"
))
TS_ASSERT_THROWS
(
FrameworkManager
::
Instance
().
createAlgorithm
(
"ToyAlgorithm2"
,
""
,
3
),
std
::
runtime_error
)
const
std
::
runtime_error
&
)
TS_ASSERT_THROWS
(
FrameworkManager
::
Instance
().
createAlgorithm
(
"aaaaaa"
),
std
::
runtime_error
)
const
std
::
runtime_error
&
)
}
void
testcreateAlgorithmWithProps
()
{
...
...
@@ -97,7 +97,7 @@ public:
void
testGetWorkspace
()
{
TS_ASSERT_THROWS
(
FrameworkManager
::
Instance
().
getWorkspace
(
"wrongname"
),
std
::
runtime_error
)
const
std
::
runtime_error
&
)
}
};
...
...
Framework/API/test/FunctionAttributeTest.h
View file @
bfca7296
...
...
@@ -54,7 +54,7 @@ public: