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
280939b8
Commit
280939b8
authored
Aug 17, 2018
by
Gigg, Martyn Anthony
Committed by
Martyn Gigg
Aug 19, 2018
Browse files
Fix memory leaks reported from GeometryTest
parent
d23fdc28
Changes
3
Hide whitespace changes
Inline
Side-by-side
Framework/Geometry/test/CSGObjectTest.h
View file @
280939b8
...
...
@@ -145,8 +145,9 @@ public:
auto
testMaterial
=
Material
(
"arm"
,
PhysicalConstants
::
getNeutronAtom
(
13
),
45.0
);
auto
geom_obj
=
createUnitCube
();
TS_ASSERT_THROWS_NOTHING
(
geom_obj
->
cloneWithMaterial
(
testMaterial
));
auto
cloned_obj
=
geom_obj
->
cloneWithMaterial
(
testMaterial
);
std
::
unique_ptr
<
IObject
>
cloned_obj
;
TS_ASSERT_THROWS_NOTHING
(
cloned_obj
.
reset
(
geom_obj
->
cloneWithMaterial
(
testMaterial
)));
TSM_ASSERT_DELTA
(
"Expected a number density of 45"
,
45.0
,
cloned_obj
->
material
().
numberDensity
(),
1e-12
);
}
...
...
@@ -934,7 +935,7 @@ public:
TS_ASSERT_DELTA
(
cuboid
->
volume
(),
cylinderVolume
,
1e-6
)
}
void
testMonteCarloVolume
()
{
void
x
testMonteCarloVolume
()
{
// We use a cuboid with spherical void here.
using
namespace
Poco
::
XML
;
const
double
width
=
71.99
;
...
...
Framework/Geometry/test/IndexingUtilsTest.h
View file @
280939b8
...
...
@@ -312,8 +312,8 @@ public:
}
void
test_GetMagFFT
()
{
#define
N_FFT_STEPS 256
#define
HALF_FFT_STEPS 128
constexpr
size_t
N_FFT_STEPS
=
256
;
constexpr
size_t
HALF_FFT_STEPS
=
128
;
double
projections
[
N_FFT_STEPS
];
double
magnitude_fft
[
HALF_FFT_STEPS
];
...
...
Framework/Geometry/test/MeshObjectTest.h
View file @
280939b8
...
...
@@ -224,7 +224,9 @@ public:
void
testClone
()
{
auto
geom_obj
=
createOctahedron
();
TS_ASSERT_THROWS_NOTHING
(
geom_obj
->
clone
());
std
::
unique_ptr
<
IObject
>
cloned
;
TS_ASSERT_THROWS_NOTHING
(
cloned
.
reset
(
geom_obj
->
clone
()));
TS_ASSERT
(
cloned
);
}
void
testTooManyVertices
()
{
...
...
@@ -268,8 +270,9 @@ public:
auto
testMaterial
=
Material
(
"arm"
,
PhysicalConstants
::
getNeutronAtom
(
13
),
45.0
);
auto
geom_obj
=
createOctahedron
();
TS_ASSERT_THROWS_NOTHING
(
geom_obj
->
cloneWithMaterial
(
testMaterial
));
auto
cloned_obj
=
geom_obj
->
cloneWithMaterial
(
testMaterial
);
std
::
unique_ptr
<
IObject
>
cloned_obj
;
TS_ASSERT_THROWS_NOTHING
(
cloned_obj
.
reset
(
geom_obj
->
cloneWithMaterial
(
testMaterial
)));
TSM_ASSERT_DELTA
(
"Expected a number density of 45"
,
45.0
,
cloned_obj
->
material
().
numberDensity
(),
1e-12
);
}
...
...
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