Apply clang-format update fixes
Reviewed By: igorsugak Differential Revision: D25861849 fbshipit-source-id: 840dc1061e557717c7f9ffcccbc09c24b96b78e0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a38ec3d7a4
commit
584dfe961e
@@ -28,17 +28,19 @@
|
|||||||
|
|
||||||
UIView* child2 = [UIView new];
|
UIView* child2 = [UIView new];
|
||||||
child2.backgroundColor = [UIColor greenColor];
|
child2.backgroundColor = [UIColor greenColor];
|
||||||
child2.frame = (CGRect){.size = {
|
child2.frame = (CGRect){
|
||||||
.width = 200,
|
.size = {
|
||||||
.height = 100,
|
.width = 200,
|
||||||
}};
|
.height = 100,
|
||||||
|
}};
|
||||||
|
|
||||||
UIView* child3 = [UIView new];
|
UIView* child3 = [UIView new];
|
||||||
child3.backgroundColor = [UIColor yellowColor];
|
child3.backgroundColor = [UIColor yellowColor];
|
||||||
child3.frame = (CGRect){.size = {
|
child3.frame = (CGRect){
|
||||||
.width = 100,
|
.size = {
|
||||||
.height = 100,
|
.width = 100,
|
||||||
}};
|
.height = 100,
|
||||||
|
}};
|
||||||
|
|
||||||
[child2 addSubview:child3];
|
[child2 addSubview:child3];
|
||||||
[root addSubview:child1];
|
[root addSubview:child1];
|
||||||
|
@@ -23,8 +23,8 @@ static YGSize globalMeasureFunc(
|
|||||||
Node const& node = *reinterpret_cast<Node const*>(YGNodeGetContext(nodeRef));
|
Node const& node = *reinterpret_cast<Node const*>(YGNodeGetContext(nodeRef));
|
||||||
|
|
||||||
Size size = node.callMeasureFunc(width, widthMode, height, heightMode);
|
Size size = node.callMeasureFunc(width, widthMode, height, heightMode);
|
||||||
YGSize ygSize = {static_cast<float>(size.width),
|
YGSize ygSize = {
|
||||||
static_cast<float>(size.height)};
|
static_cast<float>(size.width), static_cast<float>(size.height)};
|
||||||
|
|
||||||
return ygSize;
|
return ygSize;
|
||||||
}
|
}
|
||||||
|
@@ -303,8 +303,8 @@ EventArgs createArgs(
|
|||||||
};
|
};
|
||||||
|
|
||||||
EventArgs args = createArgs<E>(node, data);
|
EventArgs args = createArgs<E>(node, data);
|
||||||
args.eventTestDataPtr = {new EventTestData{eventTestData},
|
args.eventTestDataPtr = {
|
||||||
deleteEventTestData};
|
new EventTestData{eventTestData}, deleteEventTestData};
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,12 +29,13 @@ TEST(YogaTest, computed_layout_margin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(YogaTest, margin_side_overrides_horizontal_and_vertical) {
|
TEST(YogaTest, margin_side_overrides_horizontal_and_vertical) {
|
||||||
const std::array<YGEdge, 6> edges = {{YGEdgeTop,
|
const std::array<YGEdge, 6> edges = {
|
||||||
YGEdgeBottom,
|
{YGEdgeTop,
|
||||||
YGEdgeStart,
|
YGEdgeBottom,
|
||||||
YGEdgeEnd,
|
YGEdgeStart,
|
||||||
YGEdgeLeft,
|
YGEdgeEnd,
|
||||||
YGEdgeRight}};
|
YGEdgeLeft,
|
||||||
|
YGEdgeRight}};
|
||||||
|
|
||||||
for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
|
for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
|
||||||
for (const auto& edge : edges) {
|
for (const auto& edge : edges) {
|
||||||
@@ -58,12 +59,13 @@ TEST(YogaTest, margin_side_overrides_horizontal_and_vertical) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(YogaTest, margin_side_overrides_all) {
|
TEST(YogaTest, margin_side_overrides_all) {
|
||||||
const std::array<YGEdge, 6> edges = {{YGEdgeTop,
|
const std::array<YGEdge, 6> edges = {
|
||||||
YGEdgeBottom,
|
{YGEdgeTop,
|
||||||
YGEdgeStart,
|
YGEdgeBottom,
|
||||||
YGEdgeEnd,
|
YGEdgeStart,
|
||||||
YGEdgeLeft,
|
YGEdgeEnd,
|
||||||
YGEdgeRight}};
|
YGEdgeLeft,
|
||||||
|
YGEdgeRight}};
|
||||||
|
|
||||||
for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
|
for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
|
||||||
for (const auto& edge : edges) {
|
for (const auto& edge : edges) {
|
||||||
|
@@ -29,12 +29,13 @@ TEST(YogaTest, computed_layout_padding) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(YogaTest, padding_side_overrides_horizontal_and_vertical) {
|
TEST(YogaTest, padding_side_overrides_horizontal_and_vertical) {
|
||||||
const std::array<YGEdge, 6> edges = {{YGEdgeTop,
|
const std::array<YGEdge, 6> edges = {
|
||||||
YGEdgeBottom,
|
{YGEdgeTop,
|
||||||
YGEdgeStart,
|
YGEdgeBottom,
|
||||||
YGEdgeEnd,
|
YGEdgeStart,
|
||||||
YGEdgeLeft,
|
YGEdgeEnd,
|
||||||
YGEdgeRight}};
|
YGEdgeLeft,
|
||||||
|
YGEdgeRight}};
|
||||||
|
|
||||||
for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
|
for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
|
||||||
for (const auto& edge : edges) {
|
for (const auto& edge : edges) {
|
||||||
@@ -58,12 +59,13 @@ TEST(YogaTest, padding_side_overrides_horizontal_and_vertical) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(YogaTest, padding_side_overrides_all) {
|
TEST(YogaTest, padding_side_overrides_all) {
|
||||||
const std::array<YGEdge, 6> edges = {{YGEdgeTop,
|
const std::array<YGEdge, 6> edges = {
|
||||||
YGEdgeBottom,
|
{YGEdgeTop,
|
||||||
YGEdgeStart,
|
YGEdgeBottom,
|
||||||
YGEdgeEnd,
|
YGEdgeStart,
|
||||||
YGEdgeLeft,
|
YGEdgeEnd,
|
||||||
YGEdgeRight}};
|
YGEdgeLeft,
|
||||||
|
YGEdgeRight}};
|
||||||
|
|
||||||
for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
|
for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
|
||||||
for (const auto& edge : edges) {
|
for (const auto& edge : edges) {
|
||||||
|
@@ -29,8 +29,8 @@ TEST(YogaTest, set_children_adds_children_to_parent) {
|
|||||||
const std::vector<YGNodeRef> expectedChildren = {root_child0, root_child1};
|
const std::vector<YGNodeRef> expectedChildren = {root_child0, root_child1};
|
||||||
ASSERT_EQ(children, expectedChildren);
|
ASSERT_EQ(children, expectedChildren);
|
||||||
|
|
||||||
const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0),
|
const std::vector<YGNodeRef> owners = {
|
||||||
YGNodeGetOwner(root_child1)};
|
YGNodeGetOwner(root_child0), YGNodeGetOwner(root_child1)};
|
||||||
const std::vector<YGNodeRef> expectedOwners = {root, root};
|
const std::vector<YGNodeRef> expectedOwners = {root, root};
|
||||||
ASSERT_EQ(owners, expectedOwners);
|
ASSERT_EQ(owners, expectedOwners);
|
||||||
|
|
||||||
@@ -49,8 +49,8 @@ TEST(YogaTest, set_children_to_empty_removes_old_children) {
|
|||||||
const std::vector<YGNodeRef> expectedChildren = {};
|
const std::vector<YGNodeRef> expectedChildren = {};
|
||||||
ASSERT_EQ(children, expectedChildren);
|
ASSERT_EQ(children, expectedChildren);
|
||||||
|
|
||||||
const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0),
|
const std::vector<YGNodeRef> owners = {
|
||||||
YGNodeGetOwner(root_child1)};
|
YGNodeGetOwner(root_child0), YGNodeGetOwner(root_child1)};
|
||||||
const std::vector<YGNodeRef> expectedOwners = {nullptr, nullptr};
|
const std::vector<YGNodeRef> expectedOwners = {nullptr, nullptr};
|
||||||
ASSERT_EQ(owners, expectedOwners);
|
ASSERT_EQ(owners, expectedOwners);
|
||||||
|
|
||||||
@@ -73,8 +73,8 @@ TEST(YogaTest, set_children_replaces_non_common_children) {
|
|||||||
const std::vector<YGNodeRef> expectedChildren = {root_child2, root_child3};
|
const std::vector<YGNodeRef> expectedChildren = {root_child2, root_child3};
|
||||||
ASSERT_EQ(children, expectedChildren);
|
ASSERT_EQ(children, expectedChildren);
|
||||||
|
|
||||||
const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0),
|
const std::vector<YGNodeRef> owners = {
|
||||||
YGNodeGetOwner(root_child1)};
|
YGNodeGetOwner(root_child0), YGNodeGetOwner(root_child1)};
|
||||||
const std::vector<YGNodeRef> expectedOwners = {nullptr, nullptr};
|
const std::vector<YGNodeRef> expectedOwners = {nullptr, nullptr};
|
||||||
ASSERT_EQ(owners, expectedOwners);
|
ASSERT_EQ(owners, expectedOwners);
|
||||||
|
|
||||||
@@ -100,10 +100,11 @@ TEST(YogaTest, set_children_keeps_and_reorders_common_children) {
|
|||||||
root_child2, root_child1, root_child3};
|
root_child2, root_child1, root_child3};
|
||||||
ASSERT_EQ(children, expectedChildren);
|
ASSERT_EQ(children, expectedChildren);
|
||||||
|
|
||||||
const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0),
|
const std::vector<YGNodeRef> owners = {
|
||||||
YGNodeGetOwner(root_child1),
|
YGNodeGetOwner(root_child0),
|
||||||
YGNodeGetOwner(root_child2),
|
YGNodeGetOwner(root_child1),
|
||||||
YGNodeGetOwner(root_child3)};
|
YGNodeGetOwner(root_child2),
|
||||||
|
YGNodeGetOwner(root_child3)};
|
||||||
const std::vector<YGNodeRef> expectedOwners = {nullptr, root, root, root};
|
const std::vector<YGNodeRef> expectedOwners = {nullptr, root, root, root};
|
||||||
ASSERT_EQ(owners, expectedOwners);
|
ASSERT_EQ(owners, expectedOwners);
|
||||||
|
|
||||||
|
@@ -125,8 +125,8 @@ public:
|
|||||||
data.repr &= ~PERCENT_BIT;
|
data.repr &= ~PERCENT_BIT;
|
||||||
data.repr += BIAS;
|
data.repr += BIAS;
|
||||||
|
|
||||||
return YGValue{data.value,
|
return YGValue{
|
||||||
payload_.repr & 0x40000000 ? YGUnitPercent : YGUnitPoint};
|
data.value, payload_.repr & 0x40000000 ? YGUnitPercent : YGUnitPoint};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isUndefined() const noexcept {
|
bool isUndefined() const noexcept {
|
||||||
|
@@ -3531,8 +3531,8 @@ static void YGNodelayoutImpl(
|
|||||||
YGNodeBoundAxisWithinMinAndMax(
|
YGNodeBoundAxisWithinMinAndMax(
|
||||||
node,
|
node,
|
||||||
crossAxis,
|
crossAxis,
|
||||||
YGFloatOptional{totalLineCrossDim +
|
YGFloatOptional{
|
||||||
paddingAndBorderAxisCross},
|
totalLineCrossDim + paddingAndBorderAxisCross},
|
||||||
crossAxisownerSize)
|
crossAxisownerSize)
|
||||||
.unwrap()),
|
.unwrap()),
|
||||||
paddingAndBorderAxisCross),
|
paddingAndBorderAxisCross),
|
||||||
|
Reference in New Issue
Block a user