Skip to content

Commit

Permalink
Merge pull request #533 from norlab-ulaval/Fix_2D_transformation_test…
Browse files Browse the repository at this point in the history
…s_in_debug

Fix 2D transformation tests in debug
  • Loading branch information
boxanm authored Nov 21, 2023
2 parents ea8df9d + 238d2fb commit 0f6971b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions utest/ui/Transformations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ TEST(Transformation, ComputePureTranslationDataPoints2D)
const Eigen::Rotation2D<NumericType> rotation{ 0 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure translation.
{
const Eigen::Matrix<NumericType, 2, 1> translation{ -1.0001, 34.5 };
const Eigen::Rotation2D<NumericType> rotation{ 0 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
}

Expand Down Expand Up @@ -230,31 +230,31 @@ TEST(Transformation, ComputeRigidTransformDataPoints2D)
const Eigen::Rotation2D<NumericType> rotation{ 0 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure translation.
{
const Eigen::Matrix<NumericType, 2, 1> translation{ -1.0001, 34.5 };
const Eigen::Rotation2D<NumericType> rotation{ 0 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure rotation.
{
const Eigen::Matrix<NumericType, 2, 1> translation{ 0, 0 };
const Eigen::Rotation2D<NumericType> rotation{ 3.53453 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Translation + rotation.
{
const Eigen::Matrix<NumericType, 2, 1> translation{ -3.11, 100.222 };
const Eigen::Rotation2D<NumericType> rotation{ -123.3 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
}

Expand Down Expand Up @@ -310,7 +310,7 @@ TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
const NumericType scale{ 1.0 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure Upscaling.
{
Expand All @@ -319,7 +319,7 @@ TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
const NumericType scale{ 5.0 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure Downscaling.
{
Expand All @@ -328,7 +328,7 @@ TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
const NumericType scale{ 0.1 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure translation + Downscaling.
{
Expand All @@ -337,7 +337,7 @@ TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
const NumericType scale{ 0.5 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure rotation + Upscaling.
{
Expand All @@ -346,7 +346,7 @@ TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
const NumericType scale{ 1.9 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Translation + rotation + Upscaling.
{
Expand All @@ -355,7 +355,7 @@ TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
const NumericType scale{ 1.9 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
}

Expand Down

0 comments on commit 0f6971b

Please sign in to comment.