Fix misc-misplaced-const
warnings in Yoga tests (#1677)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1677 We have Clang Tidy warnings enabled internally, that will flag `const YG*Ref` as misleading, as a const pointer to non-const, instead of non-const pointer to const. Let's remove all the misleading const in existing tests, and generated tests. Reviewed By: joevilches Differential Revision: D59335968 fbshipit-source-id: c66af878904ba7900f8ffcd99162968d90f8e5c7
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e4fe14ab3e
commit
5009f5c1ac
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* clang-format off
|
||||
* @generated SignedSource<<63df2e0a9c41d2ef01b78a3d4ac1bf01>>
|
||||
* @generated SignedSource<<6b01edcfd82ee39d61cfcadd0b312a36>>
|
||||
* generated by gentest/gentest-driver.ts from gentest/fixtures/YGPercentageTest.html
|
||||
*/
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
#include "../util/TestUtil.h"
|
||||
|
||||
TEST(YogaTest, percentage_width_height) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 200);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 30);
|
||||
YGNodeStyleSetHeightPercent(root_child0, 30);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
@@ -56,15 +56,15 @@ TEST(YogaTest, percentage_width_height) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_position_left_top) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 400);
|
||||
YGNodeStyleSetHeight(root, 400);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionPercent(root_child0, YGEdgeLeft, 10);
|
||||
YGNodeStyleSetPositionPercent(root_child0, YGEdgeTop, 20);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 45);
|
||||
@@ -100,15 +100,15 @@ TEST(YogaTest, percentage_position_left_top) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_position_bottom_right) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 500);
|
||||
YGNodeStyleSetHeight(root, 500);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionPercent(root_child0, YGEdgeRight, 20);
|
||||
YGNodeStyleSetPositionPercent(root_child0, YGEdgeBottom, 10);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 55);
|
||||
@@ -144,20 +144,20 @@ TEST(YogaTest, percentage_position_bottom_right) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_flex_basis) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 200);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0, 1);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child0, 50);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child1, 1);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child1, 25);
|
||||
YGNodeInsertChild(root, root_child1, 1);
|
||||
@@ -201,19 +201,19 @@ TEST(YogaTest, percentage_flex_basis) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_flex_basis_cross) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 200);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0, 1);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child0, 50);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child1, 1);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child1, 25);
|
||||
YGNodeInsertChild(root, root_child1, 1);
|
||||
@@ -259,19 +259,19 @@ TEST(YogaTest, percentage_flex_basis_cross) {
|
||||
TEST(YogaTest, percentage_flex_basis_cross_min_height) {
|
||||
GTEST_SKIP();
|
||||
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 200);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0, 1);
|
||||
YGNodeStyleSetMinHeightPercent(root_child0, 60);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child1, 2);
|
||||
YGNodeStyleSetMinHeightPercent(root_child1, 10);
|
||||
YGNodeInsertChild(root, root_child1, 1);
|
||||
@@ -315,21 +315,21 @@ TEST(YogaTest, percentage_flex_basis_cross_min_height) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_flex_basis_main_max_height) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 200);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0, 1);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child0, 10);
|
||||
YGNodeStyleSetMaxHeightPercent(root_child0, 60);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child1, 4);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child1, 10);
|
||||
YGNodeStyleSetMaxHeightPercent(root_child1, 20);
|
||||
@@ -374,20 +374,20 @@ TEST(YogaTest, percentage_flex_basis_main_max_height) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_flex_basis_cross_max_height) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 200);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0, 1);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child0, 10);
|
||||
YGNodeStyleSetMaxHeightPercent(root_child0, 60);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child1, 4);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child1, 10);
|
||||
YGNodeStyleSetMaxHeightPercent(root_child1, 20);
|
||||
@@ -432,21 +432,21 @@ TEST(YogaTest, percentage_flex_basis_cross_max_height) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_flex_basis_main_max_width) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 200);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0, 1);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child0, 15);
|
||||
YGNodeStyleSetMaxWidthPercent(root_child0, 60);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child1, 4);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child1, 10);
|
||||
YGNodeStyleSetMaxWidthPercent(root_child1, 20);
|
||||
@@ -491,20 +491,20 @@ TEST(YogaTest, percentage_flex_basis_main_max_width) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_flex_basis_cross_max_width) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 200);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0, 1);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child0, 10);
|
||||
YGNodeStyleSetMaxWidthPercent(root_child0, 60);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child1, 4);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child1, 15);
|
||||
YGNodeStyleSetMaxWidthPercent(root_child1, 20);
|
||||
@@ -549,21 +549,21 @@ TEST(YogaTest, percentage_flex_basis_cross_max_width) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_flex_basis_main_min_width) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 200);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0, 1);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child0, 15);
|
||||
YGNodeStyleSetMinWidthPercent(root_child0, 60);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child1, 4);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child1, 10);
|
||||
YGNodeStyleSetMinWidthPercent(root_child1, 20);
|
||||
@@ -608,20 +608,20 @@ TEST(YogaTest, percentage_flex_basis_main_min_width) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_flex_basis_cross_min_width) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 200);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0, 1);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child0, 10);
|
||||
YGNodeStyleSetMinWidthPercent(root_child0, 60);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child1, 4);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child1, 15);
|
||||
YGNodeStyleSetMinWidthPercent(root_child1, 20);
|
||||
@@ -666,14 +666,14 @@ TEST(YogaTest, percentage_flex_basis_cross_min_width) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_multiple_nested_with_padding_margin_and_percentage_values) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 200);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0, 1);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child0, 10);
|
||||
YGNodeStyleSetMargin(root_child0, YGEdgeLeft, 5);
|
||||
@@ -687,7 +687,7 @@ TEST(YogaTest, percentage_multiple_nested_with_padding_margin_and_percentage_val
|
||||
YGNodeStyleSetMinWidthPercent(root_child0, 60);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetMargin(root_child0_child0, YGEdgeLeft, 5);
|
||||
YGNodeStyleSetMargin(root_child0_child0, YGEdgeTop, 5);
|
||||
YGNodeStyleSetMargin(root_child0_child0, YGEdgeRight, 5);
|
||||
@@ -699,7 +699,7 @@ TEST(YogaTest, percentage_multiple_nested_with_padding_margin_and_percentage_val
|
||||
YGNodeStyleSetWidthPercent(root_child0_child0, 50);
|
||||
YGNodeInsertChild(root_child0, root_child0_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetMarginPercent(root_child0_child0_child0, YGEdgeLeft, 5);
|
||||
YGNodeStyleSetMarginPercent(root_child0_child0_child0, YGEdgeTop, 5);
|
||||
YGNodeStyleSetMarginPercent(root_child0_child0_child0, YGEdgeRight, 5);
|
||||
@@ -711,7 +711,7 @@ TEST(YogaTest, percentage_multiple_nested_with_padding_margin_and_percentage_val
|
||||
YGNodeStyleSetWidthPercent(root_child0_child0_child0, 45);
|
||||
YGNodeInsertChild(root_child0_child0, root_child0_child0_child0, 0);
|
||||
|
||||
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child1, 4);
|
||||
YGNodeStyleSetFlexBasisPercent(root_child1, 15);
|
||||
YGNodeStyleSetMinWidthPercent(root_child1, 20);
|
||||
@@ -776,14 +776,14 @@ TEST(YogaTest, percentage_multiple_nested_with_padding_margin_and_percentage_val
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_margin_should_calculate_based_only_on_width) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 100);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0, 1);
|
||||
YGNodeStyleSetMarginPercent(root_child0, YGEdgeLeft, 10);
|
||||
YGNodeStyleSetMarginPercent(root_child0, YGEdgeTop, 10);
|
||||
@@ -791,7 +791,7 @@ TEST(YogaTest, percentage_margin_should_calculate_based_only_on_width) {
|
||||
YGNodeStyleSetMarginPercent(root_child0, YGEdgeBottom, 10);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidth(root_child0_child0, 10);
|
||||
YGNodeStyleSetHeight(root_child0_child0, 10);
|
||||
YGNodeInsertChild(root_child0, root_child0_child0, 0);
|
||||
@@ -835,14 +835,14 @@ TEST(YogaTest, percentage_margin_should_calculate_based_only_on_width) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_padding_should_calculate_based_only_on_width) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 100);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0, 1);
|
||||
YGNodeStyleSetPaddingPercent(root_child0, YGEdgeLeft, 10);
|
||||
YGNodeStyleSetPaddingPercent(root_child0, YGEdgeTop, 10);
|
||||
@@ -850,7 +850,7 @@ TEST(YogaTest, percentage_padding_should_calculate_based_only_on_width) {
|
||||
YGNodeStyleSetPaddingPercent(root_child0, YGEdgeBottom, 10);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidth(root_child0_child0, 10);
|
||||
YGNodeStyleSetHeight(root_child0_child0, 10);
|
||||
YGNodeInsertChild(root_child0, root_child0_child0, 0);
|
||||
@@ -894,14 +894,14 @@ TEST(YogaTest, percentage_padding_should_calculate_based_only_on_width) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_absolute_position) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 100);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetPositionPercent(root_child0, YGEdgeLeft, 30);
|
||||
YGNodeStyleSetPositionPercent(root_child0, YGEdgeTop, 10);
|
||||
@@ -938,12 +938,12 @@ TEST(YogaTest, percentage_absolute_position) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_width_height_undefined_parent_size) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 50);
|
||||
YGNodeStyleSetHeightPercent(root_child0, 50);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
@@ -977,27 +977,27 @@ TEST(YogaTest, percentage_width_height_undefined_parent_size) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percent_within_flex_grow) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 350);
|
||||
YGNodeStyleSetHeight(root, 100);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidth(root_child0, 100);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child1, 1);
|
||||
YGNodeInsertChild(root, root_child1, 1);
|
||||
|
||||
const YGNodeRef root_child1_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child1_child0, 100);
|
||||
YGNodeInsertChild(root_child1, root_child1_child0, 0);
|
||||
|
||||
const YGNodeRef root_child2 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child2 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidth(root_child2, 100);
|
||||
YGNodeInsertChild(root, root_child2, 2);
|
||||
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
|
||||
@@ -1060,30 +1060,30 @@ TEST(YogaTest, percent_within_flex_grow) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percentage_container_in_wrapping_container) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetJustifyContent(root, YGJustifyCenter);
|
||||
YGNodeStyleSetAlignItems(root, YGAlignCenter);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 200);
|
||||
YGNodeStyleSetHeight(root, 200);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root_child0_child0, YGFlexDirectionRow);
|
||||
YGNodeStyleSetJustifyContent(root_child0_child0, YGJustifyCenter);
|
||||
YGNodeStyleSetWidthPercent(root_child0_child0, 100);
|
||||
YGNodeInsertChild(root_child0, root_child0_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidth(root_child0_child0_child0, 50);
|
||||
YGNodeStyleSetHeight(root_child0_child0_child0, 50);
|
||||
YGNodeInsertChild(root_child0_child0, root_child0_child0_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0_child0_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidth(root_child0_child0_child1, 50);
|
||||
YGNodeStyleSetHeight(root_child0_child0_child1, 50);
|
||||
YGNodeInsertChild(root_child0_child0, root_child0_child0_child1, 1);
|
||||
@@ -1147,14 +1147,14 @@ TEST(YogaTest, percentage_container_in_wrapping_container) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percent_absolute_position) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidth(root, 60);
|
||||
YGNodeStyleSetHeight(root, 50);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root_child0, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetPositionPercent(root_child0, YGEdgeLeft, 50);
|
||||
@@ -1162,11 +1162,11 @@ TEST(YogaTest, percent_absolute_position) {
|
||||
YGNodeStyleSetHeight(root_child0, 50);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child0_child0, 100);
|
||||
YGNodeInsertChild(root_child0, root_child0_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child0_child1, 100);
|
||||
YGNodeInsertChild(root_child0, root_child0_child1, 1);
|
||||
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
|
||||
@@ -1219,16 +1219,16 @@ TEST(YogaTest, percent_absolute_position) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percent_of_minmax_main) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetMinWidth(root, 60);
|
||||
YGNodeStyleSetMaxWidth(root, 60);
|
||||
YGNodeStyleSetHeight(root, 50);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 50);
|
||||
YGNodeStyleSetHeight(root_child0, 20);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
@@ -1264,15 +1264,15 @@ TEST(YogaTest, percent_of_minmax_main) {
|
||||
TEST(YogaTest, percent_of_min_main) {
|
||||
GTEST_SKIP();
|
||||
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetMinWidth(root, 60);
|
||||
YGNodeStyleSetHeight(root, 50);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 50);
|
||||
YGNodeStyleSetHeight(root_child0, 20);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
@@ -1308,25 +1308,25 @@ TEST(YogaTest, percent_of_min_main) {
|
||||
TEST(YogaTest, percent_of_min_main_multiple) {
|
||||
GTEST_SKIP();
|
||||
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetMinWidth(root, 60);
|
||||
YGNodeStyleSetHeight(root, 50);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 50);
|
||||
YGNodeStyleSetHeight(root_child0, 20);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child1, 50);
|
||||
YGNodeStyleSetHeight(root_child1, 20);
|
||||
YGNodeInsertChild(root, root_child1, 1);
|
||||
|
||||
const YGNodeRef root_child2 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child2 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child2, 50);
|
||||
YGNodeStyleSetHeight(root_child2, 20);
|
||||
YGNodeInsertChild(root, root_child2, 2);
|
||||
@@ -1382,15 +1382,15 @@ TEST(YogaTest, percent_of_min_main_multiple) {
|
||||
TEST(YogaTest, percent_of_max_main) {
|
||||
GTEST_SKIP();
|
||||
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetMaxWidth(root, 60);
|
||||
YGNodeStyleSetHeight(root, 50);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 50);
|
||||
YGNodeStyleSetHeight(root_child0, 20);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
@@ -1424,15 +1424,15 @@ TEST(YogaTest, percent_of_max_main) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percent_of_minmax_cross_stretched) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetMinWidth(root, 60);
|
||||
YGNodeStyleSetMaxWidth(root, 60);
|
||||
YGNodeStyleSetHeight(root, 50);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 50);
|
||||
YGNodeStyleSetHeight(root_child0, 20);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
@@ -1466,15 +1466,15 @@ TEST(YogaTest, percent_of_minmax_cross_stretched) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percent_absolute_of_minmax_cross_stretched) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetMinWidth(root, 60);
|
||||
YGNodeStyleSetMaxWidth(root, 60);
|
||||
YGNodeStyleSetHeight(root, 50);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 50);
|
||||
YGNodeStyleSetHeight(root_child0, 20);
|
||||
@@ -1509,16 +1509,16 @@ TEST(YogaTest, percent_absolute_of_minmax_cross_stretched) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percent_of_minmax_cross_unstretched) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignItems(root, YGAlignFlexStart);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetMinWidth(root, 60);
|
||||
YGNodeStyleSetMaxWidth(root, 60);
|
||||
YGNodeStyleSetHeight(root, 50);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 50);
|
||||
YGNodeStyleSetHeight(root_child0, 20);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
@@ -1554,15 +1554,15 @@ TEST(YogaTest, percent_of_minmax_cross_unstretched) {
|
||||
TEST(YogaTest, percent_of_min_cross_unstretched) {
|
||||
GTEST_SKIP();
|
||||
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignItems(root, YGAlignFlexStart);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetMinWidth(root, 60);
|
||||
YGNodeStyleSetHeight(root, 50);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 50);
|
||||
YGNodeStyleSetHeight(root_child0, 20);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
@@ -1596,15 +1596,15 @@ TEST(YogaTest, percent_of_min_cross_unstretched) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, percent_of_max_cross_unstretched) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignItems(root, YGAlignFlexStart);
|
||||
YGNodeStyleSetPositionType(root, YGPositionTypeAbsolute);
|
||||
YGNodeStyleSetMaxWidth(root, 60);
|
||||
YGNodeStyleSetHeight(root, 50);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidthPercent(root_child0, 50);
|
||||
YGNodeStyleSetHeight(root_child0, 20);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
Reference in New Issue
Block a user