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
@@ -9,7 +9,7 @@
|
||||
#include <yoga/Yoga.h>
|
||||
|
||||
TEST(YogaTest, assert_default_values) {
|
||||
const YGNodeRef root = YGNodeNew();
|
||||
YGNodeRef root = YGNodeNew();
|
||||
|
||||
ASSERT_EQ(0u, YGNodeGetChildCount(root));
|
||||
ASSERT_EQ(nullptr, YGNodeGetChild(root, 1));
|
||||
@@ -92,7 +92,7 @@ TEST(YogaTest, assert_default_values) {
|
||||
TEST(YogaTest, assert_webdefault_values) {
|
||||
YGConfig* config = YGConfigNew();
|
||||
YGConfigSetUseWebDefaults(config, true);
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
|
||||
ASSERT_EQ(YGFlexDirectionRow, YGNodeStyleGetFlexDirection(root));
|
||||
ASSERT_EQ(YGAlignStretch, YGNodeStyleGetAlignContent(root));
|
||||
@@ -105,7 +105,7 @@ TEST(YogaTest, assert_webdefault_values) {
|
||||
TEST(YogaTest, assert_webdefault_values_reset) {
|
||||
YGConfig* config = YGConfigNew();
|
||||
YGConfigSetUseWebDefaults(config, true);
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeReset(root);
|
||||
|
||||
ASSERT_EQ(YGFlexDirectionRow, YGNodeStyleGetFlexDirection(root));
|
||||
@@ -119,20 +119,20 @@ TEST(YogaTest, assert_webdefault_values_reset) {
|
||||
TEST(YogaTest, assert_legacy_stretch_behaviour) {
|
||||
YGConfig* config = YGConfigNew();
|
||||
YGConfigSetErrata(config, YGErrataStretchFlexBasis);
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetWidth(root, 500);
|
||||
YGNodeStyleSetHeight(root, 500);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignItems(root_child0, YGAlignFlexStart);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0_child0, 1);
|
||||
YGNodeStyleSetFlexShrink(root_child0_child0, 1);
|
||||
YGNodeInsertChild(root_child0, root_child0_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeRef root_child0_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexGrow(root_child0_child0_child0, 1);
|
||||
YGNodeStyleSetFlexShrink(root_child0_child0_child0, 1);
|
||||
YGNodeInsertChild(root_child0_child0, root_child0_child0_child0, 0);
|
||||
|
Reference in New Issue
Block a user