Add equality comparator to geometry classes (#1882)

This commit is contained in:
Prateek Machiraju
2019-09-08 14:20:26 -04:00
committed by Peter Johnson
parent 62f07c182c
commit 86b666bba9
26 changed files with 341 additions and 10 deletions

View File

@@ -53,3 +53,15 @@ TEST(Rotation2dTest, Minus) {
EXPECT_NEAR((one - two).Degrees().to<double>(), 40.0, kEpsilon);
}
TEST(Rotation2dTest, Equality) {
const auto one = Rotation2d(43_deg);
const auto two = Rotation2d(43_deg);
EXPECT_TRUE(one == two);
}
TEST(Rotation2dTest, Inequality) {
const auto one = Rotation2d(43_deg);
const auto two = Rotation2d(43.5_deg);
EXPECT_TRUE(one != two);
}