fix all the test

many are off course affected by call sequence changes
This commit is contained in:
Torsten Ruger
2015-11-07 22:20:21 +02:00
parent 5ddc96718b
commit f11e8f0a13
20 changed files with 112 additions and 121 deletions

View File

@ -30,7 +30,7 @@ module Fragments
def check_return val
check
assert_equal Parfait::Message , @interpreter.get_register(:r1).class
assert_equal val , @interpreter.get_register(:r1).return_value
assert_equal Parfait::Message , @interpreter.get_register(:r0).class
assert_equal val , @interpreter.get_register(:r0).return_value
end
end

View File

@ -17,7 +17,7 @@ class Object
end
end
HERE
@length = 18
@length = 15
check
end
end

View File

@ -29,7 +29,7 @@ class Object
end
end
HERE
@length = 486
@length = 483
check_return 80
end
@ -46,7 +46,7 @@ class Object
end
end
HERE
@length = 36
@length = 33
check_return 5
end

View File

@ -11,7 +11,7 @@ class Object
end
end
HERE
@length = 39
@length = 36
@stdout = "Hello Raisa, I am salama"
check
end

View File

@ -16,7 +16,7 @@ class Object
end
end
HERE
@length = 28
@length = 25
check_return 4
end
@ -31,7 +31,7 @@ class Object
end
end
HERE
@length = 49
@length = 46
@stdout = "10"
check
end
@ -53,7 +53,7 @@ class Object
end
end
HERE
@length = 64
@length = 61
@stdout = "else"
check
end

View File

@ -16,7 +16,7 @@ class Object
end
end
HERE
@length = 35
@length = 32
check
end
end

View File

@ -28,7 +28,7 @@ class Object
end
end
HERE
@length = 6598
@length = 6595
check_return 55
end
end

View File

@ -11,7 +11,7 @@ class Object
end
end
HERE
@length = 18
@length = 15
check_return 5
end
@ -27,7 +27,7 @@ class Object
end
end
HERE
@length = 38
@length = 35
check_return 5
end
@ -44,7 +44,7 @@ class Object
end
end
HERE
@length = 42
@length = 39
check_return 5
end

View File

@ -28,16 +28,16 @@ HERE
@string_input.sub!( "100" , num.to_s )
end
def test_while_fibo
def test_while_fibo100
fibo 100
@length = 2348
#TODO bug, int max is 92 ruby converts to biginteger.
@length = 2345
#TODO bug, int max is 92 ruby converts to biginteger.
check_return 354224848179261915075
end
def test_while_fibo
def test_while_fibo92
fibo 92
@length = 2164
@length = 2161
check_return 7540113804746346429
end

View File

@ -16,7 +16,7 @@ class Object
end
end
HERE
@length = 37
@length = 34
@stdout = ""
check
end

View File

@ -16,8 +16,8 @@ int main()
end
end
HERE
@expect = [Label, LoadConstant,LoadConstant,OperatorInstruction,GetSlot,SetSlot,
Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, LoadConstant, LoadConstant, OperatorInstruction, GetSlot, SetSlot, Label ,
FunctionReturn]
check
end
@ -30,7 +30,7 @@ class Object
end
end
HERE
@expect = [Label, LoadConstant,GetSlot,SetSlot ,Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, LoadConstant, GetSlot, SetSlot, Label, FunctionReturn]
check
end
@ -42,7 +42,7 @@ class Object
end
end
HERE
@expect = [Label, LoadConstant, GetSlot,SetSlot ,Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, LoadConstant, GetSlot, SetSlot, Label, FunctionReturn]
check
end
@ -54,9 +54,9 @@ class Object
end
end
HERE
@expect = [Label, GetSlot, GetSlot, SetSlot, LoadConstant, SetSlot, LoadConstant ,
SetSlot, LoadConstant, SetSlot, RegisterTransfer, FunctionCall, Label, GetSlot ,
GetSlot, SetSlot, Label, RegisterTransfer, GetSlot, FunctionReturn]
@expect = [Label, GetSlot, GetSlot, SetSlot, LoadConstant, SetSlot, LoadConstant ,
SetSlot, LoadConstant, SetSlot, RegisterTransfer, FunctionCall, Label, RegisterTransfer ,
GetSlot, GetSlot, GetSlot, SetSlot, Label, FunctionReturn]
check
end
@ -69,8 +69,8 @@ class Object
end
end
HERE
@expect = [Label, LoadConstant,GetSlot,SetSlot,GetSlot,GetSlot ,SetSlot,
Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, LoadConstant, GetSlot, SetSlot, GetSlot, GetSlot, SetSlot ,
Label, FunctionReturn]
was = check
get = was.next(5)
assert_equal GetSlot , get.class
@ -86,7 +86,7 @@ class Object
end
end
HERE
@expect = [Label, LoadConstant,SetSlot ,Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, LoadConstant, SetSlot, Label, FunctionReturn]
was = check
set = was.next(2)
assert_equal SetSlot , set.class
@ -101,7 +101,7 @@ class Object
end
end
HERE
@expect = [Label, LoadConstant,GetSlot,SetSlot ,Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, LoadConstant, GetSlot, SetSlot, Label, FunctionReturn]
was = check
set = was.next(3)
assert_equal SetSlot , set.class
@ -118,7 +118,7 @@ class Object
end
end
HERE
@expect = [Label, GetSlot , SetSlot,Label , RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, GetSlot, SetSlot, Label, FunctionReturn]
was = check
get = was.next(1)
assert_equal GetSlot , get.class

