changed unittests to use units

This commit is contained in:
Lukas Woehrl
2016-12-11 16:43:46 +01:00
parent d950cf3d10
commit 8fbf1ddecb
14 changed files with 492 additions and 492 deletions

View File

@@ -14,15 +14,15 @@
TEST(YogaTest, absolute_layout_width_height_start_top) { TEST(YogaTest, absolute_layout_width_height_start_top) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute); YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute);
YGNodeStyleSetPosition(root_child0, YGEdgeStart, 10); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeStart, YGPx(10));
YGNodeStyleSetPosition(root_child0, YGEdgeTop, 10); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeTop, YGPx(10));
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -53,15 +53,15 @@ TEST(YogaTest, absolute_layout_width_height_start_top) {
TEST(YogaTest, absolute_layout_width_height_end_bottom) { TEST(YogaTest, absolute_layout_width_height_end_bottom) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute); YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute);
YGNodeStyleSetPosition(root_child0, YGEdgeEnd, 10); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeEnd, YGPx(10));
YGNodeStyleSetPosition(root_child0, YGEdgeBottom, 10); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeBottom, YGPx(10));
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -92,15 +92,15 @@ TEST(YogaTest, absolute_layout_width_height_end_bottom) {
TEST(YogaTest, absolute_layout_start_top_end_bottom) { TEST(YogaTest, absolute_layout_start_top_end_bottom) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute); YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute);
YGNodeStyleSetPosition(root_child0, YGEdgeStart, 10); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeStart, YGPx(10));
YGNodeStyleSetPosition(root_child0, YGEdgeTop, 10); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeTop, YGPx(10));
YGNodeStyleSetPosition(root_child0, YGEdgeEnd, 10); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeEnd, YGPx(10));
YGNodeStyleSetPosition(root_child0, YGEdgeBottom, 10); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeBottom, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -131,17 +131,17 @@ TEST(YogaTest, absolute_layout_start_top_end_bottom) {
TEST(YogaTest, absolute_layout_width_height_start_top_end_bottom) { TEST(YogaTest, absolute_layout_width_height_start_top_end_bottom) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute); YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute);
YGNodeStyleSetPosition(root_child0, YGEdgeStart, 10); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeStart, YGPx(10));
YGNodeStyleSetPosition(root_child0, YGEdgeTop, 10); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeTop, YGPx(10));
YGNodeStyleSetPosition(root_child0, YGEdgeEnd, 10); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeEnd, YGPx(10));
YGNodeStyleSetPosition(root_child0, YGEdgeBottom, 10); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeBottom, YGPx(10));
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -174,18 +174,18 @@ TEST(YogaTest, do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hi
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetOverflow(root, YGOverflowHidden); YGNodeStyleSetOverflow(root, YGOverflowHidden);
YGNodeStyleSetWidth(root, 50); YGNodeStyleSetWidthWithUnit(root, YGPx(50));
YGNodeStyleSetHeight(root, 50); YGNodeStyleSetHeightWithUnit(root, YGPx(50));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute); YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute);
YGNodeStyleSetPosition(root_child0, YGEdgeStart, 0); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeStart, YGPx(0));
YGNodeStyleSetPosition(root_child0, YGEdgeTop, 0); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeTop, YGPx(0));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child0_child0 = YGNodeNew(); const YGNodeRef root_child0_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0_child0, 100); YGNodeStyleSetWidthWithUnit(root_child0_child0, YGPx(100));
YGNodeStyleSetHeight(root_child0_child0, 100); YGNodeStyleSetHeightWithUnit(root_child0_child0, YGPx(100));
YGNodeInsertChild(root_child0, root_child0_child0, 0); YGNodeInsertChild(root_child0, root_child0_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -226,35 +226,35 @@ TEST(YogaTest, do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hi
TEST(YogaTest, absolute_layout_within_border) { TEST(YogaTest, absolute_layout_within_border) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetMargin(root, YGEdgeLeft, 10); YGNodeStyleSetMarginWithUnit(root, YGEdgeLeft, YGPx(10));
YGNodeStyleSetMargin(root, YGEdgeTop, 10); YGNodeStyleSetMarginWithUnit(root, YGEdgeTop, YGPx(10));
YGNodeStyleSetMargin(root, YGEdgeRight, 10); YGNodeStyleSetMarginWithUnit(root, YGEdgeRight, YGPx(10));
YGNodeStyleSetMargin(root, YGEdgeBottom, 10); YGNodeStyleSetMarginWithUnit(root, YGEdgeBottom, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeLeft, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeLeft, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeTop, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeTop, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeRight, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeRight, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeBottom, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeBottom, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeLeft, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeLeft, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeTop, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeTop, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeRight, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeRight, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeBottom, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeBottom, YGPx(10));
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute); YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute);
YGNodeStyleSetPosition(root_child0, YGEdgeLeft, 0); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeLeft, YGPx(0));
YGNodeStyleSetPosition(root_child0, YGEdgeTop, 0); YGNodeStyleSetPositionWithUnit(root_child0, YGEdgeTop, YGPx(0));
YGNodeStyleSetWidth(root_child0, 50); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 50); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(50));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetPositionType(root_child1, YGPositionTypeAbsolute); YGNodeStyleSetPositionType(root_child1, YGPositionTypeAbsolute);
YGNodeStyleSetPosition(root_child1, YGEdgeRight, 0); YGNodeStyleSetPositionWithUnit(root_child1, YGEdgeRight, YGPx(0));
YGNodeStyleSetPosition(root_child1, YGEdgeBottom, 0); YGNodeStyleSetPositionWithUnit(root_child1, YGEdgeBottom, YGPx(0));
YGNodeStyleSetWidth(root_child1, 50); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(50));
YGNodeStyleSetHeight(root_child1, 50); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(50));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

View File

