Revamp tests for row reverse + border after fix

Summary: this is fixed now so we can turn it on

Reviewed By: NickGerleman

Differential Revision: D50348206

fbshipit-source-id: 61c2a72164c6f0ee91b1b5b576d3f129e8cfbe40
This commit is contained in:
Joe Vilches
2023-10-17 20:30:16 -07:00
committed by Facebook GitHub Bot
parent b52d6ce7f2
commit b558059b74
8 changed files with 230 additions and 94 deletions

View File

@@ -113,7 +113,7 @@
<div style="width: 10px;"></div> <div style="width: 10px;"></div>
</div> </div>
<div id="flex_direction_row_reverse_border_start" data-disabled="true" style="height: 100px; width: 100px; flex-direction: row-reverse; border-start-width: 100px;"> <div id="flex_direction_row_reverse_border_start" style="height: 100px; width: 100px; flex-direction: row-reverse; border-start-width: 100px;">
<div style="width: 10px;"></div> <div style="width: 10px;"></div>
<div style="width: 10px;"></div> <div style="width: 10px;"></div>
<div style="width: 10px;"></div> <div style="width: 10px;"></div>
@@ -125,7 +125,7 @@
<div style="width: 10px;"></div> <div style="width: 10px;"></div>
</div> </div>
<div id="flex_direction_row_reverse_border_end" data-disabled="true" style="height: 100px; width: 100px; flex-direction: row-reverse; border-end-width: 100px;"> <div id="flex_direction_row_reverse_border_end" style="height: 100px; width: 100px; flex-direction: row-reverse; border-end-width: 100px;">
<div style="width: 10px;"></div> <div style="width: 10px;"></div>
<div style="width: 10px;"></div> <div style="width: 10px;"></div>
<div style="width: 10px;"></div> <div style="width: 10px;"></div>

View File

