From 0fde1424f07aa5cefe4bc80c099aaa2e4c1afe62 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Fri, 3 Mar 2017 10:15:49 -0800 Subject: [PATCH] re-generate tests. Something was missed when rebasing Summary: Some of the tests were not generated correctly. most likely due to a rebase. Reviewed By: astreet Differential Revision: D4637539 fbshipit-source-id: 196478d7e5197519af9ab05e5134e6fb7d22b992 --- csharp/tests/Facebook.Yoga/YGMarginTest.cs | 16 +++++++++------ .../tests/com/facebook/yoga/YGMarginTest.java | 16 +++++++++------ .../tests/Facebook.Yoga/YGMarginTest.js | 12 +++++------ tests/YGMarginTest.cpp | 20 +++++++++++++------ 4 files changed, 40 insertions(+), 24 deletions(-) diff --git a/csharp/tests/Facebook.Yoga/YGMarginTest.cs b/csharp/tests/Facebook.Yoga/YGMarginTest.cs index fb019502..11c8fa09 100644 --- a/csharp/tests/Facebook.Yoga/YGMarginTest.cs +++ b/csharp/tests/Facebook.Yoga/YGMarginTest.cs @@ -952,20 +952,22 @@ namespace Facebook.Yoga [Test] public void Test_margin_auto_start_and_end_column() { - YogaNode root = new YogaNode(); + YogaConfig config = new YogaConfig(); + + YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; root.AlignItems = YogaAlign.Center; root.Width = 200; root.Height = 200; - YogaNode root_child0 = new YogaNode(); + YogaNode root_child0 = new YogaNode(config); root_child0.MarginStart = YogaValue.Auto(); root_child0.MarginEnd = YogaValue.Auto(); root_child0.Width = 50; root_child0.Height = 50; root.Insert(0, root_child0); - YogaNode root_child1 = new YogaNode(); + YogaNode root_child1 = new YogaNode(config); root_child1.Width = 50; root_child1.Height = 50; root.Insert(1, root_child1); @@ -1009,18 +1011,20 @@ namespace Facebook.Yoga [Test] public void Test_margin_auto_start_and_end() { - YogaNode root = new YogaNode(); + YogaConfig config = new YogaConfig(); + + YogaNode root = new YogaNode(config); root.Width = 200; root.Height = 200; - YogaNode root_child0 = new YogaNode(); + YogaNode root_child0 = new YogaNode(config); root_child0.MarginStart = YogaValue.Auto(); root_child0.MarginEnd = YogaValue.Auto(); root_child0.Width = 50; root_child0.Height = 50; root.Insert(0, root_child0); - YogaNode root_child1 = new YogaNode(); + YogaNode root_child1 = new YogaNode(config); root_child1.Width = 50; root_child1.Height = 50; root.Insert(1, root_child1); diff --git a/java/tests/com/facebook/yoga/YGMarginTest.java b/java/tests/com/facebook/yoga/YGMarginTest.java index 7ff9854d..a39d27b9 100644 --- a/java/tests/com/facebook/yoga/YGMarginTest.java +++ b/java/tests/com/facebook/yoga/YGMarginTest.java @@ -932,20 +932,22 @@ public class YGMarginTest { @Test public void test_margin_auto_start_and_end_column() { - final YogaNode root = new YogaNode(); + YogaConfig config = new YogaConfig(); + + final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); root.setAlignItems(YogaAlign.CENTER); root.setWidth(200f); root.setHeight(200f); - final YogaNode root_child0 = new YogaNode(); + final YogaNode root_child0 = new YogaNode(config); root_child0.setMarginAuto(YogaEdge.START); root_child0.setMarginAuto(YogaEdge.END); root_child0.setWidth(50f); root_child0.setHeight(50f); root.addChildAt(root_child0, 0); - final YogaNode root_child1 = new YogaNode(); + final YogaNode root_child1 = new YogaNode(config); root_child1.setWidth(50f); root_child1.setHeight(50f); root.addChildAt(root_child1, 1); @@ -988,18 +990,20 @@ public class YGMarginTest { @Test public void test_margin_auto_start_and_end() { - final YogaNode root = new YogaNode(); + YogaConfig config = new YogaConfig(); + + final YogaNode root = new YogaNode(config); root.setWidth(200f); root.setHeight(200f); - final YogaNode root_child0 = new YogaNode(); + final YogaNode root_child0 = new YogaNode(config); root_child0.setMarginAuto(YogaEdge.START); root_child0.setMarginAuto(YogaEdge.END); root_child0.setWidth(50f); root_child0.setHeight(50f); root.addChildAt(root_child0, 0); - final YogaNode root_child1 = new YogaNode(); + final YogaNode root_child1 = new YogaNode(config); root_child1.setWidth(50f); root_child1.setHeight(50f); root.addChildAt(root_child1, 1); diff --git a/javascript/tests/Facebook.Yoga/YGMarginTest.js b/javascript/tests/Facebook.Yoga/YGMarginTest.js index b6486915..40b374f4 100644 --- a/javascript/tests/Facebook.Yoga/YGMarginTest.js +++ b/javascript/tests/Facebook.Yoga/YGMarginTest.js @@ -927,20 +927,20 @@ it("margin_auto_left_and_right", function () { }); it("margin_auto_start_and_end_column", function () { try { - var root = Yoga.Node.create(); + var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(); + var root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_START, "auto"); root_child0.setMargin(Yoga.EDGE_END, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(); + var root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); @@ -985,18 +985,18 @@ it("margin_auto_start_and_end_column", function () { }); it("margin_auto_start_and_end", function () { try { - var root = Yoga.Node.create(); + var root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(); + var root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_START, "auto"); root_child0.setMargin(Yoga.EDGE_END, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(); + var root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); diff --git a/tests/YGMarginTest.cpp b/tests/YGMarginTest.cpp index e6570c37..44f2f06e 100644 --- a/tests/YGMarginTest.cpp +++ b/tests/YGMarginTest.cpp @@ -945,20 +945,22 @@ TEST(YogaTest, margin_auto_left_and_right) { } TEST(YogaTest, margin_auto_start_and_end_column) { - const YGNodeRef root = YGNodeNew(); + const YGConfigRef config = YGConfigNew(); + + const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetAlignItems(root, YGAlignCenter); YGNodeStyleSetWidth(root, 200); YGNodeStyleSetHeight(root, 200); - const YGNodeRef root_child0 = YGNodeNew(); + const YGNodeRef root_child0 = YGNodeNewWithConfig(config); YGNodeStyleSetMarginAuto(root_child0, YGEdgeStart); YGNodeStyleSetMarginAuto(root_child0, YGEdgeEnd); YGNodeStyleSetWidth(root_child0, 50); YGNodeStyleSetHeight(root_child0, 50); YGNodeInsertChild(root, root_child0, 0); - const YGNodeRef root_child1 = YGNodeNew(); + const YGNodeRef root_child1 = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root_child1, 50); YGNodeStyleSetHeight(root_child1, 50); YGNodeInsertChild(root, root_child1, 1); @@ -997,21 +999,25 @@ TEST(YogaTest, margin_auto_start_and_end_column) { ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child1)); YGNodeFreeRecursive(root); + + YGConfigFree(config); } TEST(YogaTest, margin_auto_start_and_end) { - const YGNodeRef root = YGNodeNew(); + const YGConfigRef config = YGConfigNew(); + + const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); YGNodeStyleSetHeight(root, 200); - const YGNodeRef root_child0 = YGNodeNew(); + const YGNodeRef root_child0 = YGNodeNewWithConfig(config); YGNodeStyleSetMarginAuto(root_child0, YGEdgeStart); YGNodeStyleSetMarginAuto(root_child0, YGEdgeEnd); YGNodeStyleSetWidth(root_child0, 50); YGNodeStyleSetHeight(root_child0, 50); YGNodeInsertChild(root, root_child0, 0); - const YGNodeRef root_child1 = YGNodeNew(); + const YGNodeRef root_child1 = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root_child1, 50); YGNodeStyleSetHeight(root_child1, 50); YGNodeInsertChild(root, root_child1, 1); @@ -1050,6 +1056,8 @@ TEST(YogaTest, margin_auto_start_and_end) { ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child1)); YGNodeFreeRecursive(root); + + YGConfigFree(config); } TEST(YogaTest, margin_auto_left_and_right_column_and_center) {