Skip to content

Commit 75a858c

Browse files
CalixTangmeta-codesync[bot]
authored andcommitted
Fix Kotlin property access syntax in Yoga Java test files (#1963)
Summary: Pull Request resolved: #1963 Recommit of D105191609, which was reverted (likely because github export hadn't completed when it tried to land) Reviewed By: cortinico Differential Revision: D105335609 fbshipit-source-id: e517954aeef8fd81f1783a7acab2a8e66fb0f8e3
1 parent e114242 commit 75a858c

5 files changed

Lines changed: 158 additions & 158 deletions

File tree

java/tests/com/facebook/yoga/YGAlignBaselineTest.kt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ class YGAlignBaselineTest {
5050

5151
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED)
5252

53-
assertEquals(0f, root_child0.getLayoutX(), 0.0f)
54-
assertEquals(0f, root_child0.getLayoutY(), 0.0f)
53+
assertEquals(0f, root_child0.layoutX, 0.0f)
54+
assertEquals(0f, root_child0.layoutY, 0.0f)
5555

56-
assertEquals(500f, root_child1.getLayoutX(), 0.0f)
57-
assertEquals(100f, root_child1.getLayoutY(), 0.0f)
56+
assertEquals(500f, root_child1.layoutX, 0.0f)
57+
assertEquals(100f, root_child1.layoutY, 0.0f)
5858

59-
assertEquals(0f, root_child1_child0.getLayoutX(), 0.0f)
60-
assertEquals(0f, root_child1_child0.getLayoutY(), 0.0f)
59+
assertEquals(0f, root_child1_child0.layoutX, 0.0f)
60+
assertEquals(0f, root_child1_child0.layoutY, 0.0f)
6161

62-
assertEquals(0f, root_child1_child1.getLayoutX(), 0.0f)
63-
assertEquals(300f, root_child1_child1.getLayoutY(), 0.0f)
62+
assertEquals(0f, root_child1_child1.layoutX, 0.0f)
63+
assertEquals(300f, root_child1_child1.layoutY, 0.0f)
6464
}
6565

6666
@Test
@@ -85,17 +85,17 @@ class YGAlignBaselineTest {
8585

8686
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED)
8787

88-
assertEquals(0f, root_child0.getLayoutX(), 0.0f)
89-
assertEquals(0f, root_child0.getLayoutY(), 0.0f)
88+
assertEquals(0f, root_child0.layoutX, 0.0f)
89+
assertEquals(0f, root_child0.layoutY, 0.0f)
9090

91-
assertEquals(500f, root_child1.getLayoutX(), 0.0f)
92-
assertEquals(100f, root_child1.getLayoutY(), 0.0f)
91+
assertEquals(500f, root_child1.layoutX, 0.0f)
92+
assertEquals(100f, root_child1.layoutY, 0.0f)
9393

94-
assertEquals(0f, root_child1_child0.getLayoutX(), 0.0f)
95-
assertEquals(0f, root_child1_child0.getLayoutY(), 0.0f)
94+
assertEquals(0f, root_child1_child0.layoutX, 0.0f)
95+
assertEquals(0f, root_child1_child0.layoutY, 0.0f)
9696

97-
assertEquals(500f, root_child1_child1.getLayoutX(), 0.0f)
98-
assertEquals(300f, root_child1_child1.getLayoutY(), 0.0f)
97+
assertEquals(500f, root_child1_child1.layoutX, 0.0f)
98+
assertEquals(300f, root_child1_child1.layoutY, 0.0f)
9999
}
100100

101101
private fun createYGNode(
@@ -106,11 +106,11 @@ class YGAlignBaselineTest {
106106
alignBaseline: Boolean,
107107
): YogaNode {
108108
val node = mNodeFactory.create(config)
109-
node.setFlexDirection(flexDirection)
109+
node.flexDirection = flexDirection
110110
node.setWidth(width)
111111
node.setHeight(height)
112112
if (alignBaseline) {
113-
node.setAlignItems(YogaAlign.BASELINE)
113+
node.alignItems = YogaAlign.BASELINE
114114
}
115115
return node
116116
}

java/tests/com/facebook/yoga/YogaExceptionTest.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class YogaExceptionTest {
3030
@Test(expected = RuntimeException::class)
3131
fun testBaselineThrows() {
3232
val root = createNode()
33-
root.setFlexDirection(YogaFlexDirection.ROW)
34-
root.setAlignItems(YogaAlign.BASELINE)
33+
root.flexDirection = YogaFlexDirection.ROW
34+
root.alignItems = YogaAlign.BASELINE
3535

3636
val child1 = createNode()
3737
root.addChildAt(child1, 0)
@@ -48,8 +48,8 @@ class YogaExceptionTest {
4848
@Test
4949
fun testBaselineThrowsAndStops() {
5050
val root = createNode()
51-
root.setFlexDirection(YogaFlexDirection.ROW)
52-
root.setAlignItems(YogaAlign.BASELINE)
51+
root.flexDirection = YogaFlexDirection.ROW
52+
root.alignItems = YogaAlign.BASELINE
5353

5454
val child1 = createNode()
5555
root.addChildAt(child1, 0)
@@ -98,8 +98,8 @@ class YogaExceptionTest {
9898
@Test
9999
fun testMeasureThrowsAndStops() {
100100
val root = createNode()
101-
root.setFlexDirection(YogaFlexDirection.ROW)
102-
root.setAlignItems(YogaAlign.BASELINE)
101+
root.flexDirection = YogaFlexDirection.ROW
102+
root.alignItems = YogaAlign.BASELINE
103103

104104
val child1 = createNode()
105105
root.addChildAt(child1, 0)

java/tests/com/facebook/yoga/YogaLoggerTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class YogaLoggerTest {
2323
config.setLogger(logger)
2424

2525
val root = YogaNodeFactory.create(config)
26-
root.setFlexDirection(YogaFlexDirection.ROW)
27-
root.setAlignItems(YogaAlign.BASELINE)
26+
root.flexDirection = YogaFlexDirection.ROW
27+
root.alignItems = YogaAlign.BASELINE
2828

2929
val child1 = YogaNodeFactory.create(config)
3030
root.addChildAt(child1, 0)

0 commit comments

Comments
 (0)