diff --git a/src/UnitTests/Matrices/SparseMatrixTest.hpp b/src/UnitTests/Matrices/SparseMatrixTest.hpp index df06d28fc9850db8507532202816e66e4d69826e..bf261aa8464d3dd2f36a71e4cf34dd5de352ab94 100644 --- a/src/UnitTests/Matrices/SparseMatrixTest.hpp +++ b/src/UnitTests/Matrices/SparseMatrixTest.hpp @@ -113,17 +113,10 @@ void test_SetCompressedRowLengths() for( IndexType i = 0; i < 8; i++ ) // 9th row m.setElement( 9, i, value++ ); - - EXPECT_EQ( m.getNonZeroRowLength( 0 ), 3 ); - EXPECT_EQ( m.getNonZeroRowLength( 1 ), 3 ); - EXPECT_EQ( m.getNonZeroRowLength( 2 ), 1 ); - EXPECT_EQ( m.getNonZeroRowLength( 3 ), 2 ); - EXPECT_EQ( m.getNonZeroRowLength( 4 ), 3 ); - EXPECT_EQ( m.getNonZeroRowLength( 5 ), 4 ); - EXPECT_EQ( m.getNonZeroRowLength( 6 ), 5 ); - EXPECT_EQ( m.getNonZeroRowLength( 7 ), 6 ); - EXPECT_EQ( m.getNonZeroRowLength( 8 ), 7 ); - EXPECT_EQ( m.getNonZeroRowLength( 9 ), 8 ); + rowLengths = 0; + m.getCompressedRowLengths( rowLengths ); + typename Matrix::CompressedRowLengthsVector correctRowLengths{ 3, 3, 1, 2, 3, 4, 5, 6, 7, 8 }; + EXPECT_EQ( rowLengths, correctRowLengths ); } template< typename Matrix1, typename Matrix2 > diff --git a/src/UnitTests/Matrices/SparseMatrixTest_CSR_segments.h b/src/UnitTests/Matrices/SparseMatrixTest_CSR_segments.h index 34f7b4f7044c3f732014132386bee1af044a4ef2..5ac3dde26798309c4b2ea37a16b32805d7de648a 100644 --- a/src/UnitTests/Matrices/SparseMatrixTest_CSR_segments.h +++ b/src/UnitTests/Matrices/SparseMatrixTest_CSR_segments.h @@ -66,19 +66,12 @@ TYPED_TEST( CSRMatrixTest, setDimensionsTest ) test_SetDimensions< CSRMatrixType >(); } -//TYPED_TEST( CSRMatrixTest, setCompressedRowLengthsTest ) -//{ -//// using CSRMatrixType = typename TestFixture::CSRMatrixType; -// -//// test_SetCompressedRowLengths< CSRMatrixType >(); -// -// bool testRan = false; -// EXPECT_TRUE( testRan ); -// std::cout << "\nTEST DID NOT RUN. NOT WORKING.\n\n"; -// std::cout << " This test is dependent on the input format. \n"; -// std::cout << " Almost every format allocates elements per row differently.\n\n"; -// std::cout << "\n TODO: Finish implementation of getNonZeroRowLength (Only non-zero elements, not the number of allocated elements.)\n\n"; -//} +TYPED_TEST( CSRMatrixTest, setCompressedRowLengthsTest ) +{ + using CSRMatrixType = typename TestFixture::CSRMatrixType; + + test_SetCompressedRowLengths< CSRMatrixType >(); +} TYPED_TEST( CSRMatrixTest, setLikeTest ) { diff --git a/src/UnitTests/Matrices/SparseMatrixTest_SlicedEllpack_segments.h b/src/UnitTests/Matrices/SparseMatrixTest_SlicedEllpack_segments.h index 8eba34a2bd2d8726981403547c50236140d8c2fe..de5356f3a74b95b2683232d32600e3f079794938 100644 --- a/src/UnitTests/Matrices/SparseMatrixTest_SlicedEllpack_segments.h +++ b/src/UnitTests/Matrices/SparseMatrixTest_SlicedEllpack_segments.h @@ -78,19 +78,12 @@ TYPED_TEST( SlicedEllpackMatrixTest, setDimensionsTest ) test_SetDimensions< SlicedEllpackMatrixType >(); } -//TYPED_TEST( SlicedEllpackMatrixTest, setCompressedRowLengthsTest ) -//{ -//// using SlicedEllpackMatrixType = typename TestFixture::SlicedEllpackMatrixType; -// -//// test_SetCompressedRowLengths< SlicedEllpackMatrixType >(); -// -// bool testRan = false; -// EXPECT_TRUE( testRan ); -// std::cout << "\nTEST DID NOT RUN. NOT WORKING.\n\n"; -// std::cout << " This test is dependent on the input format. \n"; -// std::cout << " Almost every format allocates elements per row differently.\n\n"; -// std::cout << "\n TODO: Finish implementation of getNonZeroRowLength (Only non-zero elements, not the number of allocated elements.)\n\n"; -//} +TYPED_TEST( SlicedEllpackMatrixTest, setCompressedRowLengthsTest ) +{ + using SlicedEllpackMatrixType = typename TestFixture::SlicedEllpackMatrixType; + + test_SetCompressedRowLengths< SlicedEllpackMatrixType >(); +} TYPED_TEST( SlicedEllpackMatrixTest, setLikeTest ) {