@@ -15,32 +15,32 @@
TEST(YogaTest, align_content_flex_start) { TEST(YogaTest, align_content_flex_start) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexWrap(root, YGWrapWrap); YGNodeStyleSetFlexWrap(root, YGWrapWrap);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 50); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 50); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(50));
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 50); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(50));
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
const YGNodeRef root_child3 = YGNodeNew(); const YGNodeRef root_child3 = YGNodeNew();
YGNodeStyleSetWidth(root_child3, 50); YGNodeStyleSetWidthWithUnit(root_child3, YGPx(50));
YGNodeStyleSetHeight(root_child3, 10); YGNodeStyleSetHeightWithUnit(root_child3, YGPx(10));
YGNodeInsertChild(root, root_child3, 3); YGNodeInsertChild(root, root_child3, 3);
const YGNodeRef root_child4 = YGNodeNew(); const YGNodeRef root_child4 = YGNodeNew();
YGNodeStyleSetWidth(root_child4, 50); YGNodeStyleSetWidthWithUnit(root_child4, YGPx(50));
YGNodeStyleSetHeight(root_child4, 10); YGNodeStyleSetHeightWithUnit(root_child4, YGPx(10));
YGNodeInsertChild(root, root_child4, 4); YGNodeInsertChild(root, root_child4, 4);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -113,32 +113,32 @@ TEST(YogaTest, align_content_flex_end) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetAlignContent(root, YGAlignFlexEnd); YGNodeStyleSetAlignContent(root, YGAlignFlexEnd);
YGNodeStyleSetFlexWrap(root, YGWrapWrap); YGNodeStyleSetFlexWrap(root, YGWrapWrap);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 50); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 50); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(50));
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 50); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(50));
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
const YGNodeRef root_child3 = YGNodeNew(); const YGNodeRef root_child3 = YGNodeNew();
YGNodeStyleSetWidth(root_child3, 50); YGNodeStyleSetWidthWithUnit(root_child3, YGPx(50));
YGNodeStyleSetHeight(root_child3, 10); YGNodeStyleSetHeightWithUnit(root_child3, YGPx(10));
YGNodeInsertChild(root, root_child3, 3); YGNodeInsertChild(root, root_child3, 3);
const YGNodeRef root_child4 = YGNodeNew(); const YGNodeRef root_child4 = YGNodeNew();
YGNodeStyleSetWidth(root_child4, 50); YGNodeStyleSetWidthWithUnit(root_child4, YGPx(50));
YGNodeStyleSetHeight(root_child4, 10); YGNodeStyleSetHeightWithUnit(root_child4, YGPx(10));
YGNodeInsertChild(root, root_child4, 4); YGNodeInsertChild(root, root_child4, 4);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -211,32 +211,32 @@ TEST(YogaTest, align_content_center) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetAlignContent(root, YGAlignCenter); YGNodeStyleSetAlignContent(root, YGAlignCenter);
YGNodeStyleSetFlexWrap(root, YGWrapWrap); YGNodeStyleSetFlexWrap(root, YGWrapWrap);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 50); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 50); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(50));
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 50); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(50));
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
const YGNodeRef root_child3 = YGNodeNew(); const YGNodeRef root_child3 = YGNodeNew();
YGNodeStyleSetWidth(root_child3, 50); YGNodeStyleSetWidthWithUnit(root_child3, YGPx(50));
YGNodeStyleSetHeight(root_child3, 10); YGNodeStyleSetHeightWithUnit(root_child3, YGPx(10));
YGNodeInsertChild(root, root_child3, 3); YGNodeInsertChild(root, root_child3, 3);
const YGNodeRef root_child4 = YGNodeNew(); const YGNodeRef root_child4 = YGNodeNew();
YGNodeStyleSetWidth(root_child4, 50); YGNodeStyleSetWidthWithUnit(root_child4, YGPx(50));
YGNodeStyleSetHeight(root_child4, 10); YGNodeStyleSetHeightWithUnit(root_child4, YGPx(10));
YGNodeInsertChild(root, root_child4, 4); YGNodeInsertChild(root, root_child4, 4);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -309,27 +309,27 @@ TEST(YogaTest, align_content_stretch) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetAlignContent(root, YGAlignStretch); YGNodeStyleSetAlignContent(root, YGAlignStretch);
YGNodeStyleSetFlexWrap(root, YGWrapWrap); YGNodeStyleSetFlexWrap(root, YGWrapWrap);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 50); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(50));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 50); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(50));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 50); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(50));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
const YGNodeRef root_child3 = YGNodeNew(); const YGNodeRef root_child3 = YGNodeNew();
YGNodeStyleSetWidth(root_child3, 50); YGNodeStyleSetWidthWithUnit(root_child3, YGPx(50));
YGNodeInsertChild(root, root_child3, 3); YGNodeInsertChild(root, root_child3, 3);
const YGNodeRef root_child4 = YGNodeNew(); const YGNodeRef root_child4 = YGNodeNew();
YGNodeStyleSetWidth(root_child4, 50); YGNodeStyleSetWidthWithUnit(root_child4, YGPx(50));
YGNodeInsertChild(root, root_child4, 4); YGNodeInsertChild(root, root_child4, 4);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

View File

