2019-09-15 17:31:10 +02:00
|
|
|
require_relative "helper"
|
|
|
|
|
2019-10-03 19:55:41 +02:00
|
|
|
module SlotMachine
|
|
|
|
class TestArgumentTransfer < SlotMachineInstructionTest
|
2019-09-15 17:31:10 +02:00
|
|
|
def instruction
|
2020-02-15 15:02:03 +01:00
|
|
|
receiver = SlottedMessage.new( [:receiver])
|
2019-09-15 17:31:10 +02:00
|
|
|
arg = SlotLoad.new("test", [:message, :caller] , [:message,:type] )
|
|
|
|
ArgumentTransfer.new("" , receiver ,[arg])
|
|
|
|
end
|
|
|
|
def test_len
|
|
|
|
assert_equal 6 , all.length , all_str
|
|
|
|
end
|
|
|
|
def test_1_slot
|
|
|
|
assert_slot_to_reg risc(1) ,:r0 , 2 , :r2
|
|
|
|
end
|
|
|
|
def test_2_slot
|
|
|
|
assert_slot_to_reg risc(2) ,:r0 , 1 , :r3
|
|
|
|
end
|
|
|
|
def test_3_reg
|
|
|
|
assert_reg_to_slot risc(3) , :r2 , :r3 , 2
|
|
|
|
end
|
|
|
|
def test_4_slot
|
|
|
|
assert_slot_to_reg risc(4) ,:r0 , 0 , :r2
|
|
|
|
end
|
|
|
|
def test_5_reg
|
|
|
|
assert_reg_to_slot risc(5) , :r2 , :r0 , 6
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|