test ivar name list

This commit is contained in:
Torsten Ruger 2015-07-20 13:20:43 +03:00
parent 2c1c38716b
commit f8cb33ec5e
3 changed files with 21 additions and 3 deletions

View File

@ -48,6 +48,18 @@ module Parfait
return @object_class
end
def object_instance_names
names = List.new
index = 1
while index <= self.get_length
item = get(index)
names.push item
index = index + 1
end
self
names
end
def sof_reference_name
"#{@object_class.name}_Layout"
end

View File

@ -65,7 +65,7 @@ module Parfait
end
def get_instance_variables
get_layout().get_instance_variables
get_layout().object_instance_names
end
def get_instance_variable name

View File

@ -34,13 +34,19 @@ class TestSpace < MiniTest::Test
# there is a 5.times in space, but one Message gets created before
assert_equal 5 + 1 , all.length
end
def test_message_vars
mess = @machine.space.first_message
all = mess.get_instance_variables
assert all
assert all.include?(:next_message)
end
def test_message_layout
mess = @machine.space.first_message
one_way = mess.get_layout
assert one_way
assert mess.instance_variable_defined :next_message
other_way = mess.get_instance_variable :layout
#puts mess.get_instance_variables
# other_way = mess.get_instance_variable :layout
# assert other_way
# assert_equal one_way , other_way , "not same "