mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-22 13:48:25 +07:00
Test fixes
This commit is contained in:
@ -25,9 +25,14 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class ApplicationTests{
|
||||
static Map testMap;
|
||||
static boolean initialized;
|
||||
|
||||
@BeforeAll
|
||||
static void launchApplication(){
|
||||
//only gets called once
|
||||
if(initialized) return;
|
||||
initialized = true;
|
||||
|
||||
try{
|
||||
boolean[] begins = {false};
|
||||
Throwable[] exceptionThrown = {null};
|
||||
@ -102,6 +107,7 @@ public class ApplicationTests{
|
||||
@Test
|
||||
void spawnWaves(){
|
||||
world.loadMap(testMap);
|
||||
assertTrue(world.spawner.countSpawns() > 0, "No spawns present.");
|
||||
logic.runWave();
|
||||
//force trigger delayed spawns
|
||||
Time.setDeltaProvider(() -> 1000f);
|
||||
@ -109,7 +115,7 @@ public class ApplicationTests{
|
||||
Time.update();
|
||||
Time.setDeltaProvider(() -> 1f);
|
||||
unitGroups[waveTeam.ordinal()].updateEvents();
|
||||
assertFalse(unitGroups[waveTeam.ordinal()].isEmpty());
|
||||
assertFalse(unitGroups[waveTeam.ordinal()].isEmpty(), "No enemies spawned.");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,7 +1,6 @@
|
||||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.arc.collection.ObjectSet;
|
||||
import io.anuke.arc.util.Structs;
|
||||
import io.anuke.arc.util.Time;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.Zone;
|
||||
@ -51,7 +50,7 @@ public class ZoneTests{
|
||||
}
|
||||
|
||||
assertTrue(hasSpawnPoint, "Zone \"" + zone.name + "\" has no spawn points.");
|
||||
//assertTrue(world.spawner.countSpawns() > 0, "Zone \"" + zone.name + "\" has no enemy spawn points: " + world.spawner.countSpawns());
|
||||
assertTrue(world.spawner.countSpawns() > 0, "Zone \"" + zone.name + "\" has no enemy spawn points: " + world.spawner.countSpawns());
|
||||
|
||||
for(Item item : resources){
|
||||
assertTrue(Structs.contains(zone.resources, item), "Zone \"" + zone.name + "\" is missing item in resource list: \"" + item.name + "\"");
|
||||
|
Reference in New Issue
Block a user