mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-19 18:46:43 +00:00
Moved tests to appropriate directory
This commit is contained in:
parent
1131e4d512
commit
735a231767
@ -52,7 +52,6 @@ public class CubotLaser extends CpuHardware {
|
|||||||
Point frontTile = cubot.getFrontTile();
|
Point frontTile = cubot.getFrontTile();
|
||||||
ArrayList<GameObject> objects = cubot.getWorld().getGameObjectsBlockingAt(frontTile.x, frontTile.y);
|
ArrayList<GameObject> objects = cubot.getWorld().getGameObjectsBlockingAt(frontTile.x, frontTile.y);
|
||||||
|
|
||||||
|
|
||||||
if (cubot.getCurrentAction() == Action.IDLE && objects.size() > 0) {
|
if (cubot.getCurrentAction() == Action.IDLE && objects.size() > 0) {
|
||||||
//FIXME: Problem here if more than 1 object
|
//FIXME: Problem here if more than 1 object
|
||||||
if (objects.get(0) instanceof InventoryHolder) {
|
if (objects.get(0) instanceof InventoryHolder) {
|
||||||
|
@ -14,6 +14,6 @@ public class CubotTest {
|
|||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
assertEquals(1,2);
|
assertEquals(1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@ import net.simon987.server.assembly.exception.CancelledException;
|
|||||||
import net.simon987.server.user.User;
|
import net.simon987.server.user.User;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class CPUTest {
|
public class CPUTest {
|
||||||
@ -13,7 +12,7 @@ public class CPUTest {
|
|||||||
@Test
|
@Test
|
||||||
public void executeInstruction() throws CancelledException {
|
public void executeInstruction() throws CancelledException {
|
||||||
|
|
||||||
ServerConfiguration config = new ServerConfiguration(new File("config.properties"));
|
ServerConfiguration config = new ServerConfiguration("config.properties");
|
||||||
User user = new User();
|
User user = new User();
|
||||||
CPU cpu = new CPU(config, user);
|
CPU cpu = new CPU(config, user);
|
||||||
|
|
@ -3,15 +3,13 @@ package net.simon987.server.assembly;
|
|||||||
import net.simon987.server.ServerConfiguration;
|
import net.simon987.server.ServerConfiguration;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
|
||||||
public class MemoryTest {
|
public class MemoryTest {
|
||||||
@Test
|
@Test
|
||||||
public void getSet() {
|
public void getSet() {
|
||||||
ServerConfiguration config = new ServerConfiguration(new File("config.properties"));
|
ServerConfiguration config = new ServerConfiguration("config.properties");
|
||||||
int memorySize = config.getInt("memory_size");
|
int memorySize = config.getInt("memory_size");
|
||||||
Memory memory = new Memory(memorySize);
|
Memory memory = new Memory(memorySize);
|
||||||
|
|
||||||
@ -31,7 +29,7 @@ public class MemoryTest {
|
|||||||
@Test
|
@Test
|
||||||
public void write() {
|
public void write() {
|
||||||
|
|
||||||
ServerConfiguration config = new ServerConfiguration(new File("config.properties"));
|
ServerConfiguration config = new ServerConfiguration("config.properties");
|
||||||
int memorySize = config.getInt("memory_size");
|
int memorySize = config.getInt("memory_size");
|
||||||
Memory memory = new Memory(memorySize);
|
Memory memory = new Memory(memorySize);
|
||||||
|
|
@ -7,8 +7,6 @@ import net.simon987.server.assembly.RegisterSet;
|
|||||||
import net.simon987.server.assembly.Status;
|
import net.simon987.server.assembly.Status;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
|
||||||
@ -20,7 +18,7 @@ public class AddInstructionTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void addTargetTarget() {
|
public void addTargetTarget() {
|
||||||
ServerConfiguration config = new ServerConfiguration(new File("config.properties"));
|
ServerConfiguration config = new ServerConfiguration("config.properties");
|
||||||
int memorySize = config.getInt("memory_size");
|
int memorySize = config.getInt("memory_size");
|
||||||
|
|
||||||
//Memory
|
//Memory
|
||||||
@ -131,7 +129,7 @@ public class AddInstructionTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void addTargetImm() {
|
public void addTargetImm() {
|
||||||
ServerConfiguration config = new ServerConfiguration(new File("config.properties"));
|
ServerConfiguration config = new ServerConfiguration("config.properties");
|
||||||
int memorySize = config.getInt("memory_size");
|
int memorySize = config.getInt("memory_size");
|
||||||
|
|
||||||
//Memory
|
//Memory
|
@ -5,8 +5,6 @@ import net.simon987.server.assembly.Memory;
|
|||||||
import net.simon987.server.assembly.Status;
|
import net.simon987.server.assembly.Status;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
||||||
@ -14,7 +12,7 @@ public class AndInstructionTest {
|
|||||||
@Test
|
@Test
|
||||||
public void executeTargetTarget() {
|
public void executeTargetTarget() {
|
||||||
|
|
||||||
ServerConfiguration config = new ServerConfiguration(new File("config.properties"));
|
ServerConfiguration config = new ServerConfiguration("config.properties");
|
||||||
int memorySize = config.getInt("memory_size");
|
int memorySize = config.getInt("memory_size");
|
||||||
|
|
||||||
//Memory
|
//Memory
|
||||||
@ -56,7 +54,7 @@ public class AndInstructionTest {
|
|||||||
@Test
|
@Test
|
||||||
public void executeTargetImm() {
|
public void executeTargetImm() {
|
||||||
|
|
||||||
ServerConfiguration config = new ServerConfiguration(new File("config.properties"));
|
ServerConfiguration config = new ServerConfiguration("config.properties");
|
||||||
int memorySize = config.getInt("memory_size");
|
int memorySize = config.getInt("memory_size");
|
||||||
|
|
||||||
//Memory
|
//Memory
|
@ -5,15 +5,13 @@ import net.simon987.server.assembly.*;
|
|||||||
import net.simon987.server.user.User;
|
import net.simon987.server.user.User;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
public class CallInstructionTest {
|
public class CallInstructionTest {
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void execute() throws Exception {
|
public void execute() throws Exception {
|
||||||
|
|
||||||
ServerConfiguration config = new ServerConfiguration(new File("config.properties"));
|
ServerConfiguration config = new ServerConfiguration("config.properties");
|
||||||
int memorySize = config.getInt("memory_size");
|
int memorySize = config.getInt("memory_size");
|
||||||
|
|
||||||
//Memory
|
//Memory
|
Loading…
x
Reference in New Issue
Block a user