Skip to content
Snippets Groups Projects
Commit b3fdc0a7 authored by Tobias Leibner's avatar Tobias Leibner
Browse files

[container.matrix-view] fix test

parent ebab91c8
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,7 @@ public:
, past_last_row_(0)
, first_col_(0)
, past_last_col_(0)
, pattern_(nullptr)
, pattern_(std::shared_ptr<SparsityPatternDefault>(nullptr))
{
DUNE_THROW(XT::Common::Exceptions::you_are_using_this_wrong, "This constructor does not make sense for MatrixView");
}
......@@ -102,7 +102,7 @@ public:
, past_last_row_(0)
, first_col_(0)
, past_last_col_(0)
, pattern_(nullptr)
, pattern_(std::shared_ptr<SparsityPatternDefault>(nullptr))
{
DUNE_THROW(XT::Common::Exceptions::you_are_using_this_wrong, "This constructor does not make sense for MatrixView");
}
......@@ -118,7 +118,7 @@ public:
, past_last_row_(past_last_row)
, first_col_(first_col)
, past_last_col_(past_last_col)
, pattern_(nullptr)
, pattern_(std::shared_ptr<SparsityPatternDefault>(nullptr))
{}
size_t row_index(const size_t ii) const
......
......@@ -111,15 +111,19 @@ GTEST_TEST(SparsityPatternDefaultTest, test_creation_functions)
EXPECT_TRUE(diagonal_patt.size() == ROWS);
EXPECT_TRUE(subdiagonal_patt.size() == ROWS);
for (size_t ii = 0; ii < ROWS; ++ii) {
if (ii < COLS)
if (ii < COLS) {
EXPECT_TRUE(diagonal_patt.contains(ii, ii));
if (ii > 0)
}
if (ii > 0) {
EXPECT_TRUE(subdiagonal_patt.contains(ii, ii - 1));
}
for (size_t jj = 0; jj < COLS; ++jj) {
if (jj != ii)
if (jj != ii) {
EXPECT_FALSE(diagonal_patt.contains(ii, jj));
if (jj != ii - 1)
}
if (jj != ii - 1) {
EXPECT_FALSE(subdiagonal_patt.contains(ii, jj));
}
} // jj
} // ii
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment