Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:12:43

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 namespace Acts::Test {
0018 
0019 /// Test the constructors
0020 BOOST_AUTO_TEST_CASE(HomogeneousVolumeMaterial_construction_test) {
0021   // construct the material properties from arguments
0022   Material mat = Material::fromMolarDensity(1., 2., 3., 4., 5.);
0023 
0024   // Constructor from arguments
0025   HomogeneousVolumeMaterial hsm(mat);
0026   // Copy constructor
0027   HomogeneousVolumeMaterial hsmCopy(hsm);
0028   // Test equality of the copy
0029   BOOST_CHECK_EQUAL(hsm, hsmCopy);
0030   // Copy move constructor
0031   HomogeneousVolumeMaterial hsmCopyMoved(std::move(hsmCopy));
0032   // Test equality of the copy
0033   BOOST_CHECK_EQUAL(hsm, hsmCopyMoved);
0034   // Assignment constructor
0035   HomogeneousVolumeMaterial hsmAssigned = hsm;
0036   // Test equality of the assignment
0037   BOOST_CHECK_EQUAL(hsm, hsmAssigned);
0038   // Assignment move constructor
0039   HomogeneousVolumeMaterial hsmAssignedMoved(std::move(hsmAssigned));
0040   // Test equality of the copy
0041   BOOST_CHECK_EQUAL(hsm, hsmAssignedMoved);
0042 }
0043 
0044 // Test the Access
0045 BOOST_AUTO_TEST_CASE(HomogeneousVolumeMaterial_access_test) {
0046   // construct the material properties from arguments
0047   Material mat = Material::fromMolarDensity(1., 2., 3., 4., 5.);
0048 
0049   // Constructor from arguments
0050   HomogeneousVolumeMaterial hsm(mat);
0051 
0052   auto mat3d = hsm.material(Vector3{0., 0., 0.});
0053 
0054   // Test equality of the copy
0055   BOOST_CHECK_EQUAL(mat, mat3d);
0056 }
0057 }  // namespace Acts::Test