Skip to content

Commit bd2413b

Browse files
authored
[Type] Add symmetric matrix access test (#5776)
1 parent 04ce00f commit bd2413b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Sofa/framework/Type/test/MatSym_test.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ class MatSymTest : public testing::NumericTest<typename ParameterPack::Real>
9898
testing::NumericTest<Real>::epsilon());
9999
}
100100

101+
void access() const
102+
{
103+
for (sofa::Size i = 0; i < Size; ++i)
104+
{
105+
for (sofa::Size j = 0; j < Size; ++j)
106+
{
107+
EXPECT_EQ(m_symmetricMatrix(i, j), m_symmetricMatrix(j, i));
108+
}
109+
}
110+
}
111+
101112
protected:
102113
sofa::type::MatSym<Size, Real> m_symmetricMatrix;
103114

@@ -162,6 +173,11 @@ TYPED_TEST(MatSymTest, trace)
162173
ASSERT_NO_THROW (this->trace());
163174
}
164175

176+
TYPED_TEST(MatSymTest, access)
177+
{
178+
ASSERT_NO_THROW (this->access());
179+
}
180+
165181

166182
template<class _Real>
167183
class MatSym3x3Test : public MatSymTest<MatSymTestParameterPack<3, _Real>>

0 commit comments

Comments
 (0)