View File

@ -18,8 +18,8 @@ class Object
end
HERE
@expect = [Label, GetSlot, LoadConstant, SetSlot, LoadConstant, SetSlot, LoadConstant ,
SetSlot, LoadConstant, SetSlot, RegisterTransfer, FunctionCall, Label, GetSlot ,
Label, RegisterTransfer, GetSlot, FunctionReturn]
SetSlot, LoadConstant, SetSlot, RegisterTransfer, FunctionCall, Label, RegisterTransfer ,
GetSlot, GetSlot, Label, FunctionReturn]
check
end
@ -38,8 +38,8 @@ class Object
end
HERE
@expect = [Label, GetSlot, LoadConstant, SetSlot, LoadConstant, SetSlot, LoadConstant ,
SetSlot, LoadConstant, SetSlot, RegisterTransfer, FunctionCall, Label, GetSlot ,
Label, RegisterTransfer, GetSlot, FunctionReturn]
SetSlot, LoadConstant, SetSlot, RegisterTransfer, FunctionCall, Label, RegisterTransfer ,
GetSlot, GetSlot, Label, FunctionReturn]
check
end
@ -59,7 +59,7 @@ end
HERE
@expect = [Label, LoadConstant, GetSlot, SetSlot, GetSlot, GetSlot, GetSlot ,
SetSlot, LoadConstant, SetSlot, LoadConstant, SetSlot, LoadConstant, SetSlot ,
RegisterTransfer, FunctionCall, Label, GetSlot, Label, RegisterTransfer, GetSlot ,
RegisterTransfer, FunctionCall, Label, RegisterTransfer, GetSlot, GetSlot, Label ,
FunctionReturn]
check
end
@ -80,7 +80,7 @@ end
HERE
@expect = [Label, GetSlot, GetSlot, GetSlot, SetSlot, LoadConstant, SetSlot ,
LoadConstant, SetSlot, LoadConstant, SetSlot, RegisterTransfer, FunctionCall, Label ,
GetSlot, Label, RegisterTransfer, GetSlot, FunctionReturn]
RegisterTransfer, GetSlot, GetSlot, Label, FunctionReturn]
check
end
@ -97,7 +97,7 @@ end
HERE
@expect = [Label, GetSlot, GetSlot, SetSlot, LoadConstant, SetSlot, LoadConstant ,
SetSlot, LoadConstant, SetSlot, LoadConstant, SetSlot, RegisterTransfer, FunctionCall ,
Label, GetSlot, Label, RegisterTransfer, GetSlot, FunctionReturn]
Label, RegisterTransfer, GetSlot, GetSlot, Label, FunctionReturn]
was = check
set = was.next(7)
assert_equal SetSlot , set.class

View File

@ -17,7 +17,7 @@ class Object
end
end
HERE
@expect = [Label, LoadConstant,SetSlot,Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, LoadConstant,SetSlot,Label,FunctionReturn]
check
end
@ -34,9 +34,9 @@ class Object
end
end
HERE
@expect = [Label, GetSlot, LoadConstant, SetSlot, LoadConstant, SetSlot, LoadConstant ,
SetSlot, LoadConstant, SetSlot, RegisterTransfer, FunctionCall, Label, GetSlot ,
SetSlot, Label, RegisterTransfer, GetSlot, FunctionReturn]
@expect = [Label, GetSlot, LoadConstant, SetSlot, LoadConstant, SetSlot, LoadConstant ,
SetSlot, LoadConstant, SetSlot, RegisterTransfer, FunctionCall, Label, RegisterTransfer ,
GetSlot, GetSlot, SetSlot, Label, FunctionReturn]
check
end
@ -49,7 +49,7 @@ class Object
end
end
HERE
@expect = [Label, LoadConstant,SetSlot,Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, LoadConstant,SetSlot,Label,FunctionReturn]
assert_raises{check}
end
@ -62,7 +62,7 @@ class Object
end
end
HERE
@expect = [Label, GetSlot,GetSlot,SetSlot,Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, GetSlot,GetSlot,SetSlot,Label,FunctionReturn]
check
end
end

