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

@ -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();