Use ASSERT_FLOAT_EQ instead of ASSERT_EQ
Summary: Changes the unit test comparsion to use ```ASSERT_FLOAT_EQ``` instead of ```ASSERT_EQ``` as they check float values. Closes https://github.com/facebook/css-layout/pull/257 Reviewed By: splhack Differential Revision: D4213809 Pulled By: emilsjolander fbshipit-source-id: a79d310840814f26a122e1a0f6db47383b17d7e2
This commit is contained in:
committed by
Facebook Github Bot
parent
49a21e657b
commit
d54f09e32b
@@ -25,8 +25,8 @@ TEST(CSSLayoutTest, assert_default_values) {
|
||||
ASSERT_EQ(CSSPositionTypeRelative, CSSNodeStyleGetPositionType(root));
|
||||
ASSERT_EQ(CSSWrapNoWrap, CSSNodeStyleGetFlexWrap(root));
|
||||
ASSERT_EQ(CSSOverflowVisible, CSSNodeStyleGetOverflow(root));
|
||||
ASSERT_EQ(0, CSSNodeStyleGetFlexGrow(root));
|
||||
ASSERT_EQ(0, CSSNodeStyleGetFlexShrink(root));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetFlexGrow(root));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetFlexShrink(root));
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetFlexBasis(root)));
|
||||
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPosition(root, CSSEdgeLeft)));
|
||||
@@ -36,24 +36,24 @@ TEST(CSSLayoutTest, assert_default_values) {
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPosition(root, CSSEdgeStart)));
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPosition(root, CSSEdgeEnd)));
|
||||
|
||||
ASSERT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeLeft));
|
||||
ASSERT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeTop));
|
||||
ASSERT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeRight));
|
||||
ASSERT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeBottom));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeLeft));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeTop));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeRight));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeBottom));
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetMargin(root, CSSEdgeStart)));
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetMargin(root, CSSEdgeEnd)));
|
||||
|
||||
ASSERT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeLeft));
|
||||
ASSERT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeTop));
|
||||
ASSERT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeRight));
|
||||
ASSERT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeBottom));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeLeft));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeTop));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeRight));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeBottom));
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPadding(root, CSSEdgeStart)));
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPadding(root, CSSEdgeEnd)));
|
||||
|
||||
ASSERT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeLeft));
|
||||
ASSERT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeTop));
|
||||
ASSERT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeRight));
|
||||
ASSERT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeBottom));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeLeft));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeTop));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeRight));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeBottom));
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetBorder(root, CSSEdgeStart)));
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetBorder(root, CSSEdgeEnd)));
|
||||
|
||||
@@ -64,10 +64,10 @@ TEST(CSSLayoutTest, assert_default_values) {
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetMaxWidth(root)));
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetMaxHeight(root)));
|
||||
|
||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||
ASSERT_EQ(0, CSSNodeLayoutGetRight(root));
|
||||
ASSERT_EQ(0, CSSNodeLayoutGetBottom(root));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetRight(root));
|
||||
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetBottom(root));
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeLayoutGetWidth(root)));
|
||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeLayoutGetHeight(root)));
|
||||
ASSERT_EQ(CSSDirectionInherit, CSSNodeLayoutGetDirection(root));
|
||||
|
Reference in New Issue
Block a user