@@ -14,11 +14,11 @@
TEST(YogaTest, align_items_stretch) { TEST(YogaTest, align_items_stretch) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -50,12 +50,12 @@ TEST(YogaTest, align_items_stretch) {
TEST(YogaTest, align_items_center) { TEST(YogaTest, align_items_center) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetAlignItems(root, YGAlignCenter); YGNodeStyleSetAlignItems(root, YGAlignCenter);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -87,12 +87,12 @@ TEST(YogaTest, align_items_center) {
TEST(YogaTest, align_items_flex_start) { TEST(YogaTest, align_items_flex_start) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetAlignItems(root, YGAlignFlexStart); YGNodeStyleSetAlignItems(root, YGAlignFlexStart);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -124,12 +124,12 @@ TEST(YogaTest, align_items_flex_start) {
TEST(YogaTest, align_items_flex_end) { TEST(YogaTest, align_items_flex_end) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetAlignItems(root, YGAlignFlexEnd); YGNodeStyleSetAlignItems(root, YGAlignFlexEnd);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

View File

@@ -14,13 +14,13 @@
TEST(YogaTest, align_self_center) { TEST(YogaTest, align_self_center) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetAlignSelf(root_child0, YGAlignCenter); YGNodeStyleSetAlignSelf(root_child0, YGAlignCenter);
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -51,13 +51,13 @@ TEST(YogaTest, align_self_center) {
TEST(YogaTest, align_self_flex_end) { TEST(YogaTest, align_self_flex_end) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetAlignSelf(root_child0, YGAlignFlexEnd); YGNodeStyleSetAlignSelf(root_child0, YGAlignFlexEnd);
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -88,13 +88,13 @@ TEST(YogaTest, align_self_flex_end) {
TEST(YogaTest, align_self_flex_start) { TEST(YogaTest, align_self_flex_start) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetAlignSelf(root_child0, YGAlignFlexStart); YGNodeStyleSetAlignSelf(root_child0, YGAlignFlexStart);
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -126,13 +126,13 @@ TEST(YogaTest, align_self_flex_start) {
TEST(YogaTest, align_self_flex_end_override_flex_start) { TEST(YogaTest, align_self_flex_end_override_flex_start) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetAlignItems(root, YGAlignFlexStart); YGNodeStyleSetAlignItems(root, YGAlignFlexStart);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetAlignSelf(root_child0, YGAlignFlexEnd); YGNodeStyleSetAlignSelf(root_child0, YGAlignFlexEnd);
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

View File

@@ -14,10 +14,10 @@
TEST(YogaTest, border_no_size) { TEST(YogaTest, border_no_size) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetBorder(root, YGEdgeLeft, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeLeft, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeTop, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeTop, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeRight, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeRight, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeBottom, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeBottom, YGPx(10));
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
@@ -37,14 +37,14 @@ TEST(YogaTest, border_no_size) {
TEST(YogaTest, border_container_match_child) { TEST(YogaTest, border_container_match_child) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetBorder(root, YGEdgeLeft, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeLeft, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeTop, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeTop, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeRight, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeRight, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeBottom, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeBottom, YGPx(10));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -75,16 +75,16 @@ TEST(YogaTest, border_container_match_child) {
TEST(YogaTest, border_flex_child) { TEST(YogaTest, border_flex_child) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetBorder(root, YGEdgeLeft, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeLeft, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeTop, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeTop, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeRight, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeRight, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeBottom, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeBottom, YGPx(10));
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -115,15 +115,15 @@ TEST(YogaTest, border_flex_child) {
TEST(YogaTest, border_stretch_child) { TEST(YogaTest, border_stretch_child) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetBorder(root, YGEdgeLeft, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeLeft, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeTop, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeTop, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeRight, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeRight, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeBottom, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeBottom, YGPx(10));
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -156,15 +156,15 @@ TEST(YogaTest, border_center_child) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetJustifyContent(root, YGJustifyCenter); YGNodeStyleSetJustifyContent(root, YGJustifyCenter);
YGNodeStyleSetAlignItems(root, YGAlignCenter); YGNodeStyleSetAlignItems(root, YGAlignCenter);
YGNodeStyleSetBorder(root, YGEdgeStart, 10); YGNodeStyleSetBorderWithUnit(root, YGEdgeStart, YGPx(10));
YGNodeStyleSetBorder(root, YGEdgeEnd, 20); YGNodeStyleSetBorderWithUnit(root, YGEdgeEnd, YGPx(20));
YGNodeStyleSetBorder(root, YGEdgeBottom, 20); YGNodeStyleSetBorderWithUnit(root, YGEdgeBottom, YGPx(20));
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

View File

@@ -14,18 +14,18 @@
TEST(YogaTest, flex_direction_column_no_height) { TEST(YogaTest, flex_direction_column_no_height) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -77,18 +77,18 @@ TEST(YogaTest, flex_direction_column_no_height) {
TEST(YogaTest, flex_direction_row_no_width) { TEST(YogaTest, flex_direction_row_no_width) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 10); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 10); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -139,19 +139,19 @@ TEST(YogaTest, flex_direction_row_no_width) {
TEST(YogaTest, flex_direction_column) { TEST(YogaTest, flex_direction_column) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -203,19 +203,19 @@ TEST(YogaTest, flex_direction_column) {
TEST(YogaTest, flex_direction_row) { TEST(YogaTest, flex_direction_row) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 10); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 10); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -267,19 +267,19 @@ TEST(YogaTest, flex_direction_row) {
TEST(YogaTest, flex_direction_column_reverse) { TEST(YogaTest, flex_direction_column_reverse) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionColumnReverse); YGNodeStyleSetFlexDirection(root, YGFlexDirectionColumnReverse);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -331,19 +331,19 @@ TEST(YogaTest, flex_direction_column_reverse) {
TEST(YogaTest, flex_direction_row_reverse) { TEST(YogaTest, flex_direction_row_reverse) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRowReverse); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRowReverse);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 10); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 10); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

View File

@@ -14,12 +14,12 @@
TEST(YogaTest, flex_basis_flex_grow_column) { TEST(YogaTest, flex_basis_flex_grow_column) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetFlexBasis(root_child0, 50); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(50));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
@@ -65,12 +65,12 @@ TEST(YogaTest, flex_basis_flex_grow_column) {
TEST(YogaTest, flex_basis_flex_grow_row) { TEST(YogaTest, flex_basis_flex_grow_row) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetFlexBasis(root_child0, 50); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(50));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
@@ -115,16 +115,16 @@ TEST(YogaTest, flex_basis_flex_grow_row) {
TEST(YogaTest, flex_basis_flex_shrink_column) { TEST(YogaTest, flex_basis_flex_shrink_column) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexShrink(root_child0, 1); YGNodeStyleSetFlexShrink(root_child0, 1);
YGNodeStyleSetFlexBasis(root_child0, 100); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(100));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetFlexBasis(root_child1, 50); YGNodeStyleSetFlexBasisWithUnit(root_child1, YGPx(50));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -166,16 +166,16 @@ TEST(YogaTest, flex_basis_flex_shrink_column) {
TEST(YogaTest, flex_basis_flex_shrink_row) { TEST(YogaTest, flex_basis_flex_shrink_row) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexShrink(root_child0, 1); YGNodeStyleSetFlexShrink(root_child0, 1);
YGNodeStyleSetFlexBasis(root_child0, 100); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(100));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetFlexBasis(root_child1, 50); YGNodeStyleSetFlexBasisWithUnit(root_child1, YGPx(50));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -216,22 +216,22 @@ TEST(YogaTest, flex_basis_flex_shrink_row) {
TEST(YogaTest, flex_shrink_to_zero) { TEST(YogaTest, flex_shrink_to_zero) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetHeight(root, 75); YGNodeStyleSetHeightWithUnit(root, YGPx(75));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 50); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 50); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(50));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetFlexShrink(root_child1, 1); YGNodeStyleSetFlexShrink(root_child1, 1);
YGNodeStyleSetWidth(root_child1, 50); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(50));
YGNodeStyleSetHeight(root_child1, 50); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(50));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 50); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(50));
YGNodeStyleSetHeight(root_child2, 50); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(50));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -282,23 +282,23 @@ TEST(YogaTest, flex_shrink_to_zero) {
TEST(YogaTest, flex_basis_overrides_main_size) { TEST(YogaTest, flex_basis_overrides_main_size) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetFlexBasis(root_child0, 50); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 20); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(20));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child1, 1); YGNodeStyleSetFlexGrow(root_child1, 1);
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child2, 1); YGNodeStyleSetFlexGrow(root_child2, 1);
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -349,8 +349,8 @@ TEST(YogaTest, flex_basis_overrides_main_size) {
TEST(YogaTest, flex_grow_shrink_at_most) { TEST(YogaTest, flex_grow_shrink_at_most) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);

View File

@@ -15,26 +15,26 @@
TEST(YogaTest, wrap_column) { TEST(YogaTest, wrap_column) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexWrap(root, YGWrapWrap); YGNodeStyleSetFlexWrap(root, YGWrapWrap);
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 30); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(30));
YGNodeStyleSetHeight(root_child0, 30); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(30));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 30); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(30));
YGNodeStyleSetHeight(root_child1, 30); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(30));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 30); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(30));
YGNodeStyleSetHeight(root_child2, 30); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(30));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
const YGNodeRef root_child3 = YGNodeNew(); const YGNodeRef root_child3 = YGNodeNew();
YGNodeStyleSetWidth(root_child3, 30); YGNodeStyleSetWidthWithUnit(root_child3, YGPx(30));
YGNodeStyleSetHeight(root_child3, 30); YGNodeStyleSetHeightWithUnit(root_child3, YGPx(30));
YGNodeInsertChild(root, root_child3, 3); YGNodeInsertChild(root, root_child3, 3);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -97,26 +97,26 @@ TEST(YogaTest, wrap_row) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetFlexWrap(root, YGWrapWrap); YGNodeStyleSetFlexWrap(root, YGWrapWrap);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 30); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(30));
YGNodeStyleSetHeight(root_child0, 30); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(30));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 30); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(30));
YGNodeStyleSetHeight(root_child1, 30); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(30));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 30); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(30));
YGNodeStyleSetHeight(root_child2, 30); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(30));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
const YGNodeRef root_child3 = YGNodeNew(); const YGNodeRef root_child3 = YGNodeNew();
YGNodeStyleSetWidth(root_child3, 30); YGNodeStyleSetWidthWithUnit(root_child3, YGPx(30));
YGNodeStyleSetHeight(root_child3, 30); YGNodeStyleSetHeightWithUnit(root_child3, YGPx(30));
YGNodeInsertChild(root, root_child3, 3); YGNodeInsertChild(root, root_child3, 3);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -180,26 +180,26 @@ TEST(YogaTest, wrap_row_align_items_flex_end) {
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetAlignItems(root, YGAlignFlexEnd); YGNodeStyleSetAlignItems(root, YGAlignFlexEnd);
YGNodeStyleSetFlexWrap(root, YGWrapWrap); YGNodeStyleSetFlexWrap(root, YGWrapWrap);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 30); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(30));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 30); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(30));
YGNodeStyleSetHeight(root_child1, 20); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(20));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 30); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(30));
YGNodeStyleSetHeight(root_child2, 30); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(30));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
const YGNodeRef root_child3 = YGNodeNew(); const YGNodeRef root_child3 = YGNodeNew();
YGNodeStyleSetWidth(root_child3, 30); YGNodeStyleSetWidthWithUnit(root_child3, YGPx(30));
YGNodeStyleSetHeight(root_child3, 30); YGNodeStyleSetHeightWithUnit(root_child3, YGPx(30));
YGNodeInsertChild(root, root_child3, 3); YGNodeInsertChild(root, root_child3, 3);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -263,26 +263,26 @@ TEST(YogaTest, wrap_row_align_items_center) {
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetAlignItems(root, YGAlignCenter); YGNodeStyleSetAlignItems(root, YGAlignCenter);
YGNodeStyleSetFlexWrap(root, YGWrapWrap); YGNodeStyleSetFlexWrap(root, YGWrapWrap);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 30); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(30));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 30); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(30));
YGNodeStyleSetHeight(root_child1, 20); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(20));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 30); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(30));
YGNodeStyleSetHeight(root_child2, 30); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(30));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
const YGNodeRef root_child3 = YGNodeNew(); const YGNodeRef root_child3 = YGNodeNew();
YGNodeStyleSetWidth(root_child3, 30); YGNodeStyleSetWidthWithUnit(root_child3, YGPx(30));
YGNodeStyleSetHeight(root_child3, 30); YGNodeStyleSetHeightWithUnit(root_child3, YGPx(30));
YGNodeInsertChild(root, root_child3, 3); YGNodeInsertChild(root, root_child3, 3);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

