Fix test on windows

release/4.3a0
Frank Dellaert 2024-10-28 15:14:46 -07:00
parent 2d170e4cac
commit 0836852dcb
1 changed files with 12 additions and 22 deletions

View File

@ -40,30 +40,20 @@ TEST(FundamentalMatrix, Retract) {
} }
//************************************************************************* //*************************************************************************
// Test conversion from an F-matrix // Test conversion from F matrices, including non-rotations
TEST(FundamentalMatrix, Conversion) { TEST(FundamentalMatrix, Conversion) {
const Matrix3 F = trueU.matrix() * Vector3(1, trueS, 0).asDiagonal() * Matrix3 U = trueU.matrix();
trueV.matrix().transpose(); Matrix3 V = trueV.matrix();
FundamentalMatrix actual(F); std::vector<FundamentalMatrix> Fs = {
EXPECT(assert_equal(trueF, actual)); FundamentalMatrix(U, trueS, V), FundamentalMatrix(U, trueS, -V),
} FundamentalMatrix(-U, trueS, V), FundamentalMatrix(-U, trueS, -V)};
//************************************************************************* for (const auto& trueF : Fs) {
// Test conversion with a *non-rotation* U const Matrix3 F = trueF.matrix();
TEST(FlippedFundamentalMatrix, Conversion1) { FundamentalMatrix actual(F);
FundamentalMatrix trueF(trueU.matrix(), trueS, -trueV.matrix()); // We check the matrices as the underlying representation is not unique
const Matrix3 F = trueF.matrix(); CHECK(assert_equal(F, actual.matrix()));
FundamentalMatrix actual(F); }
CHECK(assert_equal(F, actual.matrix()));
}
//*************************************************************************
// Test conversion with a *non-rotation* U
TEST(FlippedFundamentalMatrix, Conversion2) {
FundamentalMatrix trueF(-trueU.matrix(), trueS, trueV.matrix());
const Matrix3 F = trueF.matrix();
FundamentalMatrix actual(F);
CHECK(assert_equal(F, actual.matrix()));
} }
//************************************************************************* //*************************************************************************