|
@@ -74,8 +74,13 @@ class UserBlockTrackerTest {
|
|
|
final HashChunkManager hashChunkManager = new HashChunkManager();
|
|
|
|
|
|
// Top Block
|
|
|
- final Block illegalHeightBlock = initMockBlock(1337, 256, -1337);
|
|
|
+ int illegalMaxHeight = 256 + 1;
|
|
|
+ final Block illegalHeightBlock = initMockBlock(1337, illegalMaxHeight, -1337);
|
|
|
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> hashChunkManager.setIneligible(illegalHeightBlock));
|
|
|
+
|
|
|
+ int illegalMinHeight = -65;
|
|
|
+ final Block otherIllegalHeightBlock = initMockBlock(1337, illegalMinHeight, -1337);
|
|
|
+ Assertions.assertThrows(IndexOutOfBoundsException.class, () -> hashChunkManager.setIneligible(otherIllegalHeightBlock));
|
|
|
}
|
|
|
|
|
|
@Test
|
|
@@ -85,7 +90,7 @@ class UserBlockTrackerTest {
|
|
|
int radius = 2; // Could be anything but drastically changes test time
|
|
|
|
|
|
for (int x = -radius; x <= radius; x++) {
|
|
|
- for (int y = mockWorld.getMinHeight(); y < mockWorld.getMaxHeight(); y++) {
|
|
|
+ for (int y = mockWorld.getMinHeight(); y <= mockWorld.getMaxHeight(); y++) {
|
|
|
for (int z = -radius; z <= radius; z++) {
|
|
|
final Block testBlock = initMockBlock(x, y, z);
|
|
|
// mark ineligible
|
|
@@ -147,7 +152,8 @@ class UserBlockTrackerTest {
|
|
|
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> chunkStore.setTrue(0, -1, 0));
|
|
|
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> chunkStore.setTrue(0, 0, -1));
|
|
|
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> chunkStore.setTrue(16, 0, 0));
|
|
|
- Assertions.assertThrows(IndexOutOfBoundsException.class, () -> chunkStore.setTrue(0, mockWorld.getMaxHeight(), 0));
|
|
|
+ Assertions.assertThrows(IndexOutOfBoundsException.class, () -> chunkStore.setTrue(0, mockWorld.getMaxHeight()+1, 0));
|
|
|
+ Assertions.assertThrows(IndexOutOfBoundsException.class, () -> chunkStore.setTrue(0, mockWorld.getMinHeight()-1, 0));
|
|
|
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> chunkStore.setTrue(0, 0, 16));
|
|
|
}
|
|
|
|