View File

@ -18,7 +18,7 @@ end
HERE
@expect = [Label, LoadConstant,LoadConstant, OperatorInstruction,IsPlus ,
LoadConstant,SetSlot,Branch , Label , LoadConstant ,SetSlot,
Label,Label,RegisterTransfer,GetSlot,FunctionReturn]
Label,Label,FunctionReturn]
check
end
@ -33,9 +33,8 @@ class Object
end
end
HERE
@expect = [Label,LoadConstant,LoadConstant, OperatorInstruction,IsMinus ,
Branch ,Label , LoadConstant ,SetSlot,
Label,Label , RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, LoadConstant, LoadConstant, OperatorInstruction, IsMinus, Branch, Label ,
LoadConstant, SetSlot, Label, Label, FunctionReturn]
check
end
@ -52,7 +51,7 @@ end
HERE
@expect = [Label, LoadConstant,LoadConstant,OperatorInstruction,IsZero ,
Branch , Label , LoadConstant ,SetSlot,
Label,Label, RegisterTransfer,GetSlot,FunctionReturn]
Label,Label, FunctionReturn]
check
end
end

View File

@ -13,7 +13,7 @@ class Object
end
end
HERE
@expect = [Label, LoadConstant ,SetSlot,Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, LoadConstant ,SetSlot,Label,FunctionReturn]
was = check
set = was.next(2)
assert_equal SetSlot , set.class
@ -30,7 +30,7 @@ class Object
end
end
HERE
@expect = [Label, GetSlot,GetSlot ,SetSlot,Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, GetSlot,GetSlot ,SetSlot,Label,FunctionReturn]
check
end
@ -44,7 +44,7 @@ class Object
end
HERE
@expect = [Label, LoadConstant,GetSlot,SetSlot,GetSlot,GetSlot ,SetSlot,
Label,RegisterTransfer,GetSlot,FunctionReturn]
Label,FunctionReturn]
check
end
@ -57,7 +57,7 @@ class Object
end
end
HERE
@expect = [Label, GetSlot,GetSlot ,SetSlot,Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, GetSlot,GetSlot ,SetSlot,Label,FunctionReturn]
check
end
@ -71,7 +71,7 @@ class Object
end
end
HERE
@expect = [Label, GetSlot,GetSlot ,SetSlot,Label,RegisterTransfer,GetSlot,FunctionReturn]
@expect = [Label, GetSlot,GetSlot ,SetSlot,Label,FunctionReturn]
check
end
@ -83,9 +83,9 @@ class Object
end
end
HERE
@expect = [Label, GetSlot, GetSlot, SetSlot, LoadConstant, SetSlot, LoadConstant ,
SetSlot, LoadConstant, SetSlot, RegisterTransfer, FunctionCall, Label, GetSlot ,
SetSlot, Label, RegisterTransfer, GetSlot, FunctionReturn]
@expect = [Label, GetSlot, GetSlot, SetSlot, LoadConstant, SetSlot, LoadConstant ,
SetSlot, LoadConstant, SetSlot, RegisterTransfer, FunctionCall, Label, RegisterTransfer ,
GetSlot, GetSlot, SetSlot, Label, FunctionReturn]
check
end
end

View File

@ -16,7 +16,7 @@ class Object
end
HERE
@expect = [Label, Branch, Label, LoadConstant, SetSlot, Label, LoadConstant ,
IsPlus, Label, RegisterTransfer, GetSlot, FunctionReturn]
IsPlus, Label, FunctionReturn]
check
end
@ -34,8 +34,7 @@ end
HERE
@expect = [Label, LoadConstant, GetSlot, SetSlot, Branch, Label, GetSlot ,
GetSlot, LoadConstant, OperatorInstruction, GetSlot, SetSlot, Label, GetSlot ,
GetSlot, IsPlus, GetSlot, GetSlot, SetSlot, Label, RegisterTransfer ,
GetSlot, FunctionReturn]
GetSlot, IsPlus, GetSlot, GetSlot, SetSlot, Label, FunctionReturn]
check
end
@ -55,7 +54,7 @@ HERE
@expect = [Label, LoadConstant, GetSlot, SetSlot, Branch, Label, GetSlot ,
GetSlot, LoadConstant, OperatorInstruction, GetSlot, SetSlot, GetSlot, GetSlot ,
SetSlot, Label, GetSlot, GetSlot, LoadConstant, OperatorInstruction, IsPlus ,
Label, RegisterTransfer, GetSlot, FunctionReturn]
Label, FunctionReturn]
check
end
end