fix tests for indexed messages and frames

index_length changes index a bit
but from now on changes to layouts should push the index automatically
just have to set the index while calling now
This commit is contained in:
Torsten Ruger
2015-10-27 16:05:50 +02:00
parent 50029711ff
commit bd171d091a
6 changed files with 16 additions and 16 deletions

View File

@ -78,11 +78,11 @@ HERE
end
def test_assign_arg
Register.machine.space.get_main.arguments.push Parfait::Variable.new(:Integer , :bar)
Register.machine.space.get_main.arguments.push Parfait::Variable.new(:Integer , :blar)
@string_input = <<HERE
class Object
int main(int bar)
bar = 5
int main(int blar)
blar = 5
end
end
HERE
@ -110,11 +110,11 @@ HERE
def test_arg_get
# have to define bar externally, just because redefining main. Otherwise that would be automatic
Register.machine.space.get_main.arguments.push Parfait::Variable.new(:Integer , :bar)
Register.machine.space.get_main.arguments.push Parfait::Variable.new(:Integer , :balr)
@string_input = <<HERE
class Object
int main(int bar)
return bar
int main(int balr)
return balr
end
end
HERE

View File

@ -17,7 +17,7 @@ class TestAttributes < MiniTest::Test
end
def test_message_name_nil
last = @layout.instance_names.last
assert_equal :name , last
assert_equal :indexed_length , last
assert_equal nil , @mess.name
end
def test_message_next_set

View File

@ -33,12 +33,12 @@ class TestLayout < MiniTest::Test
end
def test_length
assert_equal 8 , @mess.get_layout.instance_length , @mess.get_layout.inspect
assert_equal 9 , @mess.get_layout.instance_length , @mess.get_layout.inspect
end
def test_layout_length
assert_equal 8 , @mess.get_layout.indexed_length , @mess.get_layout.inspect
assert_equal 8 , @mess.get_layout.internal_object_get(4)
assert_equal 9 , @mess.get_layout.indexed_length , @mess.get_layout.inspect
assert_equal 9 , @mess.get_layout.internal_object_get(4)
end
def test_layout_length_index
@ -56,7 +56,7 @@ class TestLayout < MiniTest::Test
def test_no_index_below_1
layout = @mess.get_layout
names = layout.instance_names
assert_equal 8 , names.get_length , names.inspect
assert_equal 9 , names.get_length , names.inspect
names.each do |n|
assert layout.variable_index(n) >= 1
end