debugging binaries, initial jump issues

This commit is contained in:
Torsten Ruger
2018-04-30 13:28:55 +03:00
parent d84d208192
commit 1acd231a33
7 changed files with 37 additions and 14 deletions

View File

@ -85,6 +85,13 @@ module Parfait
@code.each_word{ len += 1}
assert_equal 13 , len
end
def test_each_set
(1..13).each{|i| @code.set_word(i,i)}
all = []
@code.each_word{ |w| all << w}
assert_equal 1 , all.first
assert_equal 13 , all.last
end
def test_set_word
assert_equal 1 , @code.set_word(1 , 1)
end

View File

@ -28,9 +28,18 @@ module Risc
assert Positioned.position(obj)
end
end
def test_binary
end
class TestMachineInit < MiniTest::Test
def setup
@machine = Risc.machine.boot
@machine.position_all
@machine.create_binary
end
def test_has_binary
assert_equal Parfait::BinaryCode , @machine.binary_init.class
end
def test_has_jump
assert_equal "1" , @machine.binary_init.get_word(1).to_s(16)
end
end
end