use factory to generte intergers in space

start with just integer factory in space
change all the hand-out code
still #14
This commit is contained in:
Torsten Ruger
2018-08-24 18:49:21 +03:00
parent d396da16e3
commit 71ab369c71
16 changed files with 59 additions and 61 deletions

View File

@ -28,7 +28,7 @@ module Risc
end
def test_load_first_message #from space (ie r2)
sl = @produced.next( 2 )
assert_slot_to_reg( sl , :r2 , 3 , :r3 )
assert_slot_to_reg( sl , :r2 , 4 , :r3 )
end
def test_get_next_next #reduce onto itself
sl = @produced.next( 3 )
@ -36,7 +36,7 @@ module Risc
end
def test_store_next_next_in_space
sl = @produced.next( 4 )
assert_reg_to_slot( sl , :r4 , :r2 , 3 )
assert_reg_to_slot( sl , :r4 , :r2 , 4 )
end
def test_store_message_in_current
sl = @produced.next( 5 )

View File

@ -36,13 +36,13 @@ module Risc
assert_load( instruction(4) , Parfait::Space )
end
def test_get_next
assert_slot_to_reg( instruction( 5 ) , :r3 , 3 , :r4 )
assert_slot_to_reg( instruction( 5 ) , :r3 , 4 , :r4 )
end
def test_save_next
assert_reg_to_slot( instruction( 6 ) , :r4 , :r0 , 1 )
end
def test_save_this
assert_reg_to_slot( instruction( 7 ) , :r0 , :r3 , 3 )
assert_reg_to_slot( instruction( 7 ) , :r0 , :r3 , 4 )
end
def test_save_addr