Bug 936721 - Do a fuzzy equality comparison to account for floating-point rounding errors. r=botond

This commit is contained in:
Kartikaya Gupta 2013-11-10 09:47:27 -05:00
parent 8a67838313
commit ef8d5368f2

View File

@ -222,8 +222,10 @@ TEST(AsyncPanZoomController, Overzoom) {
fm = apzc->GetFrameMetrics();
EXPECT_EQ(fm.mZoom.scale, 0.8f);
EXPECT_EQ(fm.mScrollOffset.x, 0);
EXPECT_EQ(fm.mScrollOffset.y, 0);
// bug 936721 - PGO builds introduce rounding error so
// use a fuzzy match instead
EXPECT_LT(abs(fm.mScrollOffset.x), 1e-5);
EXPECT_LT(abs(fm.mScrollOffset.y), 1e-5);
}
TEST(AsyncPanZoomController, SimpleTransform) {