From 77c19a269af59a86b0d460cb8ee87bfc67048121 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 17 Apr 2024 15:41:04 +0200 Subject: [PATCH] update relevant C++ test to check for exception --- modules/core/test/math/testArray2D.cpp | 14 ++++---------- modules/python/test/test_numpy_array.py | 1 - 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/modules/core/test/math/testArray2D.cpp b/modules/core/test/math/testArray2D.cpp index f959d2bd8c..50dcb0cc9c 100644 --- a/modules/core/test/math/testArray2D.cpp +++ b/modules/core/test/math/testArray2D.cpp @@ -140,11 +140,8 @@ TEST_CASE("Test constructors with double", "[constructors]") } SECTION("Keep default size (r=0, c=0)") { - vpArray2D A(bench); - std::cout << "A with default size (r=0, c=0):\n" << A << std::endl; - CHECK(test("A", A, bench)); - CHECK(A.getRows() == bench.size()); - CHECK(A.getCols() == 1); + std::cout << "A with default size (r=0, c=0):\n" << std::endl; + REQUIRE_THROWS(vpArray2D(bench)); } SECTION("Keep row size to 0") { @@ -221,11 +218,8 @@ TEST_CASE("Test constructors with float", "[constructors]") } SECTION("Keep default size (r=0, c=0)") { - vpArray2D A(bench); - std::cout << "A with default size (r=0, c=0):\n" << A << std::endl; - CHECK(test("A", A, bench)); - CHECK(A.getRows() == bench.size()); - CHECK(A.getCols() == 1); + std::cout << "A with default size (r=0, c=0):\n" << std::endl; + REQUIRE_THROWS(vpArray2D(bench)); } SECTION("Keep row size to 0") { diff --git a/modules/python/test/test_numpy_array.py b/modules/python/test/test_numpy_array.py index 010176fb50..9ca1113c26 100644 --- a/modules/python/test/test_numpy_array.py +++ b/modules/python/test/test_numpy_array.py @@ -86,7 +86,6 @@ def test_numpy_constructor_interpreted_as_1d_vector(): ac = ArrayDouble2D(n_1d, c=len(n_1d)) - def test_numpy_conversion_and_back(): a = ArrayDouble2D(10, 10, 2.0) a_np = a.numpy().copy()