@@ -95,28 +95,28 @@ public class YGAspectRatioTest {
assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f); assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
assertEquals(300f, root_child0_child0.getLayoutWidth(), 0.0f); assertEquals(285f, root_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0.getLayoutHeight(), 0.0f); assertEquals(187f, root_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(0f, root_child0_child0_child0.getLayoutX(), 0.0f); assertEquals(0f, root_child0_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child0.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0_child0.getLayoutY(), 0.0f);
assertEquals(197f, root_child0_child0_child0.getLayoutWidth(), 0.0f); assertEquals(187f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child0.getLayoutHeight(), 0.0f); assertEquals(187f, root_child0_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(197f, root_child0_child0_child1.getLayoutX(), 0.0f); assertEquals(187f, root_child0_child0_child1.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child1.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0_child1.getLayoutY(), 0.0f);
assertEquals(5f, root_child0_child0_child1.getLayoutWidth(), 0.0f); assertEquals(5f, root_child0_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child1.getLayoutHeight(), 0.0f); assertEquals(187f, root_child0_child0_child1.getLayoutHeight(), 0.0f);
assertEquals(202f, root_child0_child0_child2.getLayoutX(), 0.0f); assertEquals(192f, root_child0_child0_child2.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0_child2.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2.getLayoutWidth(), 0.0f); assertEquals(93f, root_child0_child0_child2.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2.getLayoutHeight(), 0.0f); assertEquals(187f, root_child0_child0_child2.getLayoutHeight(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0.getLayoutX(), 0.0f); assertEquals(0f, root_child0_child0_child2_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0_child2_child0.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f); assertEquals(93f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f); assertEquals(187f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutX(), 0.0f); assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutY(), 0.0f);
@@ -125,8 +125,8 @@ public class YGAspectRatioTest {
assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutX(), 0.0f); assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f); assertEquals(93f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f); assertEquals(187f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);
root.setDirection(YogaDirection.RTL); root.setDirection(YogaDirection.RTL);
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
@@ -141,40 +141,40 @@ public class YGAspectRatioTest {
assertEquals(300f, root_child0.getLayoutWidth(), 0.0f); assertEquals(300f, root_child0.getLayoutWidth(), 0.0f);
assertEquals(300f, root_child0.getLayoutHeight(), 0.0f); assertEquals(300f, root_child0.getLayoutHeight(), 0.0f);
assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f); assertEquals(30f, root_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
assertEquals(300f, root_child0_child0.getLayoutWidth(), 0.0f); assertEquals(285f, root_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0.getLayoutHeight(), 0.0f); assertEquals(187f, root_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(103f, root_child0_child0_child0.getLayoutX(), 0.0f); assertEquals(98f, root_child0_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child0.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0_child0.getLayoutY(), 0.0f);
assertEquals(197f, root_child0_child0_child0.getLayoutWidth(), 0.0f); assertEquals(187f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child0.getLayoutHeight(), 0.0f); assertEquals(187f, root_child0_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(98f, root_child0_child0_child1.getLayoutX(), 0.0f); assertEquals(93f, root_child0_child0_child1.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child1.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0_child1.getLayoutY(), 0.0f);
assertEquals(5f, root_child0_child0_child1.getLayoutWidth(), 0.0f); assertEquals(5f, root_child0_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child1.getLayoutHeight(), 0.0f); assertEquals(187f, root_child0_child0_child1.getLayoutHeight(), 0.0f);
assertEquals(0f, root_child0_child0_child2.getLayoutX(), 0.0f); assertEquals(0f, root_child0_child0_child2.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0_child2.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2.getLayoutWidth(), 0.0f); assertEquals(93f, root_child0_child0_child2.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2.getLayoutHeight(), 0.0f); assertEquals(187f, root_child0_child0_child2.getLayoutHeight(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0.getLayoutX(), 0.0f); assertEquals(0f, root_child0_child0_child2_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0_child2_child0.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f); assertEquals(93f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f); assertEquals(187f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2_child0_child0.getLayoutX(), 0.0f); assertEquals(88f, root_child0_child0_child2_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutY(), 0.0f);
assertEquals(5f, root_child0_child0_child2_child0_child0.getLayoutWidth(), 0.0f); assertEquals(5f, root_child0_child0_child2_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutHeight(), 0.0f); assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutX(), 0.0f); assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutY(), 0.0f); assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f); assertEquals(93f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f); assertEquals(187f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);
} }
private YogaNode createNode(YogaConfig config) { private YogaNode createNode(YogaConfig config) {

View File

@@ -1329,7 +1329,6 @@ public class YGFlexDirectionTest {
} }
@Test @Test
@Ignore
public void test_flex_direction_row_reverse_border_start() { public void test_flex_direction_row_reverse_border_start() {
YogaConfig config = YogaConfigFactory.create(); YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
@@ -1468,7 +1467,6 @@ public class YGFlexDirectionTest {
} }
@Test @Test
@Ignore
public void test_flex_direction_row_reverse_border_end() { public void test_flex_direction_row_reverse_border_end() {
YogaConfig config = YogaConfigFactory.create(); YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

View File

@@ -95,28 +95,28 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {
expect(root_child0_child0.getComputedLeft()).toBe(0); expect(root_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0.getComputedTop()).toBe(0); expect(root_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0.getComputedWidth()).toBe(300); expect(root_child0_child0.getComputedWidth()).toBe(285);
expect(root_child0_child0.getComputedHeight()).toBe(197); expect(root_child0_child0.getComputedHeight()).toBe(187);
expect(root_child0_child0_child0.getComputedLeft()).toBe(0); expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0_child0.getComputedTop()).toBe(0); expect(root_child0_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child0.getComputedWidth()).toBe(197); expect(root_child0_child0_child0.getComputedWidth()).toBe(187);
expect(root_child0_child0_child0.getComputedHeight()).toBe(197); expect(root_child0_child0_child0.getComputedHeight()).toBe(187);
expect(root_child0_child0_child1.getComputedLeft()).toBe(197); expect(root_child0_child0_child1.getComputedLeft()).toBe(187);
expect(root_child0_child0_child1.getComputedTop()).toBe(0); expect(root_child0_child0_child1.getComputedTop()).toBe(0);
expect(root_child0_child0_child1.getComputedWidth()).toBe(5); expect(root_child0_child0_child1.getComputedWidth()).toBe(5);
expect(root_child0_child0_child1.getComputedHeight()).toBe(197); expect(root_child0_child0_child1.getComputedHeight()).toBe(187);
expect(root_child0_child0_child2.getComputedLeft()).toBe(202); expect(root_child0_child0_child2.getComputedLeft()).toBe(192);
expect(root_child0_child0_child2.getComputedTop()).toBe(0); expect(root_child0_child0_child2.getComputedTop()).toBe(0);
expect(root_child0_child0_child2.getComputedWidth()).toBe(98); expect(root_child0_child0_child2.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2.getComputedHeight()).toBe(197); expect(root_child0_child0_child2.getComputedHeight()).toBe(187);
expect(root_child0_child0_child2_child0.getComputedLeft()).toBe(0); expect(root_child0_child0_child2_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0.getComputedTop()).toBe(0); expect(root_child0_child0_child2_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(98); expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(197); expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(187);
expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(0); expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0_child0.getComputedTop()).toBe(0); expect(root_child0_child0_child2_child0_child0.getComputedTop()).toBe(0);
@@ -125,8 +125,8 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {
expect(root_child0_child0_child2_child0_child1.getComputedLeft()).toBe(0); expect(root_child0_child0_child2_child0_child1.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedTop()).toBe(0); expect(root_child0_child0_child2_child0_child1.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(98); expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(197); expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(187);
root.calculateLayout(undefined, undefined, Direction.RTL); root.calculateLayout(undefined, undefined, Direction.RTL);
@@ -140,40 +140,40 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {
expect(root_child0.getComputedWidth()).toBe(300); expect(root_child0.getComputedWidth()).toBe(300);
expect(root_child0.getComputedHeight()).toBe(300); expect(root_child0.getComputedHeight()).toBe(300);
expect(root_child0_child0.getComputedLeft()).toBe(0); expect(root_child0_child0.getComputedLeft()).toBe(30);
expect(root_child0_child0.getComputedTop()).toBe(0); expect(root_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0.getComputedWidth()).toBe(300); expect(root_child0_child0.getComputedWidth()).toBe(285);
expect(root_child0_child0.getComputedHeight()).toBe(197); expect(root_child0_child0.getComputedHeight()).toBe(187);
expect(root_child0_child0_child0.getComputedLeft()).toBe(103); expect(root_child0_child0_child0.getComputedLeft()).toBe(98);
expect(root_child0_child0_child0.getComputedTop()).toBe(0); expect(root_child0_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child0.getComputedWidth()).toBe(197); expect(root_child0_child0_child0.getComputedWidth()).toBe(187);
expect(root_child0_child0_child0.getComputedHeight()).toBe(197); expect(root_child0_child0_child0.getComputedHeight()).toBe(187);
expect(root_child0_child0_child1.getComputedLeft()).toBe(98); expect(root_child0_child0_child1.getComputedLeft()).toBe(93);
expect(root_child0_child0_child1.getComputedTop()).toBe(0); expect(root_child0_child0_child1.getComputedTop()).toBe(0);
expect(root_child0_child0_child1.getComputedWidth()).toBe(5); expect(root_child0_child0_child1.getComputedWidth()).toBe(5);
expect(root_child0_child0_child1.getComputedHeight()).toBe(197); expect(root_child0_child0_child1.getComputedHeight()).toBe(187);
expect(root_child0_child0_child2.getComputedLeft()).toBe(0); expect(root_child0_child0_child2.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2.getComputedTop()).toBe(0); expect(root_child0_child0_child2.getComputedTop()).toBe(0);
expect(root_child0_child0_child2.getComputedWidth()).toBe(98); expect(root_child0_child0_child2.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2.getComputedHeight()).toBe(197); expect(root_child0_child0_child2.getComputedHeight()).toBe(187);
expect(root_child0_child0_child2_child0.getComputedLeft()).toBe(0); expect(root_child0_child0_child2_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0.getComputedTop()).toBe(0); expect(root_child0_child0_child2_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(98); expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(197); expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(187);
expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(93); expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(88);
expect(root_child0_child0_child2_child0_child0.getComputedTop()).toBe(0); expect(root_child0_child0_child2_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0_child0.getComputedWidth()).toBe(5); expect(root_child0_child0_child2_child0_child0.getComputedWidth()).toBe(5);
expect(root_child0_child0_child2_child0_child0.getComputedHeight()).toBe(0); expect(root_child0_child0_child2_child0_child0.getComputedHeight()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedLeft()).toBe(0); expect(root_child0_child0_child2_child0_child1.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedTop()).toBe(0); expect(root_child0_child0_child2_child0_child1.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(98); expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(197); expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(187);
} finally { } finally {
if (typeof root !== 'undefined') { if (typeof root !== 'undefined') {
root.freeRecursive(); root.freeRecursive();

View File

@@ -1440,7 +1440,7 @@ test('flex_direction_row_reverse_border_left', () => {
config.free(); config.free();
} }
}); });
test.skip('flex_direction_row_reverse_border_start', () => { test('flex_direction_row_reverse_border_start', () => {
const config = Yoga.Config.create(); const config = Yoga.Config.create();
let root; let root;
@@ -1590,7 +1590,7 @@ test('flex_direction_row_reverse_border_right', () => {
config.free(); config.free();
} }
}); });
test.skip('flex_direction_row_reverse_border_end', () => { test('flex_direction_row_reverse_border_end', () => {
const config = Yoga.Config.create(); const config = Yoga.Config.create();
let root; let root;

View File

@@ -151,3 +151,145 @@ TEST(YogaTest, flex_direction_row_reverse_margin_end_errata) {
YGConfigFree(config); YGConfigFree(config);
} }
TEST(YogaTest, flex_direction_row_reverse_border_start_errata) {
const YGConfigRef config = YGConfigNew();
YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true);
YGConfigSetErrata(config, YGErrata::YGErrataStartingEndingEdgeFromFlexDirection);
const YGNodeRef root = YGNodeNewWithConfig(config);
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRowReverse);
YGNodeStyleSetBorder(root, YGEdgeStart, 100);
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
YGNodeStyleSetWidth(root_child0, 10);
YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
YGNodeStyleSetWidth(root_child1, 10);
YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNewWithConfig(config);
YGNodeStyleSetWidth(root_child2, 10);
YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root));
ASSERT_FLOAT_EQ(-10, YGNodeLayoutGetLeft(root_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetWidth(root_child0));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child0));
ASSERT_FLOAT_EQ(-20, YGNodeLayoutGetLeft(root_child1));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child1));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetWidth(root_child1));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child1));
ASSERT_FLOAT_EQ(-30, YGNodeLayoutGetLeft(root_child2));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child2));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetWidth(root_child2));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child2));
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL);
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetLeft(root_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetWidth(root_child0));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child0));
ASSERT_FLOAT_EQ(110, YGNodeLayoutGetLeft(root_child1));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child1));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetWidth(root_child1));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child1));
ASSERT_FLOAT_EQ(120, YGNodeLayoutGetLeft(root_child2));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child2));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetWidth(root_child2));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child2));
YGNodeFreeRecursive(root);
YGConfigFree(config);
}
TEST(YogaTest, flex_direction_row_reverse_border_end_errata) {
const YGConfigRef config = YGConfigNew();
YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true);
YGConfigSetErrata(config, YGErrata::YGErrataStartingEndingEdgeFromFlexDirection);
const YGNodeRef root = YGNodeNewWithConfig(config);
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRowReverse);
YGNodeStyleSetBorder(root, YGEdgeEnd, 100);
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
YGNodeStyleSetWidth(root_child0, 10);
YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
YGNodeStyleSetWidth(root_child1, 10);
YGNodeInsertChild(root, root_child1, 1);
const YGNodeRef root_child2 = YGNodeNewWithConfig(config);
YGNodeStyleSetWidth(root_child2, 10);
YGNodeInsertChild(root, root_child2, 2);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root));
ASSERT_FLOAT_EQ(90, YGNodeLayoutGetLeft(root_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetWidth(root_child0));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child0));
ASSERT_FLOAT_EQ(80, YGNodeLayoutGetLeft(root_child1));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child1));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetWidth(root_child1));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child1));
ASSERT_FLOAT_EQ(70, YGNodeLayoutGetLeft(root_child2));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child2));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetWidth(root_child2));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child2));
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL);
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetWidth(root_child0));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child0));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetLeft(root_child1));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child1));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetWidth(root_child1));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child1));
ASSERT_FLOAT_EQ(20, YGNodeLayoutGetLeft(root_child2));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child2));
ASSERT_FLOAT_EQ(10, YGNodeLayoutGetWidth(root_child2));
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child2));
YGNodeFreeRecursive(root);
YGConfigFree(config);
}

