Skip to content
Snippets Groups Projects
Commit 2aa3034d authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add test for runtime incompatible matrix/vector product

parent 32567b1a
Branches
Tags
1 merge request!26Feature/linear systems
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
template class SparseMatrixDescriptor<int, uint8_t>; template class SparseMatrixDescriptor<int, uint8_t>;
TEST_CASE("CRSMatrix", "[algebra]") TEST_CASE("CRSMatrix", "[algebra]")
{
SECTION("CRSMatrix")
{ {
SECTION("matrix size") SECTION("matrix size")
{ {
...@@ -128,5 +126,13 @@ TEST_CASE("CRSMatrix", "[algebra]") ...@@ -128,5 +126,13 @@ TEST_CASE("CRSMatrix", "[algebra]")
REQUIRE(y[2] == 110); REQUIRE(y[2] == 110);
REQUIRE(y[3] == 150); REQUIRE(y[3] == 150);
} }
#ifndef NDEBUG
SECTION("incompatible runtime matrix/vector product")
{
CRSMatrix<int, uint8_t> A{SparseMatrixDescriptor<int, uint8_t>{4}};
Vector<int> x{2};
REQUIRE_THROWS_AS(A * x, AssertError);
} }
#endif // NDEBUG
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment