Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions java/tests/com/facebook/yoga/YGAlignBaselineTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ class YGAlignBaselineTest {

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

assertEquals(0f, root_child0.getLayoutX(), 0.0f)
assertEquals(0f, root_child0.getLayoutY(), 0.0f)
assertEquals(0f, root_child0.layoutX, 0.0f)
assertEquals(0f, root_child0.layoutY, 0.0f)

assertEquals(500f, root_child1.getLayoutX(), 0.0f)
assertEquals(100f, root_child1.getLayoutY(), 0.0f)
assertEquals(500f, root_child1.layoutX, 0.0f)
assertEquals(100f, root_child1.layoutY, 0.0f)

assertEquals(0f, root_child1_child0.getLayoutX(), 0.0f)
assertEquals(0f, root_child1_child0.getLayoutY(), 0.0f)
assertEquals(0f, root_child1_child0.layoutX, 0.0f)
assertEquals(0f, root_child1_child0.layoutY, 0.0f)

assertEquals(0f, root_child1_child1.getLayoutX(), 0.0f)
assertEquals(300f, root_child1_child1.getLayoutY(), 0.0f)
assertEquals(0f, root_child1_child1.layoutX, 0.0f)
assertEquals(300f, root_child1_child1.layoutY, 0.0f)
}

@Test
Expand All @@ -85,17 +85,17 @@ class YGAlignBaselineTest {

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

assertEquals(0f, root_child0.getLayoutX(), 0.0f)
assertEquals(0f, root_child0.getLayoutY(), 0.0f)
assertEquals(0f, root_child0.layoutX, 0.0f)
assertEquals(0f, root_child0.layoutY, 0.0f)

assertEquals(500f, root_child1.getLayoutX(), 0.0f)
assertEquals(100f, root_child1.getLayoutY(), 0.0f)
assertEquals(500f, root_child1.layoutX, 0.0f)
assertEquals(100f, root_child1.layoutY, 0.0f)

assertEquals(0f, root_child1_child0.getLayoutX(), 0.0f)
assertEquals(0f, root_child1_child0.getLayoutY(), 0.0f)
assertEquals(0f, root_child1_child0.layoutX, 0.0f)
assertEquals(0f, root_child1_child0.layoutY, 0.0f)

assertEquals(500f, root_child1_child1.getLayoutX(), 0.0f)
assertEquals(300f, root_child1_child1.getLayoutY(), 0.0f)
assertEquals(500f, root_child1_child1.layoutX, 0.0f)
assertEquals(300f, root_child1_child1.layoutY, 0.0f)
}

private fun createYGNode(
Expand All @@ -106,11 +106,11 @@ class YGAlignBaselineTest {
alignBaseline: Boolean,
): YogaNode {
val node = mNodeFactory.create(config)
node.setFlexDirection(flexDirection)
node.flexDirection = flexDirection
node.setWidth(width)
node.setHeight(height)
if (alignBaseline) {
node.setAlignItems(YogaAlign.BASELINE)
node.alignItems = YogaAlign.BASELINE
}
return node
}
Expand Down
12 changes: 6 additions & 6 deletions java/tests/com/facebook/yoga/YogaExceptionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class YogaExceptionTest {
@Test(expected = RuntimeException::class)
fun testBaselineThrows() {
val root = createNode()
root.setFlexDirection(YogaFlexDirection.ROW)
root.setAlignItems(YogaAlign.BASELINE)
root.flexDirection = YogaFlexDirection.ROW
root.alignItems = YogaAlign.BASELINE

val child1 = createNode()
root.addChildAt(child1, 0)
Expand All @@ -48,8 +48,8 @@ class YogaExceptionTest {
@Test
fun testBaselineThrowsAndStops() {
val root = createNode()
root.setFlexDirection(YogaFlexDirection.ROW)
root.setAlignItems(YogaAlign.BASELINE)
root.flexDirection = YogaFlexDirection.ROW
root.alignItems = YogaAlign.BASELINE

val child1 = createNode()
root.addChildAt(child1, 0)
Expand Down Expand Up @@ -98,8 +98,8 @@ class YogaExceptionTest {
@Test
fun testMeasureThrowsAndStops() {
val root = createNode()
root.setFlexDirection(YogaFlexDirection.ROW)
root.setAlignItems(YogaAlign.BASELINE)
root.flexDirection = YogaFlexDirection.ROW
root.alignItems = YogaAlign.BASELINE

val child1 = createNode()
root.addChildAt(child1, 0)
Expand Down
4 changes: 2 additions & 2 deletions java/tests/com/facebook/yoga/YogaLoggerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class YogaLoggerTest {
config.setLogger(logger)

val root = YogaNodeFactory.create(config)
root.setFlexDirection(YogaFlexDirection.ROW)
root.setAlignItems(YogaAlign.BASELINE)
root.flexDirection = YogaFlexDirection.ROW
root.alignItems = YogaAlign.BASELINE

val child1 = YogaNodeFactory.create(config)
root.addChildAt(child1, 0)
Expand Down
Loading
Loading