View File

@@ -80,28 +80,28 @@ TEST(YogaTest, aspect_ratio_does_not_stretch_cross_axis_dim) {
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0));
ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root_child0_child0)); ASSERT_FLOAT_EQ(285, YGNodeLayoutGetWidth(root_child0_child0));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child0));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetWidth(root_child0_child0_child0)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetWidth(root_child0_child0_child0));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child0)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0_child0));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetLeft(root_child0_child0_child1)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetLeft(root_child0_child0_child1));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child1)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child1));
ASSERT_FLOAT_EQ(5, YGNodeLayoutGetWidth(root_child0_child0_child1)); ASSERT_FLOAT_EQ(5, YGNodeLayoutGetWidth(root_child0_child0_child1));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child1)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0_child1));
ASSERT_FLOAT_EQ(202, YGNodeLayoutGetLeft(root_child0_child0_child2)); ASSERT_FLOAT_EQ(192, YGNodeLayoutGetLeft(root_child0_child0_child2));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2));
ASSERT_FLOAT_EQ(98, YGNodeLayoutGetWidth(root_child0_child0_child2)); ASSERT_FLOAT_EQ(93, YGNodeLayoutGetWidth(root_child0_child0_child2));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child2)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0_child2));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child2_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child2_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2_child0));
ASSERT_FLOAT_EQ(98, YGNodeLayoutGetWidth(root_child0_child0_child2_child0)); ASSERT_FLOAT_EQ(93, YGNodeLayoutGetWidth(root_child0_child0_child2_child0));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child2_child0)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0_child2_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child2_child0_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child2_child0_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2_child0_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2_child0_child0));
@@ -110,8 +110,8 @@ TEST(YogaTest, aspect_ratio_does_not_stretch_cross_axis_dim) {
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child2_child0_child1)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child2_child0_child1));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2_child0_child1)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2_child0_child1));
ASSERT_FLOAT_EQ(98, YGNodeLayoutGetWidth(root_child0_child0_child2_child0_child1)); ASSERT_FLOAT_EQ(93, YGNodeLayoutGetWidth(root_child0_child0_child2_child0_child1));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child2_child0_child1)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0_child2_child0_child1));
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL);
@@ -125,40 +125,40 @@ TEST(YogaTest, aspect_ratio_does_not_stretch_cross_axis_dim) {
ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root_child0)); ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root_child0));
ASSERT_FLOAT_EQ(300, YGNodeLayoutGetHeight(root_child0)); ASSERT_FLOAT_EQ(300, YGNodeLayoutGetHeight(root_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0)); ASSERT_FLOAT_EQ(30, YGNodeLayoutGetLeft(root_child0_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0));
ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root_child0_child0)); ASSERT_FLOAT_EQ(285, YGNodeLayoutGetWidth(root_child0_child0));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0));
ASSERT_FLOAT_EQ(103, YGNodeLayoutGetLeft(root_child0_child0_child0)); ASSERT_FLOAT_EQ(98, YGNodeLayoutGetLeft(root_child0_child0_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child0));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetWidth(root_child0_child0_child0)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetWidth(root_child0_child0_child0));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child0)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0_child0));
ASSERT_FLOAT_EQ(98, YGNodeLayoutGetLeft(root_child0_child0_child1)); ASSERT_FLOAT_EQ(93, YGNodeLayoutGetLeft(root_child0_child0_child1));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child1)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child1));
ASSERT_FLOAT_EQ(5, YGNodeLayoutGetWidth(root_child0_child0_child1)); ASSERT_FLOAT_EQ(5, YGNodeLayoutGetWidth(root_child0_child0_child1));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child1)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0_child1));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child2)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child2));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2));
ASSERT_FLOAT_EQ(98, YGNodeLayoutGetWidth(root_child0_child0_child2)); ASSERT_FLOAT_EQ(93, YGNodeLayoutGetWidth(root_child0_child0_child2));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child2)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0_child2));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child2_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child2_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2_child0));
ASSERT_FLOAT_EQ(98, YGNodeLayoutGetWidth(root_child0_child0_child2_child0)); ASSERT_FLOAT_EQ(93, YGNodeLayoutGetWidth(root_child0_child0_child2_child0));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child2_child0)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0_child2_child0));
ASSERT_FLOAT_EQ(93, YGNodeLayoutGetLeft(root_child0_child0_child2_child0_child0)); ASSERT_FLOAT_EQ(88, YGNodeLayoutGetLeft(root_child0_child0_child2_child0_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2_child0_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2_child0_child0));
ASSERT_FLOAT_EQ(5, YGNodeLayoutGetWidth(root_child0_child0_child2_child0_child0)); ASSERT_FLOAT_EQ(5, YGNodeLayoutGetWidth(root_child0_child0_child2_child0_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root_child0_child0_child2_child0_child0)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root_child0_child0_child2_child0_child0));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child2_child0_child1)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child2_child0_child1));
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2_child0_child1)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child2_child0_child1));
ASSERT_FLOAT_EQ(98, YGNodeLayoutGetWidth(root_child0_child0_child2_child0_child1)); ASSERT_FLOAT_EQ(93, YGNodeLayoutGetWidth(root_child0_child0_child2_child0_child1));
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child2_child0_child1)); ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0_child2_child0_child1));
YGNodeFreeRecursive(root); YGNodeFreeRecursive(root);

View File

@@ -1336,8 +1336,6 @@ TEST(YogaTest, flex_direction_row_reverse_border_left) {
} }
TEST(YogaTest, flex_direction_row_reverse_border_start) { TEST(YogaTest, flex_direction_row_reverse_border_start) {
GTEST_SKIP();
const YGConfigRef config = YGConfigNew(); const YGConfigRef config = YGConfigNew();
YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true);
@@ -1478,8 +1476,6 @@ TEST(YogaTest, flex_direction_row_reverse_border_right) {
} }
TEST(YogaTest, flex_direction_row_reverse_border_end) { TEST(YogaTest, flex_direction_row_reverse_border_end) {
GTEST_SKIP();
const YGConfigRef config = YGConfigNew(); const YGConfigRef config = YGConfigNew();
YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true);