From 04d494cb75e180a4805feedc6d9c96e2ec306f97 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 28 Feb 2023 22:27:27 +0100 Subject: [PATCH] Tests: add test of a matrix without rotation part to raise an exception --- tests/src/Base/Rotation.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/src/Base/Rotation.cpp b/tests/src/Base/Rotation.cpp index d5f965f745..033318bd0e 100644 --- a/tests/src/Base/Rotation.cpp +++ b/tests/src/Base/Rotation.cpp @@ -1,4 +1,5 @@ #include "gtest/gtest.h" +#include #include #include @@ -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)