From 6afb527dfc01d1aac96dcccf4131bd0ecb04778e Mon Sep 17 00:00:00 2001 From: Seb James Date: Thu, 5 Dec 2024 16:56:54 +0000 Subject: [PATCH] Slight relaxation in the tests --- tests/testarange.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/testarange.cpp b/tests/testarange.cpp index 14c21d03..78484b10 100644 --- a/tests/testarange.cpp +++ b/tests/testarange.cpp @@ -10,19 +10,19 @@ int main() morph::vvec x_ex1 = { 0.0 , 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5 }; x.arange (0.0, 6.0, 0.5); std::cout << "First example: " << x << std::endl; - if (std::abs((x - x_ex1).longest()) >= std::numeric_limits::epsilon()) { --rtn; } + if (std::abs((x - x_ex1).longest()) > std::numeric_limits::epsilon()) { --rtn; } // x = np.arange(-2.5, 2.3, 2) morph::vvec x_ex2 = { -2.5, -0.5, 1.5 }; x.arange (-2.5, 2.3, 2.0); std::cout << "Second example: " << x << std::endl; - if (std::abs((x - x_ex2).longest()) >= std::numeric_limits::epsilon()) { --rtn; } + if (std::abs((x - x_ex2).longest()) > std::numeric_limits::epsilon()) { --rtn; } // x = np.arange(-5, 5, 2) morph::vvec x_ex3 = { -5.0, -3.0, -1.0, 1.0, 3.0 }; x.arange (-5.0, 5.0, 2.0); std::cout << "Third example: " << x << std::endl; - if (std::abs((x - x_ex3).longest()) >= std::numeric_limits::epsilon()) { --rtn; } + if (std::abs((x - x_ex3).longest()) > std::numeric_limits::epsilon()) { --rtn; } // x = np.arange(2, -2, 0.27) (should be empty) morph::vvec x_ex4 = {}; @@ -40,19 +40,19 @@ int main() morph::vvec x_ex6 = { 1.0, 0.8, 0.6, 0.4, 0.2, 0.0, -0.2, -0.4, -0.6, -0.8 }; x.arange (1.0, -1.0, -0.2); std::cout << "Sixth example: " << x << std::endl; - if (std::abs((x - x_ex6).longest()) >= std::numeric_limits::epsilon()) { --rtn; } + if (std::abs((x - x_ex6).longest()) > std::numeric_limits::epsilon()) { --rtn; } // x = np.arange(-2, 1.2, 0.3) morph::vvec x_ex7 = { -2.0 , -1.7, -1.4, -1.1, -0.8, -0.5, -0.2, 0.1, 0.4, 0.7, 1.0 }; x.arange (-2.0, 1.2, 0.3); std::cout << "Seventh example: " << x << std::endl; - if (std::abs((x - x_ex7).longest()) >= std::numeric_limits::epsilon()) { --rtn; } + if (std::abs((x - x_ex7).longest()) > std::numeric_limits::epsilon()) { --rtn; } // x = np.arange(1, 3, 2.1) (increment greater than gap) morph::vvec x_ex8 = { 1.0 }; x.arange (1.0, 3.0, 2.1); std::cout << "Eighth example: " << x << std::endl; - if (std::abs((x - x_ex8).longest()) >= std::numeric_limits::epsilon()) { --rtn; } + if (std::abs((x - x_ex8).longest()) > std::numeric_limits::epsilon()) { --rtn; } if (rtn == 0) { std::cout << "Success\n"; }