Fix tests of splitted config feature

Summary:
The following PR fixes the tests used in the javascript port (it modifies gentest.rb).

These changes don't yet pass, it seems something is segfaulting somewhere. I have to check if it comes from nbind, the yoga library, or the node bridge itself. There's also some fails on the browser build, but it might be the same issue.
Closes https://github.com/facebook/yoga/pull/487

Reviewed By: emilsjolander

Differential Revision: D4778870

Pulled By: astreet

fbshipit-source-id: 936fbca564ec89738c78e50c4402c53eb6867dec
This commit is contained in:
Maël Nison
2017-03-28 10:28:53 -07:00
committed by Facebook Github Bot
parent 91a34bb875
commit 36f6fa9861
28 changed files with 928 additions and 117 deletions

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("absolute_layout_width_height_start_top", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -51,9 +53,13 @@ it("absolute_layout_width_height_start_top", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_width_height_end_bottom", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -93,9 +99,13 @@ it("absolute_layout_width_height_end_bottom", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_start_top_end_bottom", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -135,9 +145,13 @@ it("absolute_layout_start_top_end_bottom", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_width_height_start_top_end_bottom", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -179,9 +193,13 @@ it("absolute_layout_width_height_start_top_end_bottom", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -236,9 +254,13 @@ it("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_within_border", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setMargin(Yoga.EDGE_LEFT, 10);
@@ -308,9 +330,13 @@ it("absolute_layout_within_border", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_align_items_and_justify_content_center", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -351,9 +377,13 @@ it("absolute_layout_align_items_and_justify_content_center", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_align_items_and_justify_content_flex_end", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
@@ -394,9 +424,13 @@ it("absolute_layout_align_items_and_justify_content_flex_end", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_justify_content_center", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -436,9 +470,13 @@ it("absolute_layout_justify_content_center", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_align_items_center", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_CENTER);
@@ -478,9 +516,13 @@ it("absolute_layout_align_items_center", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_align_items_center_on_child_only", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexGrow(1);
@@ -520,9 +562,13 @@ it("absolute_layout_align_items_center_on_child_only", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_align_items_and_justify_content_center_and_top_position", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -564,9 +610,13 @@ it("absolute_layout_align_items_and_justify_content_center_and_top_position", fu
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_align_items_and_justify_content_center_and_bottom_position", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -608,9 +658,13 @@ it("absolute_layout_align_items_and_justify_content_center_and_bottom_position",
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_align_items_and_justify_content_center_and_left_position", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -652,9 +706,13 @@ it("absolute_layout_align_items_and_justify_content_center_and_left_position", f
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("absolute_layout_align_items_and_justify_content_center_and_right_position", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -696,5 +754,7 @@ it("absolute_layout_align_items_and_justify_content_center_and_right_position",
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("align_content_flex_start", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -110,9 +112,13 @@ it("align_content_flex_start", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_flex_start_without_height_on_children", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexWrap(Yoga.WRAP_WRAP);
@@ -207,9 +213,13 @@ it("align_content_flex_start_without_height_on_children", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_flex_start_with_flex", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexWrap(Yoga.WRAP_WRAP);
@@ -310,9 +320,13 @@ it("align_content_flex_start_with_flex", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_flex_end", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignContent(Yoga.ALIGN_FLEX_END);
@@ -411,9 +425,13 @@ it("align_content_flex_end", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignContent(Yoga.ALIGN_STRETCH);
@@ -507,9 +525,13 @@ it("align_content_stretch", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_spacebetween", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -609,9 +631,13 @@ it("align_content_spacebetween", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_spacearound", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -711,9 +737,13 @@ it("align_content_spacearound", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -808,9 +838,13 @@ it("align_content_stretch_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch_row_with_children", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -921,9 +955,13 @@ it("align_content_stretch_row_with_children", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch_row_with_flex", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1024,9 +1062,13 @@ it("align_content_stretch_row_with_flex", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch_row_with_flex_no_shrink", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1126,9 +1168,13 @@ it("align_content_stretch_row_with_flex_no_shrink", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch_row_with_margin", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1231,9 +1277,13 @@ it("align_content_stretch_row_with_margin", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch_row_with_padding", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1336,9 +1386,13 @@ it("align_content_stretch_row_with_padding", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch_row_with_single_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1391,9 +1445,13 @@ it("align_content_stretch_row_with_single_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch_row_with_fixed_height", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1489,9 +1547,13 @@ it("align_content_stretch_row_with_fixed_height", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch_row_with_max_height", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1587,9 +1649,13 @@ it("align_content_stretch_row_with_max_height", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch_row_with_min_height", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1685,9 +1751,13 @@ it("align_content_stretch_row_with_min_height", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignContent(Yoga.ALIGN_STRETCH);
@@ -1800,9 +1870,13 @@ it("align_content_stretch_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_content_stretch_is_not_overriding_align_items", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignContent(Yoga.ALIGN_STRETCH);
@@ -1857,5 +1931,7 @@ it("align_content_stretch_is_not_overriding_align_items", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("align_items_stretch", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -47,9 +49,13 @@ it("align_items_stretch", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_items_center", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_CENTER);
@@ -87,9 +93,13 @@ it("align_items_center", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_items_flex_start", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_FLEX_START);
@@ -127,9 +137,13 @@ it("align_items_flex_start", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_items_flex_end", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_FLEX_END);
@@ -167,9 +181,13 @@ it("align_items_flex_end", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -223,9 +241,13 @@ it("align_baseline", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -294,9 +316,13 @@ it("align_baseline_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_child_multiline", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -412,9 +438,13 @@ it("align_baseline_child_multiline", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_child_multiline_override", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -532,9 +562,13 @@ it("align_baseline_child_multiline_override", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_child_multiline_no_override_on_secondline", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -651,9 +685,13 @@ it("align_baseline_child_multiline_no_override_on_secondline", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_child_top", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -723,9 +761,13 @@ it("align_baseline_child_top", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_child_top2", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -795,9 +837,13 @@ it("align_baseline_child_top2", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_double_nested_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -881,9 +927,13 @@ it("align_baseline_double_nested_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_BASELINE);
@@ -936,9 +986,13 @@ it("align_baseline_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_child_margin", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1015,9 +1069,13 @@ it("align_baseline_child_margin", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_child_padding", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1094,9 +1152,13 @@ it("align_baseline_child_padding", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_multiline", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1211,9 +1273,13 @@ it("align_baseline_multiline", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_multiline_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_BASELINE);
@@ -1327,9 +1393,13 @@ it("align_baseline_multiline_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_multiline_column2", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_BASELINE);
@@ -1443,9 +1513,13 @@ it("align_baseline_multiline_column2", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_baseline_multiline_row_and_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1560,9 +1634,13 @@ it("align_baseline_multiline_row_and_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_items_center_child_with_margin_bigger_than_parent", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -1617,9 +1695,13 @@ it("align_items_center_child_with_margin_bigger_than_parent", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_items_flex_end_child_with_margin_bigger_than_parent", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -1674,9 +1756,13 @@ it("align_items_flex_end_child_with_margin_bigger_than_parent", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_items_center_child_without_margin_bigger_than_parent", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -1729,9 +1815,13 @@ it("align_items_center_child_without_margin_bigger_than_parent", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_items_flex_end_child_without_margin_bigger_than_parent", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -1784,5 +1874,7 @@ it("align_items_flex_end_child_without_margin_bigger_than_parent", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("align_self_center", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -49,9 +51,13 @@ it("align_self_center", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_self_flex_end", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -89,9 +95,13 @@ it("align_self_flex_end", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_self_flex_start", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -129,9 +139,13 @@ it("align_self_flex_start", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_self_flex_end_override_flex_start", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_FLEX_START);
@@ -170,9 +184,13 @@ it("align_self_flex_end_override_flex_start", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_self_baseline", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -242,5 +260,7 @@ it("align_self_baseline", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("border_no_size", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setBorder(Yoga.EDGE_LEFT, 10);
@@ -35,9 +37,13 @@ it("border_no_size", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("border_container_match_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setBorder(Yoga.EDGE_LEFT, 10);
@@ -76,9 +82,13 @@ it("border_container_match_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("border_flex_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setBorder(Yoga.EDGE_LEFT, 10);
@@ -119,9 +129,13 @@ it("border_flex_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("border_stretch_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setBorder(Yoga.EDGE_LEFT, 10);
@@ -161,9 +175,13 @@ it("border_stretch_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("border_center_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -205,5 +223,7 @@ it("border_center_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("wrap_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
@@ -46,9 +48,13 @@ it("wrap_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrap_grandchild", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
@@ -96,5 +102,7 @@ it("wrap_grandchild", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("display_none", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -63,9 +65,13 @@ it("display_none", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("display_none_fixed_size", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -118,9 +124,13 @@ it("display_none_fixed_size", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("display_none_with_margin", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -177,9 +187,13 @@ it("display_none_with_margin", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("display_none_with_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -270,9 +284,13 @@ it("display_none_with_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("display_none_with_position", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -325,5 +343,7 @@ it("display_none_with_position", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("flex_direction_column_no_height", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -74,9 +76,13 @@ it("flex_direction_column_no_height", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_direction_row_no_width", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -140,9 +146,13 @@ it("flex_direction_row_no_width", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_direction_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -206,9 +216,13 @@ it("flex_direction_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_direction_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -273,9 +287,13 @@ it("flex_direction_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_direction_column_reverse", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE);
@@ -340,9 +358,13 @@ it("flex_direction_column_reverse", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_direction_row_reverse", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE);
@@ -407,5 +429,7 @@ it("flex_direction_row_reverse", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("flex_basis_flex_grow_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -62,9 +64,13 @@ it("flex_basis_flex_grow_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_basis_flex_grow_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -116,9 +122,13 @@ it("flex_basis_flex_grow_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_basis_flex_shrink_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -169,9 +179,13 @@ it("flex_basis_flex_shrink_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_basis_flex_shrink_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -223,9 +237,13 @@ it("flex_basis_flex_shrink_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_shrink_to_zero", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setHeight(75);
@@ -292,9 +310,13 @@ it("flex_shrink_to_zero", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_basis_overrides_main_size", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -362,9 +384,13 @@ it("flex_basis_overrides_main_size", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_grow_shrink_at_most", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -414,5 +440,7 @@ it("flex_grow_shrink_at_most", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("wrap_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexWrap(Yoga.WRAP_WRAP);
@@ -93,9 +95,13 @@ it("wrap_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrap_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -178,9 +184,13 @@ it("wrap_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrap_row_align_items_flex_end", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -264,9 +274,13 @@ it("wrap_row_align_items_flex_end", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrap_row_align_items_center", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -350,9 +364,13 @@ it("wrap_row_align_items_center", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_wrap_children_with_min_main_overriding_flex_basis", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -407,9 +425,13 @@ it("flex_wrap_children_with_min_main_overriding_flex_basis", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_wrap_wrap_to_child_height", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
@@ -489,9 +511,13 @@ it("flex_wrap_wrap_to_child_height", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_wrap_align_stretch_fits_one_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -543,9 +569,13 @@ it("flex_wrap_align_stretch_fits_one_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrap_reverse_row_align_content_flex_start", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -643,9 +673,13 @@ it("wrap_reverse_row_align_content_flex_start", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrap_reverse_row_align_content_center", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -744,9 +778,13 @@ it("wrap_reverse_row_align_content_center", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrap_reverse_row_single_line_different_size", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -844,9 +882,13 @@ it("wrap_reverse_row_single_line_different_size", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrap_reverse_row_align_content_stretch", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -945,9 +987,13 @@ it("wrap_reverse_row_align_content_stretch", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrap_reverse_row_align_content_space_around", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1046,9 +1092,13 @@ it("wrap_reverse_row_align_content_space_around", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrap_reverse_column_fixed_size", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_CENTER);
@@ -1147,9 +1197,13 @@ it("wrap_reverse_column_fixed_size", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrapped_row_within_align_items_center", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_CENTER);
@@ -1217,9 +1271,13 @@ it("wrapped_row_within_align_items_center", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrapped_row_within_align_items_flex_start", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_FLEX_START);
@@ -1287,9 +1345,13 @@ it("wrapped_row_within_align_items_flex_start", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("wrapped_row_within_align_items_flex_end", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_FLEX_END);
@@ -1357,5 +1419,7 @@ it("wrapped_row_within_align_items_flex_end", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("justify_content_row_flex_start", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -76,9 +78,13 @@ it("justify_content_row_flex_start", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("justify_content_row_flex_end", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -144,9 +150,13 @@ it("justify_content_row_flex_end", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("justify_content_row_center", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -212,9 +222,13 @@ it("justify_content_row_center", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("justify_content_row_space_between", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -280,9 +294,13 @@ it("justify_content_row_space_between", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("justify_content_row_space_around", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -348,9 +366,13 @@ it("justify_content_row_space_around", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("justify_content_column_flex_start", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(102);
@@ -413,9 +435,13 @@ it("justify_content_column_flex_start", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("justify_content_column_flex_end", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
@@ -480,9 +506,13 @@ it("justify_content_column_flex_end", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("justify_content_column_center", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -547,9 +577,13 @@ it("justify_content_column_center", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("justify_content_column_space_between", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN);
@@ -614,9 +648,13 @@ it("justify_content_column_space_between", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("justify_content_column_space_around", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND);
@@ -681,5 +719,7 @@ it("justify_content_column_space_around", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("margin_start", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -49,9 +51,13 @@ it("margin_start", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_top", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -88,9 +94,13 @@ it("margin_top", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_end", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -129,9 +139,13 @@ it("margin_end", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_bottom", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
@@ -169,9 +183,13 @@ it("margin_bottom", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_and_flex_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -210,9 +228,13 @@ it("margin_and_flex_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_and_flex_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -250,9 +272,13 @@ it("margin_and_flex_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_and_stretch_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -291,9 +317,13 @@ it("margin_and_stretch_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_and_stretch_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -331,9 +361,13 @@ it("margin_and_stretch_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_with_sibling_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -385,9 +419,13 @@ it("margin_with_sibling_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_with_sibling_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -438,9 +476,13 @@ it("margin_with_sibling_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_bottom", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_CENTER);
@@ -494,9 +536,13 @@ it("margin_auto_bottom", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_top", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_CENTER);
@@ -550,9 +596,13 @@ it("margin_auto_top", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_bottom_and_top", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_CENTER);
@@ -607,9 +657,13 @@ it("margin_auto_bottom_and_top", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_bottom_and_top_justify_center", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -664,9 +718,13 @@ it("margin_auto_bottom_and_top_justify_center", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_mutiple_children_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_CENTER);
@@ -736,9 +794,13 @@ it("margin_auto_mutiple_children_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_mutiple_children_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -809,9 +871,13 @@ it("margin_auto_mutiple_children_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_left_and_right_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -867,9 +933,13 @@ it("margin_auto_left_and_right_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_left_and_right", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(200);
@@ -923,9 +993,13 @@ it("margin_auto_left_and_right", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_start_and_end_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -981,9 +1055,13 @@ it("margin_auto_start_and_end_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_start_and_end", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(200);
@@ -1037,9 +1115,13 @@ it("margin_auto_start_and_end", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_left_and_right_column_and_center", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_CENTER);
@@ -1094,9 +1176,13 @@ it("margin_auto_left_and_right_column_and_center", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_left", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_CENTER);
@@ -1150,9 +1236,13 @@ it("margin_auto_left", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_right", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_CENTER);
@@ -1206,9 +1296,13 @@ it("margin_auto_right", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_left_and_right_strech", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1263,9 +1357,13 @@ it("margin_auto_left_and_right_strech", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_top_and_bottom_strech", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(200);
@@ -1319,9 +1417,13 @@ it("margin_auto_top_and_bottom_strech", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_should_not_be_part_of_max_height", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(250);
@@ -1360,9 +1462,13 @@ it("margin_should_not_be_part_of_max_height", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_should_not_be_part_of_max_width", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(250);
@@ -1401,9 +1507,13 @@ it("margin_should_not_be_part_of_max_width", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_left_right_child_bigger_than_parent", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -1443,9 +1553,13 @@ it("margin_auto_left_right_child_bigger_than_parent", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_left_child_bigger_than_parent", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -1484,9 +1598,13 @@ it("margin_auto_left_child_bigger_than_parent", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_fix_left_auto_right_child_bigger_than_parent", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -1526,9 +1644,13 @@ it("margin_fix_left_auto_right_child_bigger_than_parent", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("margin_auto_left_fix_right_child_bigger_than_parent", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -1568,5 +1690,7 @@ it("margin_auto_left_fix_right_child_bigger_than_parent", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("max_width", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -48,9 +50,13 @@ it("max_width", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("max_height", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -88,9 +94,13 @@ it("max_height", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("min_height", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -141,9 +151,13 @@ it("min_height", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("min_width", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -195,9 +209,13 @@ it("min_width", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("justify_content_min_max", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -236,9 +254,13 @@ it("justify_content_min_max", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("align_items_min_max", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_CENTER);
@@ -277,9 +299,13 @@ it("align_items_min_max", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("justify_content_overflow_min_max", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -347,10 +373,14 @@ it("justify_content_overflow_min_max", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_grow_to_min", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_MIN_FLEX_FIX, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_MIN_FLEX_FIX, true);
try {
var root = Yoga.Node.create(config);
@@ -404,11 +434,13 @@ it("flex_grow_to_min", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_MIN_FLEX_FIX, false);
config.free();
}
});
it("flex_grow_in_at_most_container", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_MIN_FLEX_FIX, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_MIN_FLEX_FIX, true);
try {
var root = Yoga.Node.create(config);
@@ -463,10 +495,12 @@ it("flex_grow_in_at_most_container", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_MIN_FLEX_FIX, false);
config.free();
}
});
it("flex_grow_within_max_width", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(200);
@@ -518,9 +552,13 @@ it("flex_grow_within_max_width", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_grow_within_constrained_max_width", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(200);
@@ -572,9 +610,13 @@ it("flex_grow_within_constrained_max_width", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_grow_within_constrained_min_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -625,9 +667,13 @@ it("flex_grow_within_constrained_min_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_grow_within_constrained_min_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setMinHeight(100);
@@ -676,9 +722,13 @@ it("flex_grow_within_constrained_min_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_grow_within_constrained_max_row", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(200);
@@ -744,9 +794,13 @@ it("flex_grow_within_constrained_max_row", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("flex_grow_within_constrained_max_column", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -797,9 +851,13 @@ it("flex_grow_within_constrained_max_column", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("min_width_overrides_width", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(50);
@@ -821,9 +879,13 @@ it("min_width_overrides_width", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("max_width_overrides_width", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(200);
@@ -845,9 +907,13 @@ it("max_width_overrides_width", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("min_height_overrides_height", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setHeight(50);
@@ -869,9 +935,13 @@ it("min_height_overrides_height", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("max_height_overrides_height", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setHeight(200);
@@ -893,9 +963,13 @@ it("max_height_overrides_height", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("min_max_percent_no_width_height", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_FLEX_START);
@@ -935,5 +1009,7 @@ it("min_max_percent_no_width_height", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("padding_no_size", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setPadding(Yoga.EDGE_LEFT, 10);
@@ -35,9 +37,13 @@ it("padding_no_size", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("padding_container_match_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setPadding(Yoga.EDGE_LEFT, 10);
@@ -76,9 +82,13 @@ it("padding_container_match_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("padding_flex_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setPadding(Yoga.EDGE_LEFT, 10);
@@ -119,9 +129,13 @@ it("padding_flex_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("padding_stretch_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setPadding(Yoga.EDGE_LEFT, 10);
@@ -161,9 +175,13 @@ it("padding_stretch_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("padding_center_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
@@ -205,9 +223,13 @@ it("padding_center_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("child_with_padding_align_end", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
@@ -250,5 +272,7 @@ it("child_with_padding_align_end", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,7 +12,9 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("percentage_width_height", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -52,11 +54,13 @@ it("percentage_width_height", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_position_left_top", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -98,11 +102,13 @@ it("percentage_position_left_top", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_position_bottom_right", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -144,11 +150,13 @@ it("percentage_position_bottom_right", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_flex_basis", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -203,11 +211,13 @@ it("percentage_flex_basis", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_flex_basis_cross", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -261,11 +271,13 @@ it("percentage_flex_basis_cross", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_flex_basis_cross_min_height", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -319,11 +331,13 @@ it("percentage_flex_basis_cross_min_height", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_flex_basis_main_max_height", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -380,11 +394,13 @@ it("percentage_flex_basis_main_max_height", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_flex_basis_cross_max_height", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -440,11 +456,13 @@ it("percentage_flex_basis_cross_max_height", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_flex_basis_main_max_width", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -501,11 +519,13 @@ it("percentage_flex_basis_main_max_width", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_flex_basis_cross_max_width", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -561,11 +581,13 @@ it("percentage_flex_basis_cross_max_width", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_flex_basis_main_min_width", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -622,11 +644,13 @@ it("percentage_flex_basis_main_min_width", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_flex_basis_cross_min_width", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -682,11 +706,13 @@ it("percentage_flex_basis_cross_min_width", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_multiple_nested_with_padding_margin_and_percentage_values", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -794,11 +820,13 @@ it("percentage_multiple_nested_with_padding_margin_and_percentage_values", funct
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_margin_should_calculate_based_only_on_width", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -855,11 +883,13 @@ it("percentage_margin_should_calculate_based_only_on_width", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_padding_should_calculate_based_only_on_width", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -916,11 +946,13 @@ it("percentage_padding_should_calculate_based_only_on_width", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_absolute_position", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -962,10 +994,12 @@ it("percentage_absolute_position", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("percentage_width_height_undefined_parent_size", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
@@ -1000,9 +1034,13 @@ it("percentage_width_height_undefined_parent_size", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("percent_within_flex_grow", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
@@ -1081,10 +1119,14 @@ it("percent_within_flex_grow", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("percentage_container_in_wrapping_container", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_MIN_FLEX_FIX, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_MIN_FLEX_FIX, true);
try {
var root = Yoga.Node.create(config);
@@ -1169,10 +1211,12 @@ it("percentage_container_in_wrapping_container", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_MIN_FLEX_FIX, false);
config.free();
}
});
it("percent_absolute_position", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(60);
@@ -1240,5 +1284,7 @@ it("percent_absolute_position", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});

View File

@@ -12,7 +12,9 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("rounding_flex_basis_flex_grow_row_width_of_100", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -79,11 +81,13 @@ it("rounding_flex_basis_flex_grow_row_width_of_100", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("rounding_flex_basis_flex_grow_row_prime_number_width", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -178,11 +182,13 @@ it("rounding_flex_basis_flex_grow_row_prime_number_width", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("rounding_flex_basis_flex_shrink_row", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -250,11 +256,13 @@ it("rounding_flex_basis_flex_shrink_row", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("rounding_flex_basis_overrides_main_size", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -324,11 +332,13 @@ it("rounding_flex_basis_overrides_main_size", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("rounding_total_fractial", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -398,11 +408,13 @@ it("rounding_total_fractial", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("rounding_total_fractial_nested", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -506,11 +518,13 @@ it("rounding_total_fractial_nested", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("rounding_fractial_input_1", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -580,11 +594,13 @@ it("rounding_fractial_input_1", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("rounding_fractial_input_2", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -654,11 +670,13 @@ it("rounding_fractial_input_2", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("rounding_fractial_input_3", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -729,11 +747,13 @@ it("rounding_fractial_input_3", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});
it("rounding_fractial_input_4", function () {
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
var config = Yoga.Config.create();
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true);
try {
var root = Yoga.Node.create(config);
@@ -804,6 +824,6 @@ it("rounding_fractial_input_4", function () {
root.freeRecursive();
}
Yoga.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, false);
config.free();
}
});

View File

@@ -12,6 +12,8 @@
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
it("nested_overflowing_child", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -61,9 +63,13 @@ it("nested_overflowing_child", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("nested_overflowing_child_in_constraint_parent", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -115,9 +121,13 @@ it("nested_overflowing_child_in_constraint_parent", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});
it("parent_wrap_child_size_overflowing_parent", function () {
var config = Yoga.Config.create();
try {
var root = Yoga.Node.create(config);
root.setWidth(100);
@@ -168,5 +178,7 @@ it("parent_wrap_child_size_overflowing_parent", function () {
if (typeof root !== "undefined") {
root.freeRecursive();
}
config.free();
}
});