mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-18 10:31:57 +00:00
e3295cc5be
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153248 91177308-0d34-0410-b5e6-96231b3b80d8
24 lines
702 B
Python
24 lines
702 B
Python
from .base import TestBase
|
|
from ..core import OpCode
|
|
from ..core import MemoryBuffer
|
|
|
|
class TestCore(TestBase):
|
|
def test_opcode(self):
|
|
self.assertTrue(hasattr(OpCode, 'Ret'))
|
|
self.assertTrue(isinstance(OpCode.Ret, OpCode))
|
|
self.assertEqual(OpCode.Ret.value, 1)
|
|
|
|
op = OpCode.from_value(1)
|
|
self.assertTrue(isinstance(op, OpCode))
|
|
self.assertEqual(op, OpCode.Ret)
|
|
|
|
def test_memory_buffer_create_from_file(self):
|
|
source = self.get_test_binary()
|
|
|
|
MemoryBuffer(filename=source)
|
|
|
|
def test_memory_buffer_failing(self):
|
|
with self.assertRaises(Exception):
|
|
MemoryBuffer(filename="/hopefully/this/path/doesnt/exist")
|
|
|