Fixed tests

This commit is contained in:
Anuken 2025-05-04 23:32:32 -04:00
parent fff8f20745
commit 4cc40ca1ac
5 changed files with 8 additions and 9 deletions

View file

@ -1,5 +1,6 @@
package mindustry.content;
import mindustry.*;
import mindustry.type.*;
import static mindustry.content.Planets.*;
@ -175,6 +176,9 @@ public class SectorPresets{
240 //Cold Grove by wpx: https://discord.com/channels/391020510269669376/1165421701362897000/1230550892718194742
);
Vars.content.sector("sector-serpulo-173").captureWave = 17;
Vars.content.sector("sector-serpulo-240").captureWave = 40;
//endregion
//region erekir

View file

@ -65,7 +65,7 @@ public class CrashHandler{
//don't create crash logs for custom builds, as it's expected
if(OS.username.equals("anuke") && !"steam".equals(Version.modifier)){
// System.exit(1);
System.exit(1);
}
//attempt to load version regardless

View file

@ -29,8 +29,9 @@ public class DirectConsumerTests extends PowerTestFixture{
testUnitFactory(30, 30, 0.08f, 0.08f, 1.0f);
}
static int fakes = 0;
void testUnitFactory(int siliconAmount, int leadAmount, float producedPower, float requestedPower, float expectedSatisfaction){
Tile ct = createFakeTile(0, 0, new GenericCrafter("fakefactory"){{
Tile ct = createFakeTile(0, 0, new GenericCrafter("fakefactory" + (fakes ++)){{
hasPower = true;
hasItems = true;
consumePower(requestedPower);

View file

@ -6,7 +6,6 @@ import arc.util.*;
import mindustry.*;
import mindustry.content.*;
import mindustry.core.*;
import mindustry.ctype.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.world.*;
@ -32,12 +31,7 @@ public class PowerTestFixture{
boolean make = content == null;
if(make){
Vars.content = new ContentLoader(){
@Override
public void handleMappableContent(MappableContent content){
}
};
Vars.content = new ContentLoader();
}
Vars.state = new GameState();
Vars.tree = new FileTree();