View File

@@ -15,19 +15,19 @@
TEST(YogaTest, justify_content_row_flex_start) { TEST(YogaTest, justify_content_row_flex_start) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 102); YGNodeStyleSetWidthWithUnit(root, YGPx(102));
YGNodeStyleSetHeight(root, 102); YGNodeStyleSetHeightWithUnit(root, YGPx(102));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 10); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 10); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -80,19 +80,19 @@ TEST(YogaTest, justify_content_row_flex_end) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd);
YGNodeStyleSetWidth(root, 102); YGNodeStyleSetWidthWithUnit(root, YGPx(102));
YGNodeStyleSetHeight(root, 102); YGNodeStyleSetHeightWithUnit(root, YGPx(102));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 10); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 10); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -145,19 +145,19 @@ TEST(YogaTest, justify_content_row_center) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetJustifyContent(root, YGJustifyCenter); YGNodeStyleSetJustifyContent(root, YGJustifyCenter);
YGNodeStyleSetWidth(root, 102); YGNodeStyleSetWidthWithUnit(root, YGPx(102));
YGNodeStyleSetHeight(root, 102); YGNodeStyleSetHeightWithUnit(root, YGPx(102));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 10); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 10); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -210,19 +210,19 @@ TEST(YogaTest, justify_content_row_space_between) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetJustifyContent(root, YGJustifySpaceBetween); YGNodeStyleSetJustifyContent(root, YGJustifySpaceBetween);
YGNodeStyleSetWidth(root, 102); YGNodeStyleSetWidthWithUnit(root, YGPx(102));
YGNodeStyleSetHeight(root, 102); YGNodeStyleSetHeightWithUnit(root, YGPx(102));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 10); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 10); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -275,19 +275,19 @@ TEST(YogaTest, justify_content_row_space_around) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetJustifyContent(root, YGJustifySpaceAround); YGNodeStyleSetJustifyContent(root, YGJustifySpaceAround);
YGNodeStyleSetWidth(root, 102); YGNodeStyleSetWidthWithUnit(root, YGPx(102));
YGNodeStyleSetHeight(root, 102); YGNodeStyleSetHeightWithUnit(root, YGPx(102));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 10); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 10); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -338,18 +338,18 @@ TEST(YogaTest, justify_content_row_space_around) {
TEST(YogaTest, justify_content_column_flex_start) { TEST(YogaTest, justify_content_column_flex_start) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 102); YGNodeStyleSetWidthWithUnit(root, YGPx(102));
YGNodeStyleSetHeight(root, 102); YGNodeStyleSetHeightWithUnit(root, YGPx(102));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -401,19 +401,19 @@ TEST(YogaTest, justify_content_column_flex_start) {
TEST(YogaTest, justify_content_column_flex_end) { TEST(YogaTest, justify_content_column_flex_end) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd);
YGNodeStyleSetWidth(root, 102); YGNodeStyleSetWidthWithUnit(root, YGPx(102));
YGNodeStyleSetHeight(root, 102); YGNodeStyleSetHeightWithUnit(root, YGPx(102));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -465,19 +465,19 @@ TEST(YogaTest, justify_content_column_flex_end) {
TEST(YogaTest, justify_content_column_center) { TEST(YogaTest, justify_content_column_center) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetJustifyContent(root, YGJustifyCenter); YGNodeStyleSetJustifyContent(root, YGJustifyCenter);
YGNodeStyleSetWidth(root, 102); YGNodeStyleSetWidthWithUnit(root, YGPx(102));
YGNodeStyleSetHeight(root, 102); YGNodeStyleSetHeightWithUnit(root, YGPx(102));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -529,19 +529,19 @@ TEST(YogaTest, justify_content_column_center) {
TEST(YogaTest, justify_content_column_space_between) { TEST(YogaTest, justify_content_column_space_between) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetJustifyContent(root, YGJustifySpaceBetween); YGNodeStyleSetJustifyContent(root, YGJustifySpaceBetween);
YGNodeStyleSetWidth(root, 102); YGNodeStyleSetWidthWithUnit(root, YGPx(102));
YGNodeStyleSetHeight(root, 102); YGNodeStyleSetHeightWithUnit(root, YGPx(102));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -593,19 +593,19 @@ TEST(YogaTest, justify_content_column_space_between) {
TEST(YogaTest, justify_content_column_space_around) { TEST(YogaTest, justify_content_column_space_around) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetJustifyContent(root, YGJustifySpaceAround); YGNodeStyleSetJustifyContent(root, YGJustifySpaceAround);
YGNodeStyleSetWidth(root, 102); YGNodeStyleSetWidthWithUnit(root, YGPx(102));
YGNodeStyleSetHeight(root, 102); YGNodeStyleSetHeightWithUnit(root, YGPx(102));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

View File

@@ -27,49 +27,49 @@ TEST(YogaTest, assert_default_values) {
ASSERT_EQ(YGOverflowVisible, YGNodeStyleGetOverflow(root)); ASSERT_EQ(YGOverflowVisible, YGNodeStyleGetOverflow(root));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetFlexGrow(root)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetFlexGrow(root));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetFlexShrink(root)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetFlexShrink(root));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetFlexBasis(root))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetFlexBasis(root)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetPosition(root, YGEdgeLeft))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetPosition(root, YGEdgeLeft)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetPosition(root, YGEdgeTop))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetPosition(root, YGEdgeTop)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetPosition(root, YGEdgeRight))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetPosition(root, YGEdgeRight)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetPosition(root, YGEdgeBottom))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetPosition(root, YGEdgeBottom)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetPosition(root, YGEdgeStart))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetPosition(root, YGEdgeStart)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetPosition(root, YGEdgeEnd))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetPosition(root, YGEdgeEnd)));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetMargin(root, YGEdgeLeft)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetMargin(root, YGEdgeLeft));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetMargin(root, YGEdgeTop)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetMargin(root, YGEdgeTop));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetMargin(root, YGEdgeRight)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetMargin(root, YGEdgeRight));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetMargin(root, YGEdgeBottom)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetMargin(root, YGEdgeBottom));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetMargin(root, YGEdgeStart))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetMargin(root, YGEdgeStart)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetMargin(root, YGEdgeEnd))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetMargin(root, YGEdgeEnd)));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetPadding(root, YGEdgeLeft)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetPadding(root, YGEdgeLeft));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetPadding(root, YGEdgeTop)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetPadding(root, YGEdgeTop));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetPadding(root, YGEdgeRight)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetPadding(root, YGEdgeRight));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetPadding(root, YGEdgeBottom)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetPadding(root, YGEdgeBottom));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetPadding(root, YGEdgeStart))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetPadding(root, YGEdgeStart)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetPadding(root, YGEdgeEnd))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetPadding(root, YGEdgeEnd)));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetBorder(root, YGEdgeLeft)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetBorder(root, YGEdgeLeft));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetBorder(root, YGEdgeTop)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetBorder(root, YGEdgeTop));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetBorder(root, YGEdgeRight)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetBorder(root, YGEdgeRight));
ASSERT_FLOAT_EQ(0, YGNodeStyleGetBorder(root, YGEdgeBottom)); ASSERT_FLOAT_EQ(0, YGNodeStyleGetBorder(root, YGEdgeBottom));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetBorder(root, YGEdgeStart))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetBorder(root, YGEdgeStart)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetBorder(root, YGEdgeEnd))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetBorder(root, YGEdgeEnd)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetWidth(root))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetWidth(root)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetHeight(root))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetHeight(root)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetMinWidth(root))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetMinWidth(root)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetMinHeight(root))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetMinHeight(root)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetMaxWidth(root))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetMaxWidth(root)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeStyleGetMaxHeight(root))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeStyleGetMaxHeight(root)));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetRight(root)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetRight(root));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetBottom(root)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetBottom(root));
ASSERT_TRUE(YGValueIsUndefined(YGNodeLayoutGetWidth(root))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeLayoutGetWidth(root)));
ASSERT_TRUE(YGValueIsUndefined(YGNodeLayoutGetHeight(root))); ASSERT_TRUE(YGValueIsUndefinedf(YGNodeLayoutGetHeight(root)));
ASSERT_EQ(YGDirectionInherit, YGNodeLayoutGetDirection(root)); ASSERT_EQ(YGDirectionInherit, YGNodeLayoutGetDirection(root));
YGNodeFreeRecursive(root); YGNodeFreeRecursive(root);

