finally creating less objects in the test

basic still #23 , now applied
Basic size of 20, interpreter gets 50 and the full set is 1024

Tests run more than twice as fast!!
This commit is contained in:
Torsten Ruger
2019-02-09 12:44:35 +02:00
parent 37eeb81f45
commit a89301d623
11 changed files with 84 additions and 43 deletions

View File

@ -41,7 +41,7 @@ module Risc
ret = main_ticks(68)
assert_equal FunctionReturn , ret.class
assert_equal :r1 , ret.register.symbol
assert_equal 175116 , @interpreter.get_register(ret.register)
assert_equal 22284 , @interpreter.get_register(ret.register)
end
end
end

View File

@ -54,7 +54,7 @@ module Risc
end
def test_pc1
@interpreter.tick
assert_equal 174552 , @interpreter.pc
assert_equal 21688 , @interpreter.pc
end
def test_tick2
@interpreter.tick
@ -68,7 +68,7 @@ module Risc
def test_pc2
@interpreter.tick
@interpreter.tick
assert_equal 174556 , @interpreter.pc
assert_equal 21692 , @interpreter.pc
end
def test_tick_14_jump
14.times {@interpreter.tick}

View File

@ -25,7 +25,7 @@ module Risc
assert_equal 0 , Position.get(@linker.cpu_init).at
end
def test_cpu_at
assert_equal "0x2b90c" , Position.get(@linker.cpu_init.first).to_s
assert_equal "0x4f1c" , Position.get(@linker.cpu_init.first).to_s
end
def test_cpu_label
assert_equal Position , Position.get(@linker.cpu_init.first).class