ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InfiniteBoundsTests.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file InfiniteBoundsTests.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/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
12 
15 
16 namespace Acts {
17 
18 namespace Test {
19 BOOST_AUTO_TEST_SUITE(Surfaces)
21 BOOST_AUTO_TEST_CASE(InfiniteBoundsConstruction) {
23  BOOST_CHECK_EQUAL(u.type(), SurfaceBounds::eBoundless);
24  // InfiniteBounds s(1); // would act as size_t cast to InfiniteBounds
25  // InfiniteBounds t(s);
26  InfiniteBounds v(u); // implicit
27  BOOST_CHECK_EQUAL(v.type(), SurfaceBounds::eBoundless);
28 }
30 BOOST_AUTO_TEST_CASE(InfiniteBoundsProperties) {
31  InfiniteBounds infiniteBoundsObject;
33  BOOST_CHECK_EQUAL(infiniteBoundsObject.type(), SurfaceBounds::eBoundless);
34 
36  const Vector2D anyVector{0., 1.};
37  const BoundaryCheck anyBoundaryCheck(true);
38  BOOST_CHECK(infiniteBoundsObject.inside(anyVector, anyBoundaryCheck));
39 
41  BOOST_TEST_MESSAGE("Perhaps the following should be inf?");
42  BOOST_CHECK_EQUAL(infiniteBoundsObject.distanceToBoundary(anyVector), 0.);
43 
45  boost::test_tools::output_test_stream dumpOuput;
46  infiniteBoundsObject.toStream(dumpOuput);
47  BOOST_CHECK(
48  dumpOuput.is_equal("Acts::InfiniteBounds ... boundless surface\n"));
49 }
50 
51 BOOST_AUTO_TEST_SUITE_END()
52 
53 } // namespace Test
54 
55 } // namespace Acts