Skip to content

Commit

Permalink
update relevant C++ test to check for exception
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed Apr 17, 2024
1 parent 351af1d commit 77c19a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
14 changes: 4 additions & 10 deletions modules/core/test/math/testArray2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,8 @@ TEST_CASE("Test constructors with double", "[constructors]")
}
SECTION("Keep default size (r=0, c=0)")
{
vpArray2D<double> 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<double>(bench));
}
SECTION("Keep row size to 0")
{
Expand Down Expand Up @@ -221,11 +218,8 @@ TEST_CASE("Test constructors with float", "[constructors]")
}
SECTION("Keep default size (r=0, c=0)")
{
vpArray2D<float> 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<float>(bench));
}
SECTION("Keep row size to 0")
{
Expand Down
1 change: 0 additions & 1 deletion modules/python/test/test_numpy_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 77c19a2

Please sign in to comment.