rework binary code positioning setup
dependency chain set up explicitly. Next have to react to events correctly
This commit is contained in:
@ -12,8 +12,12 @@ module Risc
|
||||
end
|
||||
|
||||
def test_has_init
|
||||
CodeListener.init(@binary)
|
||||
assert Position.get(@binary)
|
||||
pos = CodeListener.init(@binary)
|
||||
assert_equal pos, Position.get(@binary)
|
||||
end
|
||||
def test_init_returns_position
|
||||
|
||||
assert_equal Position::ObjectPosition , CodeListener.init(@binary).class
|
||||
end
|
||||
def test_init_listner
|
||||
@binary.extend_one
|
||||
|
@ -6,7 +6,12 @@ module Risc
|
||||
class TestPositionBasic < MiniTest::Test
|
||||
|
||||
def test_init
|
||||
assert_equal ObjectPosition.init(self)
|
||||
assert ObjectPosition.init(self , -1)
|
||||
end
|
||||
def test_next_slot
|
||||
mov = Arm::ArmMachine.mov(:r1 , :r1)
|
||||
position = ObjectPosition.new(mov , 0)
|
||||
assert_equal 4, position.next_slot
|
||||
end
|
||||
def pest_creation_ok
|
||||
assert ObjectPosition.new(self,0)
|
||||
|
Reference in New Issue
Block a user