diff --git a/Plugin Cubot/test/net/simon987/cubotplugin/CubotTest.java b/Plugin Cubot/test/net/simon987/cubotplugin/CubotTest.java index 37ac3e9..b7e7f97 100644 --- a/Plugin Cubot/test/net/simon987/cubotplugin/CubotTest.java +++ b/Plugin Cubot/test/net/simon987/cubotplugin/CubotTest.java @@ -3,17 +3,10 @@ package net.simon987.cubotplugin; import org.junit.Test; -import static org.junit.Assert.assertEquals; - public class CubotTest { @Test public void test(){ - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - assertEquals(1, 1); + } } \ No newline at end of file diff --git a/Server/src/test/java/net/simon987/server/assembly/CPUTest.java b/Server/src/test/java/net/simon987/server/assembly/CPUTest.java index 8231859..42139f6 100644 --- a/Server/src/test/java/net/simon987/server/assembly/CPUTest.java +++ b/Server/src/test/java/net/simon987/server/assembly/CPUTest.java @@ -1,39 +1,6 @@ package net.simon987.server.assembly; -import net.simon987.server.ServerConfiguration; -import net.simon987.server.assembly.exception.CancelledException; -import net.simon987.server.user.User; -import org.junit.Test; - -import java.util.Random; - public class CPUTest { - @Test - public void executeInstruction() throws CancelledException { - - ServerConfiguration config = new ServerConfiguration("config.properties"); - User user = new User(); - CPU cpu = new CPU(config, user); - - - for(int i = 0 ; i < 3 ; i++){ - //Execute every possible instruction with random values in memory - cpu.reset(); - cpu.getMemory().clear(); - Random random = new Random(); - byte[] randomBytes = new byte[cpu.getMemory().getWords().length * 2]; - random.nextBytes(randomBytes); - - for (int machineCode = Character.MIN_VALUE; machineCode < Character.MAX_VALUE; machineCode++) { - Instruction instruction = cpu.getInstructionSet().get(machineCode & 0x03F); // 0000 0000 00XX XXXX - - int source = (machineCode >> 11) & 0x001F; // XXXX X000 0000 0000 - int destination = (machineCode >> 6) & 0x001F; // 0000 0XXX XX00 0000 - - cpu.executeInstruction(instruction, source, destination); - } - } - } } \ No newline at end of file diff --git a/Server/src/test/java/net/simon987/server/assembly/instruction/CallInstructionTest.java b/Server/src/test/java/net/simon987/server/assembly/instruction/CallInstructionTest.java index bf841f4..18c194a 100644 --- a/Server/src/test/java/net/simon987/server/assembly/instruction/CallInstructionTest.java +++ b/Server/src/test/java/net/simon987/server/assembly/instruction/CallInstructionTest.java @@ -1,45 +1,7 @@ package net.simon987.server.assembly.instruction; -import net.simon987.server.ServerConfiguration; -import net.simon987.server.assembly.*; -import net.simon987.server.user.User; -import org.junit.Test; - public class CallInstructionTest { - @Test - public void execute() throws Exception { - - ServerConfiguration config = new ServerConfiguration("config.properties"); - int memorySize = config.getInt("memory_size"); - - //Memory - Memory memory = new Memory(memorySize); - memory.clear(); - - //RegisterSet - RegisterSet registerSet = new RegisterSet(); - registerSet.put(1, new Register("T1")); - registerSet.put(2, new Register("T2")); - registerSet.clear(); - - //Status - Status status = new Status(); - status.clear(); - - CPU cpu = new CPU(config, new User()); - - CallInstruction callInstruction = new CallInstruction(cpu); - - //We have to check if IP is 'pushed' correctly (try to pop it), the - - - - } - - @Test - public void execute1() throws Exception { - } } \ No newline at end of file