diff --git a/tests/framework/testGeometry.cpp b/tests/framework/testGeometry.cpp index 7d39abccb0db3e54506b24b34525a1f8e599d42a..31e96c319741975b523bfb43482ce1de4d82b195 100644 --- a/tests/framework/testGeometry.cpp +++ b/tests/framework/testGeometry.cpp @@ -101,6 +101,10 @@ TEST_CASE("Geometry CoordinateSystems") { // vector norm invariant under rotation CHECK(v1.getComponents(rotatedCS).getNorm().magnitude() == Approx(v1.getComponents(rootCS).getNorm().magnitude())); + + // this is not possible + QuantityVector<length_d> const axis_invalid{0_m, 0_m, 0_km}; + CHECK_THROWS(make_rotation(rootCS, axis_invalid, angle)); } SECTION("multiple rotations") { @@ -201,6 +205,10 @@ TEST_CASE("Geometry CoordinateSystem-hirarchy") { CoordinateSystemPtr root = get_root_CoordinateSystem(); Point const p1(root, {0_m, 0_m, 0_m}); // the origin of the root CS + CHECK(p1.getX(root) == 0_m); + CHECK(p1.getY(root) == 0_m); + CHECK(p1.getZ(root) == 0_m); + // root -> cs2 CoordinateSystemPtr cs2 = make_translation(root, {0_m, 0_m, 1_m}); Point const p2(cs2, {0_m, 0_m, -1_m}); @@ -280,6 +288,8 @@ TEST_CASE("Geometry Trajectories") { .getNorm() .magnitude() == Approx(0).margin(absMargin)); + CHECK((line.getTimeFromArclength(10_m) / (10_m / v0.getNorm()) == Approx(1))); + auto const t = 1_s; StraightTrajectory base(line, t); CHECK(line.getPosition(t).getCoordinates() == base.getPosition(1.).getCoordinates()); @@ -348,8 +358,6 @@ TEST_CASE("Distance between points") { CHECK(distance(p5, p6) / 1_m == Approx(1)); } -TEST_CASE("Geometry Tree") {} - TEST_CASE("Path") { // define a known CS CoordinateSystemPtr root = get_root_CoordinateSystem(); diff --git a/tests/modules/testTracking.cpp b/tests/modules/testTracking.cpp index bbd94cb347e35adfec4b2eada8199258912b6d43..243cbffa7df9bc47b2486b048be356381587d6db 100644 --- a/tests/modules/testTracking.cpp +++ b/tests/modules/testTracking.cpp @@ -186,6 +186,7 @@ TEMPLATE_TEST_CASE("Tracking", "tracking", tracking_leapfrog_curved::Tracking, particle.setNode(nextVol); particle.setPosition(traj.getPosition(1)); particle.setMomentum(traj.getDirection(1) * particle.getMomentum().getNorm()); + SpeedType const speed_0 = particle.getVelocity().getNorm(); if (outer) { // now we know we are in target volume, depending on "outer" CHECK(traj.getLength(1) / 1_m == Approx(0).margin(1e-3)); @@ -211,6 +212,7 @@ TEMPLATE_TEST_CASE("Tracking", "tracking", tracking_leapfrog_curved::Tracking, particle.getMomentum().getNorm(), particle.getVelocity().getNorm(), traj2.getLength(1), traj2.getLength(1) / particle.getVelocity().getNorm()); + CHECK(speed_0 / traj2.getVelocity(1).getNorm() == Approx(1)); } CHECK_FALSE(hit_2nd_behind); // this can never happen // the next line is maybe an actual BUG: this should be investigated and eventually