Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Scoppio committed Feb 4, 2025
1 parent a3031e4 commit a0c40a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
11 changes: 7 additions & 4 deletions megamek/unittests/megamek/client/BasicGameTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;

import java.io.File;
import java.io.IOException;
Expand All @@ -41,6 +42,7 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

@EnabledIfEnvironmentVariable(named = "ENABLE_TW_TESTS", matches = "true")
public class BasicGameTest {

private TWGameManager gameManager;
Expand All @@ -49,7 +51,6 @@ public class BasicGameTest {
private Random random = new Random();
private GameThread gameThread;

// autosave_2024-11-12_17-56-40.sav.gz
private static Map<String, File> testSaves = Map.of(
"one mek each", new File("testresources/data/scenarios/testbot/lounge_1x1_grasslands.sav.gz")
);
Expand Down Expand Up @@ -79,9 +80,11 @@ public void tearDown() {
server.die();
server = null;
}
gameThread.requestStop();
gameThread.die();
gameThread = null;
if (gameThread != null) {
gameThread.requestStop();
gameThread.die();
gameThread = null;
}
gameManager = null;
}

Expand Down
8 changes: 0 additions & 8 deletions megamek/unittests/megamek/client/GameThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,6 @@ private void connectToServer() {
if (!server.loadGame(saveFile)) {
throw new RuntimeException("Failed to load game");
}
var gameOptions = server.getGame().getOptions();


Vector<IBasicOption> changed = new Vector<>();
var option = gameOptions.getOption(OptionsConstants.BASE_RNG_TYPE);
option.setValue(MMRandom.R_SEEDED);
changed.add(option);
sendAction(() -> watcher.sendGameOptions("", changed));
}

@Override
Expand Down

0 comments on commit a0c40a3

Please sign in to comment.