From b9dc8b04172e157cc4cb2114df16feb749a48688 Mon Sep 17 00:00:00 2001 From: Bixilon Date: Sun, 4 Jun 2023 20:40:28 +0200 Subject: [PATCH] add another DirectedPropertyTest, reenable stair shape tests --- .../data/registries/blocks/StairsTest.kt | 2 -- .../blocks/light/DirectedPropertyTest.kt | 20 +++++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/data/registries/blocks/StairsTest.kt b/src/integration-test/kotlin/de/bixilon/minosoft/data/registries/blocks/StairsTest.kt index a8f97e49d..6a79e418f 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/data/registries/blocks/StairsTest.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/data/registries/blocks/StairsTest.kt @@ -30,12 +30,10 @@ class StairsTest : BlockTest() { super.retrieveBlock(MinecraftBlocks.OAK_STAIRS) } - @Test(enabled = false) // ToDo: This test is correct, but failing fun testLightPropertiesNorth() { block.withProperties(BlockProperties.FACING to Directions.NORTH).testLightProperties(0, true, true, false, booleanArrayOf(false, true, false, true, true, true)) } - @Test(enabled = false) // ToDo: This test is correct, but failing fun testLightPropertiesSouth() { block.withProperties(BlockProperties.FACING to Directions.SOUTH).testLightProperties(0, true, true, false, booleanArrayOf(false, true, true, false, true, true)) } diff --git a/src/test/java/de/bixilon/minosoft/data/registries/blocks/light/DirectedPropertyTest.kt b/src/test/java/de/bixilon/minosoft/data/registries/blocks/light/DirectedPropertyTest.kt index 36f00417c..a1f1f703d 100644 --- a/src/test/java/de/bixilon/minosoft/data/registries/blocks/light/DirectedPropertyTest.kt +++ b/src/test/java/de/bixilon/minosoft/data/registries/blocks/light/DirectedPropertyTest.kt @@ -111,7 +111,23 @@ internal class DirectedPropertyTest { } @Test - fun testSideCovered8() { // overlapping + fun testSideCovered8() { + val shape = VoxelShape( + AABB(0.0f, 0.0f, 0.0f, 1.0f, 0.5f, 1.0f), + AABB(0.0f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f), + ) + + assertTrue(shape.isSideCovered(Directions.DOWN)) + assertFalse(shape.isSideCovered(Directions.UP)) + assertFalse(shape.isSideCovered(Directions.NORTH)) + assertTrue(shape.isSideCovered(Directions.SOUTH)) + assertFalse(shape.isSideCovered(Directions.WEST)) + assertFalse(shape.isSideCovered(Directions.EAST)) + } + + + @Test + fun testSideCovered9() { // overlapping val shape = VoxelShape( AABB(0.0f, 0.0f, 0.0f, 1.0f, 0.6f, 1.0f), AABB(0.0f, 0.4f, 0.5f, 1.0f, 1.0f, 1.0f), @@ -126,7 +142,7 @@ internal class DirectedPropertyTest { } // @Test // TODO: This test is correct, isSideCovered is broken - fun testSideCovered9() { // overlapping + fun testSideCovered10() { // overlapping val shape = VoxelShape( AABB(0.0f, 0.0f, 0.0f, 1.0f, 0.6f, 1.0f), AABB(0.1f, 0.0f, 0.0f, 0.9f, 0.8f, 1.0f),