added operator for matrix

This commit is contained in:
2024-12-21 19:32:09 +03:00
parent e497308349
commit 2b9575311e
2 changed files with 16 additions and 0 deletions

View File

@@ -29,6 +29,15 @@ TEST_F(UnitTestMatrix, Constructor_Size)
EXPECT_EQ(m.ColumnsCount(), 3);
}
TEST_F(UnitTestMatrix, Operator_SquareBrackets)
{
EXPECT_EQ((m2[0, 0]), 1.0f);
EXPECT_EQ((m2[0, 1]), 2.0f);
EXPECT_EQ((m2[1, 0]), 3.0f);
EXPECT_EQ((m2[1, 1]), 4.0f);
}
TEST_F(UnitTestMatrix, Constructor_InitializerList)
{
Matrix m{{1.0f, 2.0f}, {3.0f, 4.0f}};