Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-01 07:55:01

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include <boost/test/unit_test.hpp>
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Material/HomogeneousVolumeMaterial.hpp"
0013 #include "Acts/Material/Material.hpp"
0014 
0015 #include <utility>
0016 
0017 using namespace Acts;
0018 
0019 namespace AcsTests {
0020 
0021 BOOST_AUTO_TEST_SUITE(MaterialSuite)
0022 
0023 /// Test the constructors
0024 BOOST_AUTO_TEST_CASE(HomogeneousVolumeMaterial_construction_test) {
0025   // construct the material properties from arguments
0026   Material mat = Material::fromMolarDensity(1., 2., 3., 4., 5.);
0027 
0028   // Constructor from arguments
0029   HomogeneousVolumeMaterial hsm(mat);
0030   // Copy constructor
0031   HomogeneousVolumeMaterial hsmCopy(hsm);
0032   // Test equality of the copy
0033   BOOST_CHECK_EQUAL(hsm, hsmCopy);
0034   // Copy move constructor
0035   HomogeneousVolumeMaterial hsmCopyMoved(std::move(hsmCopy));
0036   // Test equality of the copy
0037   BOOST_CHECK_EQUAL(hsm, hsmCopyMoved);
0038   // Assignment constructor
0039   HomogeneousVolumeMaterial hsmAssigned = hsm;
0040   // Test equality of the assignment
0041   BOOST_CHECK_EQUAL(hsm, hsmAssigned);
0042   // Assignment move constructor
0043   HomogeneousVolumeMaterial hsmAssignedMoved(std::move(hsmAssigned));
0044   // Test equality of the copy
0045   BOOST_CHECK_EQUAL(hsm, hsmAssignedMoved);
0046 }
0047 
0048 // Test the Access
0049 BOOST_AUTO_TEST_CASE(HomogeneousVolumeMaterial_access_test) {
0050   // construct the material properties from arguments
0051   Material mat = Material::fromMolarDensity(1., 2., 3., 4., 5.);
0052 
0053   // Constructor from arguments
0054   HomogeneousVolumeMaterial hsm(mat);
0055 
0056   auto mat3d = hsm.material(Vector3{0., 0., 0.});
0057 
0058   // Test equality of the copy
0059   BOOST_CHECK_EQUAL(mat, mat3d);
0060 }
0061 
0062 BOOST_AUTO_TEST_SUITE_END()
0063 
0064 }  // namespace AcsTests