adjust branch names

IsXXX  with xxx as condition, same as after if_xxx
AlwaysBranch is back to Branch
This commit is contained in:
Torsten Ruger
2015-10-19 16:08:00 +03:00
parent 50379a1fea
commit 1fd937927c
10 changed files with 28 additions and 28 deletions

View File

@ -26,7 +26,7 @@ class AddTest < MiniTest::Test
def test_branch
was = @interpreter.block
assert_equal Register::AlwaysBranch , ticks(1).class
assert_equal Register::Branch , ticks(1).class
assert was != @interpreter.block
end
def test_load
@ -66,7 +66,7 @@ class AddTest < MiniTest::Test
def test_chain
#show_ticks # get output of what is
["AlwaysBranch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
"FunctionCall","SaveReturn","LoadConstant","LoadConstant","OperatorInstruction",
"RegisterTransfer","GetSlot","FunctionReturn","RegisterTransfer","Syscall",
"NilClass"].each_with_index do |name , index|

View File

@ -59,7 +59,7 @@ HERE
@interpreter = Interpreter::Interpreter.new
@interpreter.start Virtual.machine.init
#show_ticks # get output of what is
["AlwaysBranch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
"FunctionCall","SaveReturn","GetSlot","LoadConstant","SetSlot",
"LoadConstant","SetSlot","RegisterTransfer","FunctionCall","SaveReturn",
"LoadConstant","GetSlot","SetSlot","GetSlot","GetSlot",
@ -67,22 +67,22 @@ HERE
"SetSlot","RegisterTransfer","FunctionCall","SaveReturn","GetSlot",
"LoadConstant","OperatorInstruction","GetSlot","SetSlot","GetSlot",
"GetSlot","GetSlot","OperatorInstruction","GetSlot","SetSlot",
"GetSlot","GetSlot","IsZeroBranch","GetSlot","GetSlot",
"GetSlot","GetSlot","IsZero","GetSlot","GetSlot",
"GetSlot","SetSlot","LoadConstant","SetSlot","GetSlot",
"SetSlot","RegisterTransfer","FunctionCall","SaveReturn","GetSlot",
"LoadConstant","OperatorInstruction","GetSlot","SetSlot","GetSlot",
"GetSlot","GetSlot","OperatorInstruction","GetSlot","SetSlot",
"GetSlot","GetSlot","IsZeroBranch","GetSlot","GetSlot",
"GetSlot","GetSlot","IsZero","GetSlot","GetSlot",
"GetSlot","SetSlot","LoadConstant","SetSlot","GetSlot",
"SetSlot","RegisterTransfer","FunctionCall","SaveReturn","GetSlot",
"LoadConstant","OperatorInstruction","GetSlot","SetSlot","GetSlot",
"GetSlot","GetSlot","OperatorInstruction","GetSlot","SetSlot",
"GetSlot","GetSlot","IsZeroBranch","GetSlot","GetSlot",
"GetSlot","GetSlot","IsZero","GetSlot","GetSlot",
"GetSlot","SetSlot","LoadConstant","SetSlot","GetSlot",
"SetSlot","RegisterTransfer","FunctionCall","SaveReturn","GetSlot",
"LoadConstant","OperatorInstruction","GetSlot","SetSlot","GetSlot",
"GetSlot","GetSlot","OperatorInstruction","GetSlot","SetSlot",
"GetSlot","GetSlot","IsZeroBranch","GetSlot","GetSlot",
"GetSlot","GetSlot","IsZero","GetSlot","GetSlot",
"GetSlot"].each_with_index do |name , index|
got = ticks(1)
assert got.class.name.index(name) , "Wrong class for #{index+1}, expect #{name} , got #{got}"

View File

@ -26,7 +26,7 @@ class TestPuts < MiniTest::Test
def test_branch
was = @interpreter.block
assert_equal Register::AlwaysBranch , ticks(1).class
assert_equal Register::Branch , ticks(1).class
assert was != @interpreter.block
end
def test_load
@ -56,7 +56,7 @@ class TestPuts < MiniTest::Test
def test_chain
#show_ticks # get output of what is
["AlwaysBranch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
"FunctionCall","SaveReturn","GetSlot","LoadConstant","SetSlot",
"LoadConstant","SetSlot","RegisterTransfer","FunctionCall","SaveReturn",
"GetSlot","RegisterTransfer","Syscall","RegisterTransfer","RegisterTransfer",