start by moving positioned(module) to position(class)
This commit is contained in:
@ -18,9 +18,9 @@ module Arm
|
||||
def test_method_call
|
||||
Risc.machine.boot
|
||||
bin = Parfait::BinaryCode.new(1)
|
||||
Positioned.set_position(bin , 0x20)
|
||||
Risc::Position.set_position(bin , 0x20)
|
||||
code = @machine.call( bin ,{} )#this jumps to the next instruction
|
||||
Positioned.set_position(code , 0)
|
||||
Risc::Position.set_position(code , 0)
|
||||
assert_code code , :call, [0x09,0x0,0x0,0xeb]
|
||||
end
|
||||
def test_swi
|
||||
|
@ -22,7 +22,7 @@ module Arm
|
||||
end
|
||||
def test_mov_big
|
||||
code = @machine.mov :r0, 0x222 # is not 8 bit and can't be rotated by the arm system in one instruction
|
||||
code.set_position(0)
|
||||
code.set_position(0,0)
|
||||
begin # mov 512(0x200) = e3 a0 0c 02 add 34(0x22) = e2 90 00 22
|
||||
assert_code code , :mov , [ 0x02,0x0c,0xb0,0xe3]
|
||||
rescue Risc::LinkException
|
||||
|
@ -25,7 +25,7 @@ module Risc
|
||||
end
|
||||
def test_has_positions
|
||||
@machine.objects.each do |id,obj|
|
||||
assert Positioned.position(obj)
|
||||
assert Position.position(obj)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require_relative "../helper"
|
||||
|
||||
class TestPositioned < MiniTest::Test
|
||||
class TestPosition < MiniTest::Test
|
||||
def setup
|
||||
Risc.machine.boot unless Risc.machine.booted
|
||||
end
|
||||
@ -22,10 +22,10 @@ class TestPositioned < MiniTest::Test
|
||||
assert_equal 32 , word.padded_length
|
||||
end
|
||||
def test_raises_no_init
|
||||
assert_raises { Positioned.position(self)}
|
||||
assert_raises { Position.position(self)}
|
||||
end
|
||||
def test_raises_set_nil
|
||||
assert_raises { Positioned.set_position(self,nil)}
|
||||
assert_raises { Position.set_position(self,nil)}
|
||||
end
|
||||
def test_raises_reset_far
|
||||
assert_raises do
|
||||
|
Reference in New Issue
Block a user