Skip to content

Commit 77c19a2

Browse files
committed
update relevant C++ test to check for exception
1 parent 351af1d commit 77c19a2

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

modules/core/test/math/testArray2D.cpp

+4-10
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,8 @@ TEST_CASE("Test constructors with double", "[constructors]")
140140
}
141141
SECTION("Keep default size (r=0, c=0)")
142142
{
143-
vpArray2D<double> A(bench);
144-
std::cout << "A with default size (r=0, c=0):\n" << A << std::endl;
145-
CHECK(test("A", A, bench));
146-
CHECK(A.getRows() == bench.size());
147-
CHECK(A.getCols() == 1);
143+
std::cout << "A with default size (r=0, c=0):\n" << std::endl;
144+
REQUIRE_THROWS(vpArray2D<double>(bench));
148145
}
149146
SECTION("Keep row size to 0")
150147
{
@@ -221,11 +218,8 @@ TEST_CASE("Test constructors with float", "[constructors]")
221218
}
222219
SECTION("Keep default size (r=0, c=0)")
223220
{
224-
vpArray2D<float> A(bench);
225-
std::cout << "A with default size (r=0, c=0):\n" << A << std::endl;
226-
CHECK(test("A", A, bench));
227-
CHECK(A.getRows() == bench.size());
228-
CHECK(A.getCols() == 1);
221+
std::cout << "A with default size (r=0, c=0):\n" << std::endl;
222+
REQUIRE_THROWS(vpArray2D<float>(bench));
229223
}
230224
SECTION("Keep row size to 0")
231225
{

modules/python/test/test_numpy_array.py

-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def test_numpy_constructor_interpreted_as_1d_vector():
8686
ac = ArrayDouble2D(n_1d, c=len(n_1d))
8787

8888

89-
9089
def test_numpy_conversion_and_back():
9190
a = ArrayDouble2D(10, 10, 2.0)
9291
a_np = a.numpy().copy()

0 commit comments

Comments
 (0)