Fixed crash in tile editor as a result of adding Fallout, which has no "occursOn" terrains

This commit is contained in:
Yair Morgenstern
2019-11-23 21:35:03 +02:00
parent 4844a98af1
commit 1230b00688
6 changed files with 71 additions and 40 deletions

View File

@ -1,30 +0,0 @@
// Taken from https://github.com/TomGrill/gdx-testing
package de.tomgrill.gdxtesting.examples;
import com.badlogic.gdx.Gdx;
import com.unciv.models.gamebasics.GameBasics;
import org.junit.Test;
import org.junit.runner.RunWith;
import de.tomgrill.gdxtesting.GdxTestRunner;
import static org.junit.Assert.assertTrue;
@RunWith(GdxTestRunner.class)
public class AssetExistsExampleTest {
@Test
public void gamePngExists() {
assertTrue("This test will only pass when the game.png exists",
Gdx.files.local("game.png").exists());
}
@Test
public void gameBasicsLoad() {
assertTrue("This test will only pass when the game.png exists",
GameBasics.INSTANCE.getBuildings().size() > 0);
}
}

View File

@ -0,0 +1,36 @@
// Taken from https://github.com/TomGrill/gdx-testing
package de.tomgrill.gdxtesting.examples
import com.badlogic.gdx.Gdx
import com.unciv.UnCivGame
import com.unciv.models.gamebasics.GameBasics
import com.unciv.ui.mapeditor.MapEditorScreen
import de.tomgrill.gdxtesting.GdxTestRunner
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(GdxTestRunner::class)
class BasicTests {
@Test
fun gamePngExists() {
assertTrue("This test will only pass when the game.png exists",
Gdx.files.local("game.png").exists())
}
@Test
fun gameBasicsLoad() {
assertTrue("This test will only pass when the GameBasics can initialize, and there are buildings",
GameBasics.Buildings.size > 0)
}
@Test
fun canOpenMapEditorScreen() {
UnCivGame.Current.setScreen(MapEditorScreen(UnCivGame.Current.gameInfo.tileMap))
assertTrue("This test will only pass when we can open the map editor screen",
GameBasics.Buildings.size > 0)
}
}