Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:11:28

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2017-2018 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #include <boost/test/data/test_case.hpp>
0010 #include <boost/test/tools/output_test_stream.hpp>
0011 #include <boost/test/unit_test.hpp>
0012 
0013 #include "Acts/Definitions/Algebra.hpp"
0014 #include "Acts/Surfaces/BoundaryCheck.hpp"
0015 #include "Acts/Surfaces/InfiniteBounds.hpp"
0016 #include "Acts/Surfaces/SurfaceBounds.hpp"
0017 
0018 namespace Acts {
0019 
0020 namespace Test {
0021 BOOST_AUTO_TEST_SUITE(Surfaces)
0022 /// Unit test for creating compliant/non-compliant InfiniteBounds object
0023 BOOST_AUTO_TEST_CASE(InfiniteBoundsConstruction) {
0024   InfiniteBounds u;
0025   BOOST_CHECK_EQUAL(u.type(), SurfaceBounds::eBoundless);
0026   // InfiniteBounds s(1);  // would act as std::size_t cast to InfiniteBounds
0027   // InfiniteBounds t(s);
0028   InfiniteBounds v(u);  // implicit
0029   BOOST_CHECK_EQUAL(v.type(), SurfaceBounds::eBoundless);
0030 }
0031 /// Unit tests for InfiniteBounds properties
0032 BOOST_AUTO_TEST_CASE(InfiniteBoundsProperties) {
0033   InfiniteBounds infiniteBoundsObject;
0034   /// test for type()
0035   BOOST_CHECK_EQUAL(infiniteBoundsObject.type(), SurfaceBounds::eBoundless);
0036 
0037   /// test for inside()
0038   const Vector2 anyVector{0., 1.};
0039   const BoundaryCheck anyBoundaryCheck(true);
0040   BOOST_CHECK(infiniteBoundsObject.inside(anyVector, anyBoundaryCheck));
0041 
0042   /// test for dump
0043   boost::test_tools::output_test_stream dumpOuput;
0044   infiniteBoundsObject.toStream(dumpOuput);
0045   BOOST_CHECK(
0046       dumpOuput.is_equal("Acts::InfiniteBounds ... boundless surface\n"));
0047 }
0048 
0049 BOOST_AUTO_TEST_SUITE_END()
0050 
0051 }  // namespace Test
0052 
0053 }  // namespace Acts