Fix style property bits
Summary: Style bits had overlap, because `dimensionBit` was set with an incorrect increment. Reviewed By: SidharthGuglani Differential Revision: D15335134 fbshipit-source-id: 370e1a73547d76b0e26bc6ab67acb96d33ddf180
This commit is contained in:
committed by
Facebook Github Bot
parent
1562bce9b4
commit
1180afed9c
@@ -294,5 +294,98 @@ TEST(YGStyle, set_properties_reflects_all_set_properties) {
|
||||
1ull << YGStyle::aspectRatioBit});
|
||||
}
|
||||
|
||||
TEST(YGStyle, directionBit) {
|
||||
constexpr auto directionBit = YGStyle::directionBit;
|
||||
ASSERT_EQ(directionBit, 0);
|
||||
}
|
||||
TEST(YGStyle, flexDirectionBit) {
|
||||
constexpr auto flexDirectionBit = YGStyle::flexDirectionBit;
|
||||
ASSERT_EQ(flexDirectionBit, 1);
|
||||
}
|
||||
TEST(YGStyle, justifyContentBit) {
|
||||
constexpr auto justifyContentBit = YGStyle::justifyContentBit;
|
||||
ASSERT_EQ(justifyContentBit, 2);
|
||||
}
|
||||
TEST(YGStyle, alignContentBit) {
|
||||
constexpr auto alignContentBit = YGStyle::alignContentBit;
|
||||
ASSERT_EQ(alignContentBit, 3);
|
||||
}
|
||||
TEST(YGStyle, alignItemsBit) {
|
||||
constexpr auto alignItemsBit = YGStyle::alignItemsBit;
|
||||
ASSERT_EQ(alignItemsBit, 4);
|
||||
}
|
||||
TEST(YGStyle, alignSelfBit) {
|
||||
constexpr auto alignSelfBit = YGStyle::alignSelfBit;
|
||||
ASSERT_EQ(alignSelfBit, 5);
|
||||
}
|
||||
TEST(YGStyle, positionTypeBit) {
|
||||
constexpr auto positionTypeBit = YGStyle::positionTypeBit;
|
||||
ASSERT_EQ(positionTypeBit, 6);
|
||||
}
|
||||
TEST(YGStyle, flexWrapBit) {
|
||||
constexpr auto flexWrapBit = YGStyle::flexWrapBit;
|
||||
ASSERT_EQ(flexWrapBit, 7);
|
||||
}
|
||||
TEST(YGStyle, overflowBit) {
|
||||
constexpr auto overflowBit = YGStyle::overflowBit;
|
||||
ASSERT_EQ(overflowBit, 8);
|
||||
}
|
||||
TEST(YGStyle, displayBit) {
|
||||
constexpr auto displayBit = YGStyle::displayBit;
|
||||
ASSERT_EQ(displayBit, 9);
|
||||
}
|
||||
TEST(YGStyle, flexBit) {
|
||||
constexpr auto flexBit = YGStyle::flexBit;
|
||||
ASSERT_EQ(flexBit, 10);
|
||||
}
|
||||
TEST(YGStyle, flexGrowBit) {
|
||||
constexpr auto flexGrowBit = YGStyle::flexGrowBit;
|
||||
ASSERT_EQ(flexGrowBit, 11);
|
||||
}
|
||||
TEST(YGStyle, flexShrinkBit) {
|
||||
constexpr auto flexShrinkBit = YGStyle::flexShrinkBit;
|
||||
ASSERT_EQ(flexShrinkBit, 12);
|
||||
}
|
||||
TEST(YGStyle, flexBasisBit) {
|
||||
constexpr auto flexBasisBit = YGStyle::flexBasisBit;
|
||||
ASSERT_EQ(flexBasisBit, 13);
|
||||
}
|
||||
TEST(YGStyle, marginBit) {
|
||||
constexpr auto marginBit = YGStyle::marginBit;
|
||||
ASSERT_EQ(marginBit, 14);
|
||||
}
|
||||
TEST(YGStyle, positionBit) {
|
||||
constexpr auto positionBit = YGStyle::positionBit;
|
||||
ASSERT_EQ(positionBit, 23);
|
||||
}
|
||||
TEST(YGStyle, paddingBit) {
|
||||
constexpr auto paddingBit = YGStyle::paddingBit;
|
||||
ASSERT_EQ(paddingBit, 32);
|
||||
}
|
||||
TEST(YGStyle, borderBit) {
|
||||
constexpr auto borderBit = YGStyle::borderBit;
|
||||
ASSERT_EQ(borderBit, 41);
|
||||
}
|
||||
TEST(YGStyle, dimensionsBit) {
|
||||
constexpr auto dimensionsBit = YGStyle::dimensionsBit;
|
||||
ASSERT_EQ(dimensionsBit, 50);
|
||||
}
|
||||
TEST(YGStyle, maxDimensionsBit) {
|
||||
constexpr auto maxDimensionsBit = YGStyle::maxDimensionsBit;
|
||||
ASSERT_EQ(maxDimensionsBit, 52);
|
||||
}
|
||||
TEST(YGStyle, minDimensionsBit) {
|
||||
constexpr auto minDimensionsBit = YGStyle::minDimensionsBit;
|
||||
ASSERT_EQ(minDimensionsBit, 54);
|
||||
}
|
||||
TEST(YGStyle, aspectRatioBit) {
|
||||
constexpr auto aspectRatioBit = YGStyle::aspectRatioBit;
|
||||
ASSERT_EQ(aspectRatioBit, 56);
|
||||
}
|
||||
TEST(YGStyle, numStyles) {
|
||||
constexpr auto numStyles = YGStyle::numStyles;
|
||||
ASSERT_EQ(numStyles, 57);
|
||||
}
|
||||
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
|
@@ -137,7 +137,7 @@ public:
|
||||
static constexpr int borderBit =
|
||||
paddingBit + facebook::yoga::enums::count<YGEdge>();
|
||||
static constexpr int dimensionsBit =
|
||||
borderBit + facebook::yoga::enums::count<YGDimension>();
|
||||
borderBit + facebook::yoga::enums::count<YGEdge>();
|
||||
static constexpr int maxDimensionsBit =
|
||||
dimensionsBit + facebook::yoga::enums::count<YGDimension>();
|
||||
static constexpr int minDimensionsBit =
|
||||
@@ -145,6 +145,8 @@ public:
|
||||
static constexpr int aspectRatioBit =
|
||||
minDimensionsBit + facebook::yoga::enums::count<YGDimension>();
|
||||
|
||||
static constexpr int numStyles = aspectRatioBit + 1;
|
||||
|
||||
private:
|
||||
std::bitset<aspectRatioBit + 1> assignedProps_;
|
||||
|
||||
|
Reference in New Issue
Block a user