ECCE @ EIC Software
 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 <climits>
12 
17 
18 namespace Acts {
19 
20 namespace Test {
21 
23 BOOST_AUTO_TEST_CASE(HomogeneousVolumeMaterial_construction_test) {
24  // construct the material properties from arguments
25  Material mat(1., 2., 3., 4., 5.);
26 
27  // Constructor from arguments
29  // Copy constructor
30  HomogeneousVolumeMaterial hsmCopy(hsm);
31  // Test equality of the copy
32  BOOST_CHECK_EQUAL(hsm, hsmCopy);
33  // Copy move constructor
34  HomogeneousVolumeMaterial hsmCopyMoved(std::move(hsmCopy));
35  // Test equality of the copy
36  BOOST_CHECK_EQUAL(hsm, hsmCopyMoved);
37  // Assignment constructor
38  HomogeneousVolumeMaterial hsmAssigned = hsm;
39  // Test equality of the asignment
40  BOOST_CHECK_EQUAL(hsm, hsmAssigned);
41  // Assignment move constructor
42  HomogeneousVolumeMaterial hsmAssignedMoved(std::move(hsmAssigned));
43  // Test equality of the copy
44  BOOST_CHECK_EQUAL(hsm, hsmAssignedMoved);
45 }
46 
47 // Test the Access
48 BOOST_AUTO_TEST_CASE(HomogeneousVolumeMaterial_access_test) {
49  // construct the material properties from arguments
50  Material mat(1., 2., 3., 4., 5.);
51 
52  // Constructor from arguments
54 
55  auto mat3d = hsm.material(Vector3D{0., 0., 0.});
56 
57  // Test equality of the copy
58  BOOST_CHECK_EQUAL(mat, mat3d);
59 }
60 } // namespace Test
61 } // namespace Acts