Back to home page

EIC code displayed by LXR

 
 

    


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

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/tools/output_test_stream.hpp>
0010 #include <boost/test/unit_test.hpp>
0011 
0012 #include "Acts/Definitions/Algebra.hpp"
0013 #include "Acts/Surfaces/BoundaryTolerance.hpp"
0014 #include "Acts/Surfaces/InfiniteBounds.hpp"
0015 #include "Acts/Surfaces/SurfaceBounds.hpp"
0016 
0017 namespace Acts::Test {
0018 
0019 BOOST_AUTO_TEST_SUITE(Surfaces)
0020 /// Unit test for creating compliant/non-compliant InfiniteBounds object
0021 BOOST_AUTO_TEST_CASE(InfiniteBoundsConstruction) {
0022   InfiniteBounds u;
0023   BOOST_CHECK_EQUAL(u.type(), SurfaceBounds::eBoundless);
0024   // InfiniteBounds s(1);  // would act as std::size_t cast to InfiniteBounds
0025   // InfiniteBounds t(s);
0026   InfiniteBounds v(u);  // implicit
0027   BOOST_CHECK_EQUAL(v.type(), SurfaceBounds::eBoundless);
0028 }
0029 /// Unit tests for InfiniteBounds properties
0030 BOOST_AUTO_TEST_CASE(InfiniteBoundsProperties) {
0031   InfiniteBounds infiniteBoundsObject;
0032   /// Test for type()
0033   BOOST_CHECK_EQUAL(infiniteBoundsObject.type(), SurfaceBounds::eBoundless);
0034 
0035   /// Test for inside()
0036   const Vector2 anyVector{0., 1.};
0037   const BoundaryTolerance anyTolerance = BoundaryTolerance::None();
0038   BOOST_CHECK(infiniteBoundsObject.inside(anyVector, anyTolerance));
0039 
0040   /// Test for dump
0041   boost::test_tools::output_test_stream dumpOutput;
0042   infiniteBoundsObject.toStream(dumpOutput);
0043   BOOST_CHECK(
0044       dumpOutput.is_equal("Acts::InfiniteBounds ... boundless surface\n"));
0045 }
0046 
0047 BOOST_AUTO_TEST_SUITE_END()
0048 
0049 }  // namespace Acts::Test