rename Position get/set
This commit is contained in:
@ -18,9 +18,9 @@ module Arm
|
||||
def test_method_call
|
||||
Risc.machine.boot
|
||||
bin = Parfait::BinaryCode.new(1)
|
||||
Risc::Position.set_position(bin , 0x20)
|
||||
Risc::Position.set(bin , 0x20)
|
||||
code = @machine.call( bin ,{} )#this jumps to the next instruction
|
||||
Risc::Position.set_position(code , 0)
|
||||
Risc::Position.set(code , 0)
|
||||
assert_code code , :call, [0x09,0x0,0x0,0xeb]
|
||||
end
|
||||
def test_swi
|
||||
|
@ -25,7 +25,7 @@ module Risc
|
||||
end
|
||||
def test_has_positions
|
||||
@machine.objects.each do |id,obj|
|
||||
assert Position.position(obj)
|
||||
assert Position.get(obj)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -22,27 +22,27 @@ module Risc
|
||||
assert_equal 4 , res
|
||||
end
|
||||
def test_set
|
||||
pos = Position.set_position(self , 5)
|
||||
pos = Position.set(self , 5)
|
||||
assert_equal 5 , pos.at
|
||||
end
|
||||
def test_set_instr
|
||||
pos = Position.set_position( Risc::Label.new("hi","ho") , 0)
|
||||
pos = Position.set( Risc::Label.new("hi","ho") , 0)
|
||||
assert_equal IPosition , pos.class
|
||||
end
|
||||
def tet_tos
|
||||
assert_equal "0x10" , Position.set_position(self).to_s
|
||||
assert_equal "0x10" , Position.set(self).to_s
|
||||
end
|
||||
def test_reset_ok
|
||||
pos = Position.set_position(self , 5)
|
||||
pos = Position.set_position(self , 10)
|
||||
pos = Position.set(self , 5)
|
||||
pos = Position.set(self , 10)
|
||||
assert_equal 10 , pos.at
|
||||
end
|
||||
def test_reset_fail
|
||||
Position.set_position(self , 5)
|
||||
assert_raises{Position.set_position(self , 10000)}
|
||||
Position.set(self , 5)
|
||||
assert_raises{Position.set(self , 10000)}
|
||||
end
|
||||
def test_raises_set_nil
|
||||
assert_raises { Position.set_position(self,nil)}
|
||||
assert_raises { Position.set(self,nil)}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user