Tests: add test of a matrix without rotation part to raise an exception

This commit is contained in:
wmayer
2023-02-28 22:27:27 +01:00
committed by wwmayer
parent ea866c755b
commit 04d494cb75

View File

@@ -1,4 +1,5 @@
#include "gtest/gtest.h"
#include <Base/Exception.h>
#include <Base/Matrix.h>
#include <Base/Rotation.h>
@@ -64,4 +65,14 @@ TEST(Rotation, TestUniformScaleLT1)
EXPECT_EQ(scaled_rot.isSame(scaled_rot, 1.0e-7), true);
}
TEST(Rotation, TestRotationFailure)
{
Base::Matrix4D mat;
mat.setCol(0, Base::Vector3d{1, 0, 0});
mat.setCol(1, Base::Vector3d{1, 1, 0});
mat.setCol(2, Base::Vector3d{0, 0, 1});
EXPECT_THROW(Base::Rotation{mat}, Base::ValueError);
}
// NOLINTEND(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)