Skip to content

Commit 5009f5c

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Fix misc-misplaced-const warnings in Yoga tests (facebook#1677)
Summary: Pull Request resolved: facebook#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
1 parent e4fe14a commit 5009f5c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2785
-2797
lines changed

gentest/gentest-cpp.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
4949
this.push('');
5050
}
5151

52-
this.push('const YGConfigRef config = YGConfigNew();');
52+
this.push('YGConfigRef config = YGConfigNew();');
5353
for (const i in experiments) {
5454
this.push(
5555
'YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeature' +
@@ -63,9 +63,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
6363

6464
emitTestTreePrologue: {
6565
value: function (nodeName) {
66-
this.push(
67-
'const YGNodeRef ' + nodeName + ' = YGNodeNewWithConfig(config);',
68-
);
66+
this.push('YGNodeRef ' + nodeName + ' = YGNodeNewWithConfig(config);');
6967
},
7068
},
7169

tests/FlexGapTest.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@
1111
// TODO: move this to a fixture based test once it supports parsing negative
1212
// values
1313
TEST(FlexGap, gap_negative_value) {
14-
const YGConfigRef config = YGConfigNew();
14+
YGConfigRef config = YGConfigNew();
1515

16-
const YGNodeRef root = YGNodeNewWithConfig(config);
16+
YGNodeRef root = YGNodeNewWithConfig(config);
1717
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
1818
YGNodeStyleSetGap(root, YGGutterAll, -20);
1919
YGNodeStyleSetHeight(root, 200);
2020

21-
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
21+
YGNodeRef root_child0 = YGNodeNewWithConfig(config);
2222
YGNodeStyleSetWidth(root_child0, 20);
2323
YGNodeInsertChild(root, root_child0, 0);
2424

25-
const YGNodeRef root_child1 = YGNodeNewWithConfig(config);
25+
YGNodeRef root_child1 = YGNodeNewWithConfig(config);
2626
YGNodeStyleSetWidth(root_child1, 20);
2727
YGNodeInsertChild(root, root_child1, 1);
2828

29-
const YGNodeRef root_child2 = YGNodeNewWithConfig(config);
29+
YGNodeRef root_child2 = YGNodeNewWithConfig(config);
3030
YGNodeStyleSetWidth(root_child2, 20);
3131
YGNodeInsertChild(root, root_child2, 2);
3232

33-
const YGNodeRef root_child3 = YGNodeNewWithConfig(config);
33+
YGNodeRef root_child3 = YGNodeNewWithConfig(config);
3434
YGNodeStyleSetWidth(root_child3, 20);
3535
YGNodeInsertChild(root, root_child3, 3);
3636
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

0 commit comments

Comments
 (0)