aboutsummaryrefslogtreecommitdiffstats
path: root/asm/test.py
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2023-02-11 17:36:15 +0000
committerGravatar Peter McGoron 2023-02-11 17:36:15 +0000
commit18ad8f03c6568f66f678c8f193b30ecb16074fcf (patch)
treec2bfe71d1b947130e4dd75018388e3b39e8f4735 /asm/test.py
parentadd stack overflow and underflow tests (diff)
more test
Diffstat (limited to 'asm/test.py')
-rw-r--r--asm/test.py42
1 files changed, 30 insertions, 12 deletions
diff --git a/asm/test.py b/asm/test.py
index bddf0a3..1f66a4a 100644
--- a/asm/test.py
+++ b/asm/test.py
@@ -185,7 +185,7 @@ class AddTest(unittest.TestCase):
self.assertEqual(ex.cenv.reg[0], 30)
self.assertEqual(ex.cenv.reg[1], word_2c(10))
- def test_exec_mul_throw_imm(self):
+ def test_exec_add_throw_imm(self):
p = Program()
with self.assertRaises(TypecheckException) as cm:
p.parse_asm_line("add 5 6 7")
@@ -194,16 +194,7 @@ class AddTest(unittest.TestCase):
self.assertEqual(cm.exception.i, 0)
self.assertEqual(cm.exception.opcode, 3)
- def test_exec_mul_throw_imm(self):
- p = Program()
- with self.assertRaises(TypecheckException) as cm:
- p.parse_asm_line("add 5 6 7")
- self.assertEqual(cm.exception.argtype, ArgType.REG)
- self.assertEqual(cm.exception.sarg, '5')
- self.assertEqual(cm.exception.i, 0)
- self.assertEqual(cm.exception.opcode, 3)
-
- def test_exec_mul_throw_lab_1(self):
+ def test_exec_add_throw_lab_1(self):
p = Program()
with self.assertRaises(TypecheckException) as cm:
p.parse_asm_line("add r0 l6 7")
@@ -212,7 +203,7 @@ class AddTest(unittest.TestCase):
self.assertEqual(cm.exception.i, 1)
self.assertEqual(cm.exception.opcode, 3)
- def test_exec_mul_throw_lab_2(self):
+ def test_exec_add_throw_lab_2(self):
p = Program()
with self.assertRaises(TypecheckException) as cm:
p.parse_asm_line("add r0 12 l24")
@@ -240,6 +231,33 @@ class MulTest(unittest.TestCase):
self.assertEqual(ex.cenv.reg[0], word_2c(25))
self.assertEqual(ex.cenv.reg[1], 125)
+ def test_exec_mul_throw_imm(self):
+ p = Program()
+ with self.assertRaises(TypecheckException) as cm:
+ p.parse_asm_line("mul 942 6 7")
+ self.assertEqual(cm.exception.argtype, ArgType.REG)
+ self.assertEqual(cm.exception.sarg, '942')
+ self.assertEqual(cm.exception.i, 0)
+ self.assertEqual(cm.exception.opcode, 4)
+
+ def test_exec_mul_throw_lab_1(self):
+ p = Program()
+ with self.assertRaises(TypecheckException) as cm:
+ p.parse_asm_line("mul r9 l2 1991")
+ self.assertEqual(cm.exception.argtype, ArgType.VAL)
+ self.assertEqual(cm.exception.sarg, 'l2')
+ self.assertEqual(cm.exception.i, 1)
+ self.assertEqual(cm.exception.opcode, 4)
+
+ def test_exec_mul_throw_lab_2(self):
+ p = Program()
+ with self.assertRaises(TypecheckException) as cm:
+ p.parse_asm_line("mul r0 -11 l48")
+ self.assertEqual(cm.exception.argtype, ArgType.VAL)
+ self.assertEqual(cm.exception.sarg, 'l48')
+ self.assertEqual(cm.exception.i, 2)
+ self.assertEqual(cm.exception.opcode, 4)
+
class ProgramTest(unittest.TestCase):
def test_exec_simple_reg(self):
p = Program()
1-3bb7-0310-b661-cf11e63c67ab 2002-12-24update iso API for multi-channel reception and new packet buffer layoutGravatar dmaas 4-123/+236 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@98 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-20oops, irq_interval needs to be signedGravatar anonymous 1-1/+1 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@97 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-20dmaas - renamed exported arm definitions into the raw1394_ namespace; ↵Gravatar anonymous 3-124/+48 brought kernel-raw1394.h back in sync with the kernel version git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@96 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-16rawiso updates:Gravatar dmaas 3-18/+25 - changed return type of rawiso xmit/recv handlers from int to enum raw1394_iso_disposition - added an ioctl (RAW1394_ISO_QUEUE_ACTIVITY) to force an ISO_ACTIVITY event into the queue. This is needed for handling RAW1394_ISO_DEFER, to kick us out of the next read() instead of sleeping forever. - removed references to "8-byte" isochronous header - this is an OHCI-specific implementation detail git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@95 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-11-18fix cplusplus extern C blockGravatar ddennedy 1-4/+4 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@94 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-11-18merged rawiso branchGravatar ddennedy 7-6/+488 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@93 53a565d1-3bb7-0310-b661-cf11e63c67ab