From 763a34ea8c411904de381cea83d2d685e762ef80 Mon Sep 17 00:00:00 2001 From: Cory Date: Thu, 19 Oct 2023 13:16:18 +0200 Subject: [PATCH] Use close_to --- src/test_suite.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test_suite.cpp b/src/test_suite.cpp index cd422c5..fa61665 100644 --- a/src/test_suite.cpp +++ b/src/test_suite.cpp @@ -10,13 +10,13 @@ * @bug No known bugs * */ -#include "PenningTrap.hpp" -#include "utils.hpp" - #include #include #include +#include "PenningTrap.hpp" +#include "utils.hpp" + class PenningTrapTest { public: static void test_external_E_field() @@ -52,7 +52,7 @@ public: msg << "Testing the external E field at (" << std::setprecision(2) << v(0) << "," << v(1) << "," << v(2) << ")."; - ASSERT(arma_vector_close_to(result, tests.at(i).second), msg.str()); + ASSERT(close_to(result, tests.at(i).second), msg.str()); } } @@ -63,7 +63,7 @@ public: PenningTrap trap; arma::vec expected{0., 0., T}; arma::vec result = trap.external_B_field(arma::vec{0., 0., 0.}); - ASSERT(arma_vector_close_to(expected, result), + ASSERT(close_to(expected, result), "Testing the external B field at (0,0,0)"); } @@ -80,14 +80,14 @@ public: // Test p0 and p1 arma::vec expected{-1., 0., 0.}; arma::vec result = trap.force_on_particle(0, 1); - ASSERT(arma_vector_close_to(expected, result), + ASSERT(close_to(expected, result), "Testing the force on a particle at (0,0,0) from a " "particle at (1,0,0)."); // Test p0 and p2 expected = arma::vec{0, -.024, -.032}; result = trap.force_on_particle(0, 2); - ASSERT(arma_vector_close_to(expected, result), + ASSERT(close_to(expected, result), "Testing the force on a particle at (0,0,0) from a " "particle at (0,3,4)."); } @@ -100,7 +100,7 @@ public: arma::vec expected{395.58954878, -270.15871624, -57.89115348}; arma::vec result = trap.total_force_external(0); - ASSERT(arma_vector_close_to(expected, result), + ASSERT(close_to(expected, result), "Testing the total external force on a particle at " "(1,2,3) with velocity (3,4,5)"); } @@ -113,7 +113,7 @@ public: arma::vec expected{0., 0., 0.}; arma::vec result = trap.total_force_particles(0); - ASSERT(arma_vector_close_to(expected, result), + ASSERT(close_to(expected, result), "Testing the total force of all particles on particle 0 " "with only a single particle"); @@ -126,7 +126,7 @@ public: expected = arma::vec(3, arma::fill::value(-3473.383325)); result = trap.total_force_particles(0); - ASSERT(arma_vector_close_to(expected, result), + ASSERT(close_to(expected, result), "Testing the total force of all particles on particle 0 " "with 3 other particles."); }