Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
HomogeneousVolumeMaterialTests.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file HomogeneousVolumeMaterialTests.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2017-2018 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#include <boost/test/unit_test.hpp>
10
11
#include "
Acts/Definitions/Algebra.hpp
"
12
#include "
Acts/Material/HomogeneousVolumeMaterial.hpp
"
13
#include "
Acts/Material/Material.hpp
"
14
15
#include <utility>
16
17
namespace
Acts {
18
19
namespace
Test {
20
22
BOOST_AUTO_TEST_CASE
(HomogeneousVolumeMaterial_construction_test) {
23
// construct the material properties from arguments
24
Material
mat =
Material::fromMolarDensity
(1., 2., 3., 4., 5.);
25
26
// Constructor from arguments
27
HomogeneousVolumeMaterial
hsm(mat);
28
// Copy constructor
29
HomogeneousVolumeMaterial
hsmCopy(hsm);
30
// Test equality of the copy
31
BOOST_CHECK_EQUAL(hsm, hsmCopy);
32
// Copy move constructor
33
HomogeneousVolumeMaterial
hsmCopyMoved(
std::move
(hsmCopy));
34
// Test equality of the copy
35
BOOST_CHECK_EQUAL(hsm, hsmCopyMoved);
36
// Assignment constructor
37
HomogeneousVolumeMaterial
hsmAssigned = hsm;
38
// Test equality of the assignment
39
BOOST_CHECK_EQUAL(hsm, hsmAssigned);
40
// Assignment move constructor
41
HomogeneousVolumeMaterial
hsmAssignedMoved(
std::move
(hsmAssigned));
42
// Test equality of the copy
43
BOOST_CHECK_EQUAL(hsm, hsmAssignedMoved);
44
}
45
46
// Test the Access
47
BOOST_AUTO_TEST_CASE
(HomogeneousVolumeMaterial_access_test) {
48
// construct the material properties from arguments
49
Material
mat =
Material::fromMolarDensity
(1., 2., 3., 4., 5.);
50
51
// Constructor from arguments
52
HomogeneousVolumeMaterial
hsm(mat);
53
54
auto
mat3d = hsm.
material
(
Vector3
{0., 0., 0.});
55
56
// Test equality of the copy
57
BOOST_CHECK_EQUAL(mat, mat3d);
58
}
59
}
// namespace Test
60
}
// namespace Acts
acts
blob
sPHENIX
Tests
UnitTests
Core
Material
HomogeneousVolumeMaterialTests.cpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:43
using
1.8.2 with
sPHENIX GitHub integration