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:
Nick Gerleman
2024-07-03 17:30:10 -07:00
committed by Facebook GitHub Bot
parent e4fe14ab3e
commit 5009f5c1ac
44 changed files with 2785 additions and 2797 deletions

View File

@@ -9,12 +9,12 @@
#include <yoga/Yoga.h>
TEST(YogaTest, start_overrides) {
const YGNodeRef root = YGNodeNew();
YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
const YGNodeRef root_child0 = YGNodeNew();
YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMargin(root_child0, YGEdgeStart, 10);
YGNodeStyleSetMargin(root_child0, YGEdgeLeft, 20);
@@ -33,12 +33,12 @@ TEST(YogaTest, start_overrides) {
}
TEST(YogaTest, end_overrides) {
const YGNodeRef root = YGNodeNew();
YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
const YGNodeRef root_child0 = YGNodeNew();
YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMargin(root_child0, YGEdgeEnd, 10);
YGNodeStyleSetMargin(root_child0, YGEdgeLeft, 20);
@@ -57,12 +57,12 @@ TEST(YogaTest, end_overrides) {
}
TEST(YogaTest, horizontal_overridden) {
const YGNodeRef root = YGNodeNew();
YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
const YGNodeRef root_child0 = YGNodeNew();
YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMargin(root_child0, YGEdgeHorizontal, 10);
YGNodeStyleSetMargin(root_child0, YGEdgeLeft, 20);
@@ -76,12 +76,12 @@ TEST(YogaTest, horizontal_overridden) {
}
TEST(YogaTest, vertical_overridden) {
const YGNodeRef root = YGNodeNew();
YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionColumn);
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
const YGNodeRef root_child0 = YGNodeNew();
YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMargin(root_child0, YGEdgeVertical, 10);
YGNodeStyleSetMargin(root_child0, YGEdgeTop, 20);
@@ -95,12 +95,12 @@ TEST(YogaTest, vertical_overridden) {
}
TEST(YogaTest, horizontal_overrides_all) {
const YGNodeRef root = YGNodeNew();
YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionColumn);
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
const YGNodeRef root_child0 = YGNodeNew();
YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMargin(root_child0, YGEdgeHorizontal, 10);
YGNodeStyleSetMargin(root_child0, YGEdgeAll, 20);
@@ -116,12 +116,12 @@ TEST(YogaTest, horizontal_overrides_all) {
}
TEST(YogaTest, vertical_overrides_all) {
const YGNodeRef root = YGNodeNew();
YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionColumn);
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
const YGNodeRef root_child0 = YGNodeNew();
YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMargin(root_child0, YGEdgeVertical, 10);
YGNodeStyleSetMargin(root_child0, YGEdgeAll, 20);
@@ -137,12 +137,12 @@ TEST(YogaTest, vertical_overrides_all) {
}
TEST(YogaTest, all_overridden) {
const YGNodeRef root = YGNodeNew();
YGNodeRef root = YGNodeNew();
YGNodeStyleSetFlexDirection(root, YGFlexDirectionColumn);
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
const YGNodeRef root_child0 = YGNodeNew();
YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetFlexGrow(root_child0, 1);
YGNodeStyleSetMargin(root_child0, YGEdgeLeft, 10);
YGNodeStyleSetMargin(root_child0, YGEdgeTop, 10);