|
@@ -51,6 +51,27 @@ class TestSingleMnemonics {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ void testSETB() throws SyntaxError {
|
|
|
+ SETB mno = new SETB("SETB");
|
|
|
+ assertEquals(0x61, mno.getByte());
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETB mno1 = new SETB("SETB akfhaskh");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETB mno1 = new SETB("SETB 12");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETB mno1 = new SETB("SETB :label");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
void testCSET() throws SyntaxError {
|
|
|
CSET mno = new CSET("CSET");
|
|
@@ -72,6 +93,27 @@ class TestSingleMnemonics {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ void testSETC() throws SyntaxError {
|
|
|
+ SETC mno = new SETC("SETC");
|
|
|
+ assertEquals(0x62, mno.getByte());
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETC mno1 = new SETC("SETC akfhaskh");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETC mno1 = new SETC("SETC 12");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETC mno1 = new SETC("SETC :label");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
void testDSET() throws SyntaxError {
|
|
|
DSET mno = new DSET("DSET");
|
|
@@ -93,6 +135,27 @@ class TestSingleMnemonics {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ void testSETD() throws SyntaxError {
|
|
|
+ SETD mno = new SETD("SETD");
|
|
|
+ assertEquals(0x63, mno.getByte());
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETD mno1 = new SETD("SETD akfhaskh");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETD mno1 = new SETD("SETD 12");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETD mno1 = new SETD("SETD :label");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
void testESET() throws SyntaxError {
|
|
|
ESET mno = new ESET("ESET");
|
|
@@ -114,6 +177,27 @@ class TestSingleMnemonics {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ void testSETE() throws SyntaxError {
|
|
|
+ SETE mno = new SETE("SETE");
|
|
|
+ assertEquals(0x6D, mno.getByte());
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETE mno1 = new SETE("SETE akfhaskh");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETE mno1 = new SETE("SETE 12");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETE mno1 = new SETE("SETE :label");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
void testFSET() throws SyntaxError {
|
|
|
FSET mno = new FSET("FSET");
|
|
@@ -135,6 +219,27 @@ class TestSingleMnemonics {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ void testSETF() throws SyntaxError {
|
|
|
+ SETF mno = new SETF("SETF");
|
|
|
+ assertEquals(0x6E, mno.getByte());
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETF mno1 = new SETF("SETF akfhaskh");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETF mno1 = new SETF("SETF 12");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ SETF mno1 = new SETF("SETF :label");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
void testPUSH() throws SyntaxError {
|
|
|
PUSH mno = new PUSH("PUSH");
|
|
@@ -156,6 +261,27 @@ class TestSingleMnemonics {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ void testPOP() throws SyntaxError {
|
|
|
+ POP mno = new POP("POP");
|
|
|
+ assertEquals(0x6f, mno.getByte());
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ POP mno1 = new POP("POP akfhaskh");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ POP mno1 = new POP("POP 12");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ POP mno1 = new POP("POP :label");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
void testMnemonicFactory() throws SyntaxError {
|
|
|
Mnemonic mnemonic = MnemonicFactory.getMnemonic("SWAP", 0);
|
|
@@ -178,5 +304,20 @@ class TestSingleMnemonics {
|
|
|
|
|
|
mnemonic = MnemonicFactory.getMnemonic("PUSH", 0);
|
|
|
assertEquals(PUSH.class, mnemonic.getClass());
|
|
|
+
|
|
|
+ mnemonic = MnemonicFactory.getMnemonic("SETB", 0);
|
|
|
+ assertEquals(SETB.class, mnemonic.getClass());
|
|
|
+
|
|
|
+ mnemonic = MnemonicFactory.getMnemonic("SETC", 0);
|
|
|
+ assertEquals(SETC.class, mnemonic.getClass());
|
|
|
+
|
|
|
+ mnemonic = MnemonicFactory.getMnemonic("SETD", 0);
|
|
|
+ assertEquals(SETD.class, mnemonic.getClass());
|
|
|
+
|
|
|
+ mnemonic = MnemonicFactory.getMnemonic("SETE", 0);
|
|
|
+ assertEquals(SETE.class, mnemonic.getClass());
|
|
|
+
|
|
|
+ mnemonic = MnemonicFactory.getMnemonic("SETF", 0);
|
|
|
+ assertEquals(SETF.class, mnemonic.getClass());
|
|
|
}
|
|
|
}
|