View File

@@ -15,12 +15,12 @@
TEST(YogaTest, margin_start) { TEST(YogaTest, margin_start) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetMargin(root_child0, YGEdgeStart, 10); YGNodeStyleSetMarginWithUnit(root_child0, YGEdgeStart, YGPx(10));
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -51,12 +51,12 @@ TEST(YogaTest, margin_start) {
TEST(YogaTest, margin_top) { TEST(YogaTest, margin_top) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetMargin(root_child0, YGEdgeTop, 10); YGNodeStyleSetMarginWithUnit(root_child0, YGEdgeTop, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -89,12 +89,12 @@ TEST(YogaTest, margin_end) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetMargin(root_child0, YGEdgeEnd, 10); YGNodeStyleSetMarginWithUnit(root_child0, YGEdgeEnd, YGPx(10));
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -126,12 +126,12 @@ TEST(YogaTest, margin_end) {
TEST(YogaTest, margin_bottom) { TEST(YogaTest, margin_bottom) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetMargin(root_child0, YGEdgeBottom, 10); YGNodeStyleSetMarginWithUnit(root_child0, YGEdgeBottom, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -163,12 +163,12 @@ TEST(YogaTest, margin_bottom) {
TEST(YogaTest, margin_and_flex_row) { TEST(YogaTest, margin_and_flex_row) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMargin(root_child0, YGEdgeStart, 10); YGNodeStyleSetMarginWithUnit(root_child0, YGEdgeStart, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -199,12 +199,12 @@ TEST(YogaTest, margin_and_flex_row) {
TEST(YogaTest, margin_and_flex_column) { TEST(YogaTest, margin_and_flex_column) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMargin(root_child0, YGEdgeTop, 10); YGNodeStyleSetMarginWithUnit(root_child0, YGEdgeTop, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -236,12 +236,12 @@ TEST(YogaTest, margin_and_flex_column) {
TEST(YogaTest, margin_and_stretch_row) { TEST(YogaTest, margin_and_stretch_row) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMargin(root_child0, YGEdgeTop, 10); YGNodeStyleSetMarginWithUnit(root_child0, YGEdgeTop, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -272,12 +272,12 @@ TEST(YogaTest, margin_and_stretch_row) {
TEST(YogaTest, margin_and_stretch_column) { TEST(YogaTest, margin_and_stretch_column) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMargin(root_child0, YGEdgeStart, 10); YGNodeStyleSetMarginWithUnit(root_child0, YGEdgeStart, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -309,8 +309,8 @@ TEST(YogaTest, margin_and_stretch_column) {
TEST(YogaTest, margin_with_sibling_row) { TEST(YogaTest, margin_with_sibling_row) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
@@ -358,8 +358,8 @@ TEST(YogaTest, margin_with_sibling_row) {
TEST(YogaTest, margin_with_sibling_column) { TEST(YogaTest, margin_with_sibling_column) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);

View File

@@ -14,12 +14,12 @@
TEST(YogaTest, max_width) { TEST(YogaTest, max_width) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetMaxWidth(root_child0, 50); YGNodeStyleSetMaxWidthWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -51,12 +51,12 @@ TEST(YogaTest, max_width) {
TEST(YogaTest, max_height) { TEST(YogaTest, max_height) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetMaxHeight(root_child0, 50); YGNodeStyleSetMaxHeightWithUnit(root_child0, YGPx(50));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -87,12 +87,12 @@ TEST(YogaTest, max_height) {
TEST(YogaTest, min_height) { TEST(YogaTest, min_height) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMinHeight(root_child0, 60); YGNodeStyleSetMinHeightWithUnit(root_child0, YGPx(60));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
@@ -138,12 +138,12 @@ TEST(YogaTest, min_height) {
TEST(YogaTest, min_width) { TEST(YogaTest, min_width) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMinWidth(root_child0, 60); YGNodeStyleSetMinWidthWithUnit(root_child0, YGPx(60));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
@@ -189,13 +189,13 @@ TEST(YogaTest, min_width) {
TEST(YogaTest, justify_content_min_max) { TEST(YogaTest, justify_content_min_max) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetJustifyContent(root, YGJustifyCenter); YGNodeStyleSetJustifyContent(root, YGJustifyCenter);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetMinHeight(root, 100); YGNodeStyleSetMinHeightWithUnit(root, YGPx(100));
YGNodeStyleSetMaxHeight(root, 200); YGNodeStyleSetMaxHeightWithUnit(root, YGPx(200));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 60); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(60));
YGNodeStyleSetHeight(root_child0, 60); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(60));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -227,13 +227,13 @@ TEST(YogaTest, justify_content_min_max) {
TEST(YogaTest, align_items_min_max) { TEST(YogaTest, align_items_min_max) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetAlignItems(root, YGAlignCenter); YGNodeStyleSetAlignItems(root, YGAlignCenter);
YGNodeStyleSetMinWidth(root, 100); YGNodeStyleSetMinWidthWithUnit(root, YGPx(100));
YGNodeStyleSetMaxWidth(root, 200); YGNodeStyleSetMaxWidthWithUnit(root, YGPx(200));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 60); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(60));
YGNodeStyleSetHeight(root_child0, 60); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(60));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -265,22 +265,22 @@ TEST(YogaTest, align_items_min_max) {
TEST(YogaTest, justify_content_overflow_min_max) { TEST(YogaTest, justify_content_overflow_min_max) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetJustifyContent(root, YGJustifyCenter); YGNodeStyleSetJustifyContent(root, YGJustifyCenter);
YGNodeStyleSetMinHeight(root, 100); YGNodeStyleSetMinHeightWithUnit(root, YGPx(100));
YGNodeStyleSetMaxHeight(root, 110); YGNodeStyleSetMaxHeightWithUnit(root, YGPx(110));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 50); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 50); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(50));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetWidth(root_child1, 50); YGNodeStyleSetWidthWithUnit(root_child1, YGPx(50));
YGNodeStyleSetHeight(root_child1, 50); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(50));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetWidth(root_child2, 50); YGNodeStyleSetWidthWithUnit(root_child2, YGPx(50));
YGNodeStyleSetHeight(root_child2, 50); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(50));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -331,17 +331,17 @@ TEST(YogaTest, justify_content_overflow_min_max) {
TEST(YogaTest, flex_grow_within_max_width) { TEST(YogaTest, flex_grow_within_max_width) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 200); YGNodeStyleSetWidthWithUnit(root, YGPx(200));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexDirection(root_child0, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root_child0, YGFlexDirectionRow);
YGNodeStyleSetMaxWidth(root_child0, 100); YGNodeStyleSetMaxWidthWithUnit(root_child0, YGPx(100));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child0_child0 = YGNodeNew(); const YGNodeRef root_child0_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0_child0, 1); YGNodeStyleSetFlexGrow(root_child0_child0, 1);
YGNodeStyleSetHeight(root_child0_child0, 20); YGNodeStyleSetHeightWithUnit(root_child0_child0, YGPx(20));
YGNodeInsertChild(root_child0, root_child0_child0, 0); YGNodeInsertChild(root_child0, root_child0_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -382,17 +382,17 @@ TEST(YogaTest, flex_grow_within_max_width) {
TEST(YogaTest, flex_grow_within_constrained_max_width) { TEST(YogaTest, flex_grow_within_constrained_max_width) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 200); YGNodeStyleSetWidthWithUnit(root, YGPx(200));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexDirection(root_child0, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root_child0, YGFlexDirectionRow);
YGNodeStyleSetMaxWidth(root_child0, 300); YGNodeStyleSetMaxWidthWithUnit(root_child0, YGPx(300));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child0_child0 = YGNodeNew(); const YGNodeRef root_child0_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0_child0, 1); YGNodeStyleSetFlexGrow(root_child0_child0, 1);
YGNodeStyleSetHeight(root_child0_child0, 20); YGNodeStyleSetHeightWithUnit(root_child0_child0, YGPx(20));
YGNodeInsertChild(root_child0, root_child0_child0, 0); YGNodeInsertChild(root_child0, root_child0_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

View File

@@ -14,10 +14,10 @@
TEST(YogaTest, padding_no_size) { TEST(YogaTest, padding_no_size) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetPadding(root, YGEdgeLeft, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeLeft, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeTop, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeTop, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeRight, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeRight, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeBottom, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeBottom, YGPx(10));
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
@@ -37,14 +37,14 @@ TEST(YogaTest, padding_no_size) {
TEST(YogaTest, padding_container_match_child) { TEST(YogaTest, padding_container_match_child) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetPadding(root, YGEdgeLeft, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeLeft, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeTop, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeTop, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeRight, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeRight, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeBottom, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeBottom, YGPx(10));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -75,16 +75,16 @@ TEST(YogaTest, padding_container_match_child) {
TEST(YogaTest, padding_flex_child) { TEST(YogaTest, padding_flex_child) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetPadding(root, YGEdgeLeft, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeLeft, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeTop, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeTop, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeRight, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeRight, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeBottom, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeBottom, YGPx(10));
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -115,15 +115,15 @@ TEST(YogaTest, padding_flex_child) {
TEST(YogaTest, padding_stretch_child) { TEST(YogaTest, padding_stretch_child) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetPadding(root, YGEdgeLeft, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeLeft, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeTop, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeTop, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeRight, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeRight, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeBottom, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeBottom, YGPx(10));
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -156,15 +156,15 @@ TEST(YogaTest, padding_center_child) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetJustifyContent(root, YGJustifyCenter); YGNodeStyleSetJustifyContent(root, YGJustifyCenter);
YGNodeStyleSetAlignItems(root, YGAlignCenter); YGNodeStyleSetAlignItems(root, YGAlignCenter);
YGNodeStyleSetPadding(root, YGEdgeStart, 10); YGNodeStyleSetPaddingWithUnit(root, YGEdgeStart, YGPx(10));
YGNodeStyleSetPadding(root, YGEdgeEnd, 20); YGNodeStyleSetPaddingWithUnit(root, YGEdgeEnd, YGPx(20));
YGNodeStyleSetPadding(root, YGEdgeBottom, 20); YGNodeStyleSetPaddingWithUnit(root, YGEdgeBottom, YGPx(20));
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 10); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(10));
YGNodeStyleSetHeight(root_child0, 10); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(10));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -197,16 +197,16 @@ TEST(YogaTest, child_with_padding_align_end) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd);
YGNodeStyleSetAlignItems(root, YGAlignFlexEnd); YGNodeStyleSetAlignItems(root, YGAlignFlexEnd);
YGNodeStyleSetWidth(root, 200); YGNodeStyleSetWidthWithUnit(root, YGPx(200));
YGNodeStyleSetHeight(root, 200); YGNodeStyleSetHeightWithUnit(root, YGPx(200));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetPadding(root_child0, YGEdgeLeft, 20); YGNodeStyleSetPaddingWithUnit(root_child0, YGEdgeLeft, YGPx(20));
YGNodeStyleSetPadding(root_child0, YGEdgeTop, 20); YGNodeStyleSetPaddingWithUnit(root_child0, YGEdgeTop, YGPx(20));
YGNodeStyleSetPadding(root_child0, YGEdgeRight, 20); YGNodeStyleSetPaddingWithUnit(root_child0, YGEdgeRight, YGPx(20));
YGNodeStyleSetPadding(root_child0, YGEdgeBottom, 20); YGNodeStyleSetPaddingWithUnit(root_child0, YGEdgeBottom, YGPx(20));
YGNodeStyleSetWidth(root_child0, 100); YGNodeStyleSetWidthWithUnit(root_child0, YGPx(100));
YGNodeStyleSetHeight(root_child0, 100); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(100));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

View File

@@ -17,8 +17,8 @@ TEST(YogaTest, rounding_flex_basis_flex_grow_row_width_of_100) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
@@ -85,8 +85,8 @@ TEST(YogaTest, rounding_flex_basis_flex_grow_row_prime_number_width) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 113); YGNodeStyleSetWidthWithUnit(root, YGPx(113));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
@@ -181,20 +181,20 @@ TEST(YogaTest, rounding_flex_basis_flex_shrink_row) {
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 101); YGNodeStyleSetWidthWithUnit(root, YGPx(101));
YGNodeStyleSetHeight(root, 100); YGNodeStyleSetHeightWithUnit(root, YGPx(100));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexShrink(root_child0, 1); YGNodeStyleSetFlexShrink(root_child0, 1);
YGNodeStyleSetFlexBasis(root_child0, 100); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(100));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetFlexBasis(root_child1, 25); YGNodeStyleSetFlexBasisWithUnit(root_child1, YGPx(25));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetFlexBasis(root_child2, 25); YGNodeStyleSetFlexBasisWithUnit(root_child2, YGPx(25));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -249,23 +249,23 @@ TEST(YogaTest, rounding_flex_basis_overrides_main_size) {
YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true); YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true);
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 113); YGNodeStyleSetHeightWithUnit(root, YGPx(113));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetFlexBasis(root_child0, 50); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 20); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(20));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child1, 1); YGNodeStyleSetFlexGrow(root_child1, 1);
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child2, 1); YGNodeStyleSetFlexGrow(root_child2, 1);
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -320,23 +320,23 @@ TEST(YogaTest, rounding_total_fractial) {
YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true); YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true);
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 87.4f); YGNodeStyleSetWidthWithUnit(root, YGPx(87.4f));
YGNodeStyleSetHeight(root, 113.4f); YGNodeStyleSetHeightWithUnit(root, YGPx(113.4f));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 0.7f); YGNodeStyleSetFlexGrow(root_child0, 0.7f);
YGNodeStyleSetFlexBasis(root_child0, 50.3f); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(50.3f));
YGNodeStyleSetHeight(root_child0, 20.3f); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(20.3f));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child1, 1.6f); YGNodeStyleSetFlexGrow(root_child1, 1.6f);
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child2, 1.1f); YGNodeStyleSetFlexGrow(root_child2, 1.1f);
YGNodeStyleSetHeight(root_child2, 10.7f); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10.7f));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -391,37 +391,37 @@ TEST(YogaTest, rounding_total_fractial_nested) {
YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true); YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true);
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 87.4f); YGNodeStyleSetWidthWithUnit(root, YGPx(87.4f));
YGNodeStyleSetHeight(root, 113.4f); YGNodeStyleSetHeightWithUnit(root, YGPx(113.4f));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 0.7f); YGNodeStyleSetFlexGrow(root_child0, 0.7f);
YGNodeStyleSetFlexBasis(root_child0, 50.3f); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(50.3f));
YGNodeStyleSetHeight(root_child0, 20.3f); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(20.3f));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child0_child0 = YGNodeNew(); const YGNodeRef root_child0_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0_child0, 1); YGNodeStyleSetFlexGrow(root_child0_child0, 1);
YGNodeStyleSetFlexBasis(root_child0_child0, 0.3f); YGNodeStyleSetFlexBasisWithUnit(root_child0_child0, YGPx(0.3f));
YGNodeStyleSetPosition(root_child0_child0, YGEdgeBottom, 13.3f); YGNodeStyleSetPositionWithUnit(root_child0_child0, YGEdgeBottom, YGPx(13.3f));
YGNodeStyleSetHeight(root_child0_child0, 9.9f); YGNodeStyleSetHeightWithUnit(root_child0_child0, YGPx(9.9f));
YGNodeInsertChild(root_child0, root_child0_child0, 0); YGNodeInsertChild(root_child0, root_child0_child0, 0);
const YGNodeRef root_child0_child1 = YGNodeNew(); const YGNodeRef root_child0_child1 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0_child1, 4); YGNodeStyleSetFlexGrow(root_child0_child1, 4);
YGNodeStyleSetFlexBasis(root_child0_child1, 0.3f); YGNodeStyleSetFlexBasisWithUnit(root_child0_child1, YGPx(0.3f));
YGNodeStyleSetPosition(root_child0_child1, YGEdgeTop, 13.3f); YGNodeStyleSetPositionWithUnit(root_child0_child1, YGEdgeTop, YGPx(13.3f));
YGNodeStyleSetHeight(root_child0_child1, 1.1f); YGNodeStyleSetHeightWithUnit(root_child0_child1, YGPx(1.1f));
YGNodeInsertChild(root_child0, root_child0_child1, 1); YGNodeInsertChild(root_child0, root_child0_child1, 1);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child1, 1.6f); YGNodeStyleSetFlexGrow(root_child1, 1.6f);
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child2, 1.1f); YGNodeStyleSetFlexGrow(root_child2, 1.1f);
YGNodeStyleSetHeight(root_child2, 10.7f); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10.7f));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -496,23 +496,23 @@ TEST(YogaTest, rounding_fractial_input_1) {
YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true); YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true);
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 113.4f); YGNodeStyleSetHeightWithUnit(root, YGPx(113.4f));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetFlexBasis(root_child0, 50); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 20); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(20));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child1, 1); YGNodeStyleSetFlexGrow(root_child1, 1);
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child2, 1); YGNodeStyleSetFlexGrow(root_child2, 1);
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -567,23 +567,23 @@ TEST(YogaTest, rounding_fractial_input_2) {
YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true); YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true);
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 113.6f); YGNodeStyleSetHeightWithUnit(root, YGPx(113.6f));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetFlexBasis(root_child0, 50); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 20); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(20));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child1, 1); YGNodeStyleSetFlexGrow(root_child1, 1);
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child2, 1); YGNodeStyleSetFlexGrow(root_child2, 1);
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -638,24 +638,24 @@ TEST(YogaTest, rounding_fractial_input_3) {
YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true); YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true);
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetPosition(root, YGEdgeTop, 0.3f); YGNodeStyleSetPositionWithUnit(root, YGEdgeTop, YGPx(0.3f));
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 113.4f); YGNodeStyleSetHeightWithUnit(root, YGPx(113.4f));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetFlexBasis(root_child0, 50); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 20); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(20));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child1, 1); YGNodeStyleSetFlexGrow(root_child1, 1);
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child2, 1); YGNodeStyleSetFlexGrow(root_child2, 1);
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -710,24 +710,24 @@ TEST(YogaTest, rounding_fractial_input_4) {
YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true); YGSetExperimentalFeatureEnabled(YGExperimentalFeatureRounding, true);
const YGNodeRef root = YGNodeNew(); const YGNodeRef root = YGNodeNew();
YGNodeStyleSetPosition(root, YGEdgeTop, 0.7f); YGNodeStyleSetPositionWithUnit(root, YGEdgeTop, YGPx(0.7f));
YGNodeStyleSetWidth(root, 100); YGNodeStyleSetWidthWithUnit(root, YGPx(100));
YGNodeStyleSetHeight(root, 113.4f); YGNodeStyleSetHeightWithUnit(root, YGPx(113.4f));
const YGNodeRef root_child0 = YGNodeNew(); const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1); YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetFlexBasis(root_child0, 50); YGNodeStyleSetFlexBasisWithUnit(root_child0, YGPx(50));
YGNodeStyleSetHeight(root_child0, 20); YGNodeStyleSetHeightWithUnit(root_child0, YGPx(20));
YGNodeInsertChild(root, root_child0, 0); YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNew(); const YGNodeRef root_child1 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child1, 1); YGNodeStyleSetFlexGrow(root_child1, 1);
YGNodeStyleSetHeight(root_child1, 10); YGNodeStyleSetHeightWithUnit(root_child1, YGPx(10));
YGNodeInsertChild(root, root_child1, 1); YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNew(); const YGNodeRef root_child2 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child2, 1); YGNodeStyleSetFlexGrow(root_child2, 1);
YGNodeStyleSetHeight(root_child2, 10); YGNodeStyleSetHeightWithUnit(root_child2, YGPx(10));
YGNodeInsertChild(root, root_child2, 2); YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);