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:
committed by
Facebook GitHub Bot
parent
b52d6ce7f2
commit
b558059b74
@@ -113,7 +113,7 @@
|
||||
<div style="width: 10px;"></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>
|
||||
@@ -125,7 +125,7 @@
|
||||
<div style="width: 10px;"></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>
|
||||
|
@@ -95,28 +95,28 @@ public class YGAspectRatioTest {
|
||||
|
||||
assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(300f, root_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(197f, root_child0_child0.getLayoutHeight(), 0.0f);
|
||||
assertEquals(285f, root_child0_child0.getLayoutWidth(), 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.getLayoutY(), 0.0f);
|
||||
assertEquals(197f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(197f, root_child0_child0_child0.getLayoutHeight(), 0.0f);
|
||||
assertEquals(187f, root_child0_child0_child0.getLayoutWidth(), 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(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(98f, root_child0_child0_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(197f, root_child0_child0_child2.getLayoutHeight(), 0.0f);
|
||||
assertEquals(93f, root_child0_child0_child2.getLayoutWidth(), 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.getLayoutY(), 0.0f);
|
||||
assertEquals(98f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(197f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f);
|
||||
assertEquals(93f, root_child0_child0_child2_child0.getLayoutWidth(), 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.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.getLayoutY(), 0.0f);
|
||||
assertEquals(98f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(197f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);
|
||||
assertEquals(93f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(187f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
|
||||
@@ -141,40 +141,40 @@ public class YGAspectRatioTest {
|
||||
assertEquals(300f, root_child0.getLayoutWidth(), 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(300f, root_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(197f, root_child0_child0.getLayoutHeight(), 0.0f);
|
||||
assertEquals(285f, root_child0_child0.getLayoutWidth(), 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(197f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(197f, root_child0_child0_child0.getLayoutHeight(), 0.0f);
|
||||
assertEquals(187f, root_child0_child0_child0.getLayoutWidth(), 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(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.getLayoutY(), 0.0f);
|
||||
assertEquals(98f, root_child0_child0_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(197f, root_child0_child0_child2.getLayoutHeight(), 0.0f);
|
||||
assertEquals(93f, root_child0_child0_child2.getLayoutWidth(), 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.getLayoutY(), 0.0f);
|
||||
assertEquals(98f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(197f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f);
|
||||
assertEquals(93f, root_child0_child0_child2_child0.getLayoutWidth(), 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(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_child1.getLayoutX(), 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(197f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);
|
||||
assertEquals(93f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(187f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);
|
||||
}
|
||||
|
||||
private YogaNode createNode(YogaConfig config) {
|
||||
|
@@ -1329,7 +1329,6 @@ public class YGFlexDirectionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_flex_direction_row_reverse_border_start() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
@@ -1468,7 +1467,6 @@ public class YGFlexDirectionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_flex_direction_row_reverse_border_end() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
|
@@ -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.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0.getComputedWidth()).toBe(300);
|
||||
expect(root_child0_child0.getComputedHeight()).toBe(197);
|
||||
expect(root_child0_child0.getComputedWidth()).toBe(285);
|
||||
expect(root_child0_child0.getComputedHeight()).toBe(187);
|
||||
|
||||
expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
|
||||
expect(root_child0_child0_child0.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child0.getComputedWidth()).toBe(197);
|
||||
expect(root_child0_child0_child0.getComputedHeight()).toBe(197);
|
||||
expect(root_child0_child0_child0.getComputedWidth()).toBe(187);
|
||||
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.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.getComputedWidth()).toBe(98);
|
||||
expect(root_child0_child0_child2.getComputedHeight()).toBe(197);
|
||||
expect(root_child0_child0_child2.getComputedWidth()).toBe(93);
|
||||
expect(root_child0_child0_child2.getComputedHeight()).toBe(187);
|
||||
|
||||
expect(root_child0_child0_child2_child0.getComputedLeft()).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.getComputedHeight()).toBe(197);
|
||||
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(93);
|
||||
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.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.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(98);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(197);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(93);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(187);
|
||||
|
||||
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.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.getComputedWidth()).toBe(300);
|
||||
expect(root_child0_child0.getComputedHeight()).toBe(197);
|
||||
expect(root_child0_child0.getComputedWidth()).toBe(285);
|
||||
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.getComputedWidth()).toBe(197);
|
||||
expect(root_child0_child0_child0.getComputedHeight()).toBe(197);
|
||||
expect(root_child0_child0_child0.getComputedWidth()).toBe(187);
|
||||
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.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.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child2.getComputedWidth()).toBe(98);
|
||||
expect(root_child0_child0_child2.getComputedHeight()).toBe(197);
|
||||
expect(root_child0_child0_child2.getComputedWidth()).toBe(93);
|
||||
expect(root_child0_child0_child2.getComputedHeight()).toBe(187);
|
||||
|
||||
expect(root_child0_child0_child2_child0.getComputedLeft()).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.getComputedHeight()).toBe(197);
|
||||
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(93);
|
||||
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.getComputedWidth()).toBe(5);
|
||||
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.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(98);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(197);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(93);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(187);
|
||||
} finally {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
|
@@ -1440,7 +1440,7 @@ test('flex_direction_row_reverse_border_left', () => {
|
||||
config.free();
|
||||
}
|
||||
});
|
||||
test.skip('flex_direction_row_reverse_border_start', () => {
|
||||
test('flex_direction_row_reverse_border_start', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
@@ -1590,7 +1590,7 @@ test('flex_direction_row_reverse_border_right', () => {
|
||||
config.free();
|
||||
}
|
||||
});
|
||||
test.skip('flex_direction_row_reverse_border_end', () => {
|
||||
test('flex_direction_row_reverse_border_end', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
|
@@ -151,3 +151,145 @@ TEST(YogaTest, flex_direction_row_reverse_margin_end_errata) {
|
||||
|
||||
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);
|
||||
}
|
||||
|
@@ -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, YGNodeLayoutGetTop(root_child0_child0));
|
||||
ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root_child0_child0));
|
||||
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0));
|
||||
ASSERT_FLOAT_EQ(285, YGNodeLayoutGetWidth(root_child0_child0));
|
||||
ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(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(197, YGNodeLayoutGetHeight(root_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(187, YGNodeLayoutGetWidth(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(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(98, YGNodeLayoutGetWidth(root_child0_child0_child2));
|
||||
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child2));
|
||||
ASSERT_FLOAT_EQ(93, YGNodeLayoutGetWidth(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, YGNodeLayoutGetTop(root_child0_child0_child2_child0));
|
||||
ASSERT_FLOAT_EQ(98, YGNodeLayoutGetWidth(root_child0_child0_child2_child0));
|
||||
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child2_child0));
|
||||
ASSERT_FLOAT_EQ(93, YGNodeLayoutGetWidth(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, 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, YGNodeLayoutGetTop(root_child0_child0_child2_child0_child1));
|
||||
ASSERT_FLOAT_EQ(98, YGNodeLayoutGetWidth(root_child0_child0_child2_child0_child1));
|
||||
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child2_child0_child1));
|
||||
ASSERT_FLOAT_EQ(93, YGNodeLayoutGetWidth(root_child0_child0_child2_child0_child1));
|
||||
ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0_child2_child0_child1));
|
||||
|
||||
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, 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(300, YGNodeLayoutGetWidth(root_child0_child0));
|
||||
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0));
|
||||
ASSERT_FLOAT_EQ(285, YGNodeLayoutGetWidth(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(197, YGNodeLayoutGetWidth(root_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(187, YGNodeLayoutGetWidth(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(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, YGNodeLayoutGetTop(root_child0_child0_child2));
|
||||
ASSERT_FLOAT_EQ(98, YGNodeLayoutGetWidth(root_child0_child0_child2));
|
||||
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child2));
|
||||
ASSERT_FLOAT_EQ(93, YGNodeLayoutGetWidth(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, YGNodeLayoutGetTop(root_child0_child0_child2_child0));
|
||||
ASSERT_FLOAT_EQ(98, YGNodeLayoutGetWidth(root_child0_child0_child2_child0));
|
||||
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child2_child0));
|
||||
ASSERT_FLOAT_EQ(93, YGNodeLayoutGetWidth(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(5, YGNodeLayoutGetWidth(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, YGNodeLayoutGetTop(root_child0_child0_child2_child0_child1));
|
||||
ASSERT_FLOAT_EQ(98, YGNodeLayoutGetWidth(root_child0_child0_child2_child0_child1));
|
||||
ASSERT_FLOAT_EQ(197, YGNodeLayoutGetHeight(root_child0_child0_child2_child0_child1));
|
||||
ASSERT_FLOAT_EQ(93, YGNodeLayoutGetWidth(root_child0_child0_child2_child0_child1));
|
||||
ASSERT_FLOAT_EQ(187, YGNodeLayoutGetHeight(root_child0_child0_child2_child0_child1));
|
||||
|
||||
YGNodeFreeRecursive(root);
|
||||
|
||||
|
@@ -1336,8 +1336,6 @@ TEST(YogaTest, flex_direction_row_reverse_border_left) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, flex_direction_row_reverse_border_start) {
|
||||
GTEST_SKIP();
|
||||
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true);
|
||||
|
||||
@@ -1478,8 +1476,6 @@ TEST(YogaTest, flex_direction_row_reverse_border_right) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, flex_direction_row_reverse_border_end) {
|
||||
GTEST_SKIP();
|
||||
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true);
|
||||
|
||||
|
Reference in New Issue
Block a user