arr = Array.with("a", "b" , "c", "d", "e", "f");
diff --git a/tests/src/test/java/power/DirectConsumerTests.java b/tests/src/test/java/power/DirectConsumerTests.java
index 7fdc9ef612..89ed331c8b 100644
--- a/tests/src/test/java/power/DirectConsumerTests.java
+++ b/tests/src/test/java/power/DirectConsumerTests.java
@@ -50,6 +50,6 @@ public class DirectConsumerTests extends PowerTestFixture{
consumerTile.entity.update();
graph.update();
- assertEquals(expectedSatisfaction, consumerTile.entity.power.satisfaction);
+ assertEquals(expectedSatisfaction, consumerTile.entity.power.status);
}
}
diff --git a/tests/src/test/java/power/ItemLiquidGeneratorTests.java b/tests/src/test/java/power/ItemLiquidGeneratorTests.java
index a4c0c78608..e6bc2a20de 100644
--- a/tests/src/test/java/power/ItemLiquidGeneratorTests.java
+++ b/tests/src/test/java/power/ItemLiquidGeneratorTests.java
@@ -1,18 +1,18 @@
package power;
-import io.anuke.arc.util.Time;
-import io.anuke.mindustry.content.Items;
-import io.anuke.mindustry.content.Liquids;
-import io.anuke.mindustry.type.Item;
-import io.anuke.mindustry.type.Liquid;
-import io.anuke.mindustry.world.Tile;
-import io.anuke.mindustry.world.blocks.power.ItemLiquidGenerator;
+import io.anuke.arc.util.*;
+import io.anuke.mindustry.*;
+import io.anuke.mindustry.content.*;
+import io.anuke.mindustry.core.*;
+import io.anuke.mindustry.game.*;
+import io.anuke.mindustry.type.*;
+import io.anuke.mindustry.world.*;
+import io.anuke.mindustry.world.blocks.power.*;
import org.junit.jupiter.api.*;
-import java.util.ArrayList;
+import java.util.*;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.DynamicTest.dynamicTest;
/**
@@ -20,7 +20,7 @@ import static org.junit.jupiter.api.DynamicTest.dynamicTest;
* All tests are run with a fixed delta of 0.5 so delta considerations can be tested as well.
* Additionally, each PowerGraph::update() call will have its own thread frame, i.e. the method will never be called twice within the same frame.
* Both of these constraints are handled by FakeThreadHandler within PowerTestFixture.
- * Any expected power amount (produced, consumed, buffered) should be affected by FakeThreadHandler.fakeDelta but satisfaction should not!
+ * Any expected power amount (produced, consumed, buffered) should be affected by FakeThreadHandler.fakeDelta but status should not!
*/
public class ItemLiquidGeneratorTests extends PowerTestFixture{
@@ -31,6 +31,8 @@ public class ItemLiquidGeneratorTests extends PowerTestFixture{
private final float maximumLiquidUsage = 0.5f;
public void createGenerator(InputType inputType){
+ Vars.state = new GameState();
+ Vars.state.rules = new Rules();
generator = new ItemLiquidGenerator(inputType != InputType.liquids, inputType != InputType.items, "fakegen"){
{
powerProduction = 0.1f;
diff --git a/tests/src/test/java/power/PowerTests.java b/tests/src/test/java/power/PowerTests.java
index 3c6e20e288..6b253e4f29 100644
--- a/tests/src/test/java/power/PowerTests.java
+++ b/tests/src/test/java/power/PowerTests.java
@@ -16,7 +16,7 @@ import static org.junit.jupiter.api.DynamicTest.dynamicTest;
* All tests are run with a fixed delta of 0.5 so delta considerations can be tested as well.
* Additionally, each PowerGraph::update() call will have its own thread frame, i.e. the method will never be called twice within the same frame.
* Both of these constraints are handled by FakeThreadHandler within PowerTestFixture.
- * Any power amount (produced, consumed, buffered) should be affected by Time.delta() but satisfaction should not!
+ * Any power amount (produced, consumed, buffered) should be affected by Time.delta() but status should not!
*/
public class PowerTests extends PowerTestFixture{
@@ -29,9 +29,9 @@ public class PowerTests extends PowerTestFixture{
class PowerGraphTests{
/**
- * Tests the satisfaction of a single consumer after a single update of the power graph which contains a single producer.
+ * Tests the status of a single consumer after a single update of the power graph which contains a single producer.
*
- * Assumption: When the consumer requests zero power, satisfaction does not change. Default is 0.0f.
+ * Assumption: When the consumer requests zero power, status does not change. Default is 0.0f.
*/
@TestFactory
DynamicTest[] directConsumerSatisfactionIsAsExpected(){
@@ -61,13 +61,13 @@ public class PowerTests extends PowerTestFixture{
assertEquals(producedPower * Time.delta(), powerGraph.getPowerProduced(), Mathf.FLOAT_ROUNDING_ERROR);
assertEquals(requiredPower * Time.delta(), powerGraph.getPowerNeeded(), Mathf.FLOAT_ROUNDING_ERROR);
- // Update and check for the expected power satisfaction of the consumer
+ // Update and check for the expected power status of the consumer
powerGraph.update();
- assertEquals(expectedSatisfaction, directConsumerTile.entity.power.satisfaction, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Satisfaction of direct consumer did not match");
+ assertEquals(expectedSatisfaction, directConsumerTile.entity.power.status, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Satisfaction of direct consumer did not match");
}
/**
- * Tests the satisfaction of a single direct consumer after a single update of the power graph which contains a single producer and a single battery.
+ * Tests the status of a single direct consumer after a single update of the power graph which contains a single producer and a single battery.
* The used battery is created with a maximum capacity of 100 and receives ten power per tick.
*/
@TestFactory
@@ -101,14 +101,14 @@ public class PowerTests extends PowerTestFixture{
}
float maxCapacity = 100f;
Tile batteryTile = createFakeTile(0, 2, createFakeBattery(maxCapacity));
- batteryTile.entity.power.satisfaction = initialBatteryCapacity / maxCapacity;
+ batteryTile.entity.power.status = initialBatteryCapacity / maxCapacity;
powerGraph.add(batteryTile);
powerGraph.update();
- assertEquals(expectedBatteryCapacity / maxCapacity, batteryTile.entity.power.satisfaction, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Expected battery satisfaction did not match");
+ assertEquals(expectedBatteryCapacity / maxCapacity, batteryTile.entity.power.status, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Expected battery status did not match");
if(directConsumerTile != null){
- assertEquals(expectedSatisfaction, directConsumerTile.entity.power.satisfaction, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Satisfaction of direct consumer did not match");
+ assertEquals(expectedSatisfaction, directConsumerTile.entity.power.status, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Satisfaction of direct consumer did not match");
}
}
@@ -124,13 +124,13 @@ public class PowerTests extends PowerTestFixture{
powerGraph.add(consumerTile);
powerGraph.update();
- assertEquals(1.0f, consumerTile.entity.power.satisfaction, Mathf.FLOAT_ROUNDING_ERROR);
+ assertEquals(1.0f, consumerTile.entity.power.status, Mathf.FLOAT_ROUNDING_ERROR);
powerGraph.remove(producerTile);
powerGraph.add(consumerTile);
powerGraph.update();
- assertEquals(0.0f, consumerTile.entity.power.satisfaction, Mathf.FLOAT_ROUNDING_ERROR);
+ assertEquals(0.0f, consumerTile.entity.power.status, Mathf.FLOAT_ROUNDING_ERROR);
if(consumerTile.block().consumes.hasPower()){
ConsumePower consumePower = consumerTile.block().consumes.getPower();
assertFalse(consumePower.valid(consumerTile.entity()));
diff --git a/tests/src/test/resources/build77.msav b/tests/src/test/resources/77.msav
similarity index 100%
rename from tests/src/test/resources/build77.msav
rename to tests/src/test/resources/77.msav
diff --git a/tests/src/test/resources/85.msav b/tests/src/test/resources/85.msav
new file mode 100644
index 0000000000..085f9ec247
Binary files /dev/null and b/tests/src/test/resources/85.msav differ