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

@@ -10,7 +10,7 @@
#include <array>
TEST(YogaTest, computed_layout_margin) {
const YGNodeRef root = YGNodeNew();
YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
YGNodeStyleSetMarginPercent(root, YGEdgeStart, 10);
@@ -43,7 +43,7 @@ TEST(YogaTest, margin_side_overrides_horizontal_and_vertical) {
? YGEdgeVertical
: YGEdgeHorizontal;
const YGNodeRef root = YGNodeNew();
YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
YGNodeStyleSetMargin(root, horizontalOrVertical, 10);
@@ -69,7 +69,7 @@ TEST(YogaTest, margin_side_overrides_all) {
for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
for (const auto& edge : edges) {
const YGNodeRef root = YGNodeNew();
YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
YGNodeStyleSetMargin(root, YGEdgeAll, 10);
@@ -89,7 +89,7 @@ TEST(YogaTest, margin_horizontal_and_vertical_overrides_all) {
for (float directionValue = 0; directionValue < 2; ++directionValue) {
for (const auto& direction : directions) {
const YGNodeRef root = YGNodeNew();
YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100);
YGNodeStyleSetHeight(root, 100);
YGNodeStyleSetMargin(root, YGEdgeAll, 10);