From 2f6c71363ea57ffc932425b350a28c4c33bc612b Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Fri, 25 Oct 2024 14:13:35 +0200 Subject: [PATCH] enable extra tests --- .../Core/Surfaces/ConeSurfaceTests.cpp | 25 ++++++++--------- .../Core/Surfaces/PlaneSurfaceTests.cpp | 27 ++++++++++--------- .../UnitTests/Core/Surfaces/SurfaceTests.cpp | 9 +------ 3 files changed, 28 insertions(+), 33 deletions(-) diff --git a/Tests/UnitTests/Core/Surfaces/ConeSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/ConeSurfaceTests.cpp index db66651f17c..5d0102653b2 100644 --- a/Tests/UnitTests/Core/Surfaces/ConeSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/ConeSurfaceTests.cpp @@ -7,6 +7,7 @@ // file, You can obtain one at https://mozilla.org/MPL/2.0/. #include +#include #include #include "Acts/Definitions/Algebra.hpp" @@ -171,18 +172,18 @@ BOOST_AUTO_TEST_CASE(ConeSurfaceProperties) { std::string("Acts::ConeSurface")); /// Test dump - // TODO 2017-04-12 msmk: check how to correctly check output - // boost::test_tools::output_test_stream dumpOuput; - // coneSurfaceObject.toStream(dumpOuput); - // BOOST_CHECK(dumpOuput.is_equal( - // "Acts::ConeSurface\n" - // " Center position (x, y, z) = (0.0000, 1.0000, 2.0000)\n" - // " Rotation: colX = (1.000000, 0.000000, 0.000000)\n" - // " colY = (0.000000, 1.000000, 0.000000)\n" - // " colZ = (0.000000, 0.000000, 1.000000)\n" - // " Bounds : Acts::ConeBounds: (tanAlpha, minZ, maxZ, averagePhi, - // halfPhiSector) = (0.4142136, 0.0000000, inf, 0.0000000, - // 3.1415927)")); + boost::test_tools::output_test_stream dumpOutput; + dumpOutput << coneSurfaceObject->toStream(tgContext); + BOOST_CHECK(dumpOutput.is_equal( + "Acts::ConeSurface\n" + " Center position (x, y, z) = (0.0000, 1.0000, 2.0000)\n" + " Rotation: colX = (1.000000, 0.000000, 0.000000)\n" + " colY = (0.000000, 1.000000, 0.000000)\n" + " colZ = (0.000000, 0.000000, 1.000000)\n" + " Bounds : Acts::ConeBounds: (tanAlpha, minZ, maxZ, halfPhiSector, " + "averagePhi) = (0.4142136, 0.0000000, inf, 3.1415927, 0.0000000)" + + )); } BOOST_AUTO_TEST_CASE(ConeSurfaceEqualityOperators) { diff --git a/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp index 3fb22584dbc..99d0569b9d2 100644 --- a/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp @@ -6,7 +6,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -// #include +#include #include #include "Acts/Definitions/Algebra.hpp" @@ -189,18 +189,19 @@ BOOST_AUTO_TEST_CASE(PlaneSurfaceProperties) { std::string("Acts::PlaneSurface")); /// Test dump - // TODO 2017-04-12 msmk: check how to correctly check output - // boost::test_tools::output_test_stream dumpOuput; - // planeSurfaceObject.toStream(dumpOuput); - // BOOST_CHECK(dumpOuput.is_equal( - // "Acts::PlaneSurface\n" - // " Center position (x, y, z) = (0.0000, 1.0000, 2.0000)\n" - // " Rotation: colX = (1.000000, 0.000000, 0.000000)\n" - // " colY = (0.000000, 1.000000, 0.000000)\n" - // " colZ = (0.000000, 0.000000, 1.000000)\n" - // " Bounds : Acts::ConeBounds: (tanAlpha, minZ, maxZ, averagePhi, - // halfPhiSector) = (0.4142136, 0.0000000, inf, 0.0000000, - // 3.1415927)")); + boost::test_tools::output_test_stream dumpOutput; + dumpOutput << planeSurfaceObject->toStream(tgContext); + BOOST_CHECK(dumpOutput.is_equal( + "Acts::PlaneSurface\n" + " Center position (x, y, z) = (0.0000, 1.0000, 2.0000)\n" + " Rotation: colX = (1.000000, 0.000000, 0.000000)\n" + " colY = (0.000000, 1.000000, 0.000000)\n" + " colZ = (0.000000, 0.000000, 1.000000)\n" + " Bounds : Acts::RectangleBounds: (hlX, hlY) = (3.0000000, " + "4.0000000)\n" + "(lower left, upper right):\n" + "-3.0000000 -4.0000000\n" + "3.0000000 4.0000000")); } BOOST_AUTO_TEST_CASE(PlaneSurfaceEqualityOperators) { diff --git a/Tests/UnitTests/Core/Surfaces/SurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/SurfaceTests.cpp index 1fed5c63364..e4c214b53d8 100644 --- a/Tests/UnitTests/Core/Surfaces/SurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/SurfaceTests.cpp @@ -167,16 +167,9 @@ BOOST_AUTO_TEST_CASE(EqualityOperators) { surface5.assignSurfaceMaterial(pMaterial); // 5 has non-null surface material BOOST_CHECK(surface1 == surface2); - - // remove test for the moment, surfaces do not have a concept of thickness - // (only detector elements have) - // only thickness is different here - // BOOST_CHECK_NE(surface1, surface3); - + BOOST_CHECK(surface1 != surface3); BOOST_CHECK(surface1 != surface4); - BOOST_CHECK(surface1 != surface5); - BOOST_CHECK(surface1 != *planeSurface); // Test the getSharedPtr