overall PIMathMatrix tests correction
This commit is contained in:
@@ -238,8 +238,7 @@ TEST(PIMathMatrixT_Test, operator_Assignment) {
|
||||
PIMathMatrixT<rows, cols, double> matrix1;
|
||||
auto matrix2 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
||||
matrix1 = matrix2;
|
||||
b = cmpSquareMatrixWithValue(matrix1, 6.72, rows);
|
||||
ASSERT_TRUE(b);
|
||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1, 6.72, rows));
|
||||
}
|
||||
|
||||
TEST(PIMathMatrixT_Test, operator_EqualTrue) {
|
||||
@@ -310,65 +309,44 @@ TEST(PIMathMatrixT_Test, operator_Subtraction_Assignment) {
|
||||
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(1.0);
|
||||
auto matrix2 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
||||
matrix1 -= matrix2;
|
||||
b = cmpSquareMatrixWithValue(matrix1, -5.72, rows);
|
||||
ASSERT_TRUE(b);
|
||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1, -5.72, rows));
|
||||
}
|
||||
|
||||
TEST(PIMathMatrixT_Test, operator_Multiplication_Assignment) {
|
||||
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
||||
matrix1 *= 2.0;
|
||||
b = cmpSquareMatrixWithValue(matrix1, 13.44, rows);
|
||||
ASSERT_TRUE(b);
|
||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1, 13.44, rows));
|
||||
}
|
||||
|
||||
TEST(PIMathMatrixT_Test, operator_Division_Assignment) {
|
||||
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
||||
matrix1 /= 2.0;
|
||||
b = cmpSquareMatrixWithValue(matrix1, 3.36, rows);
|
||||
ASSERT_TRUE(b);
|
||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1, 3.36, rows));
|
||||
}
|
||||
|
||||
TEST(PIMathMatrixT_Test, operator_Addition)
|
||||
{
|
||||
PIMathMatrixT<rows, cols, double> matrix1;
|
||||
PIMathMatrixT<rows, cols, double> matrix2;
|
||||
bool b;
|
||||
matrix1.fill(6.72);
|
||||
matrix2.fill(8.28);
|
||||
b = cmpSquareMatrixWithValue(matrix1 + matrix2, 15.0, rows);
|
||||
ASSERT_TRUE(b);
|
||||
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
||||
auto matrix2 = PIMathMatrixT<rows, cols, double>::filled(8.28);
|
||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 + matrix2, 15.0, rows));
|
||||
}
|
||||
|
||||
TEST(PIMathMatrixT_Test, operator_Subtraction)
|
||||
{
|
||||
PIMathMatrixT<rows, cols, double> matrix1;
|
||||
PIMathMatrixT<rows, cols, double> matrix2;
|
||||
bool b;
|
||||
matrix1.fill(6.0);
|
||||
matrix2.fill(5.0);
|
||||
b = cmpSquareMatrixWithValue(matrix1 - matrix2, 1.0, rows);
|
||||
ASSERT_TRUE(b);
|
||||
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.0);
|
||||
auto matrix2 = PIMathMatrixT<rows, cols, double>::filled(5.0);
|
||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 - matrix2, 1.0, rows));
|
||||
}
|
||||
|
||||
TEST(PIMathMatrixT_Test, operator_Multiplication)
|
||||
{
|
||||
PIMathMatrixT<rows, cols, double> matrix1;
|
||||
PIMathMatrixT<rows, cols, double> matrix2;
|
||||
bool b;
|
||||
matrix1.fill(6.72);
|
||||
matrix2 = matrix1*4.0;
|
||||
b = cmpSquareMatrixWithValue(matrix2, 26.88, rows);
|
||||
ASSERT_TRUE(b);
|
||||
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 * 4.0, 26.88, rows));
|
||||
}
|
||||
TEST(PIMathMatrixT_Test, operator_Division)
|
||||
{
|
||||
PIMathMatrixT<rows, cols, double> matrix1;
|
||||
PIMathMatrixT<rows, cols, double> matrix2;
|
||||
bool b;
|
||||
matrix1.fill(6.72);
|
||||
matrix2 = matrix1/4.0;
|
||||
b = cmpSquareMatrixWithValue(matrix2, 1.68, rows);
|
||||
ASSERT_TRUE(b);
|
||||
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 / 4.0, 1.68, rows));
|
||||
}
|
||||
|
||||
TEST(PIMathMatrixT_Test, determinantIfSquare) {
|
||||
|
||||
Reference in New Issue
Block a user