test ivar name list
This commit is contained in:
parent
2c1c38716b
commit
f8cb33ec5e
@ -48,6 +48,18 @@ module Parfait
|
|||||||
return @object_class
|
return @object_class
|
||||||
end
|
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
|
def sof_reference_name
|
||||||
"#{@object_class.name}_Layout"
|
"#{@object_class.name}_Layout"
|
||||||
end
|
end
|
||||||
|
@ -65,7 +65,7 @@ module Parfait
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get_instance_variables
|
def get_instance_variables
|
||||||
get_layout().get_instance_variables
|
get_layout().object_instance_names
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_instance_variable name
|
def get_instance_variable name
|
||||||
|
@ -34,13 +34,19 @@ class TestSpace < MiniTest::Test
|
|||||||
# there is a 5.times in space, but one Message gets created before
|
# there is a 5.times in space, but one Message gets created before
|
||||||
assert_equal 5 + 1 , all.length
|
assert_equal 5 + 1 , all.length
|
||||||
end
|
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
|
def test_message_layout
|
||||||
mess = @machine.space.first_message
|
mess = @machine.space.first_message
|
||||||
one_way = mess.get_layout
|
one_way = mess.get_layout
|
||||||
assert one_way
|
assert one_way
|
||||||
assert mess.instance_variable_defined :next_message
|
assert mess.instance_variable_defined :next_message
|
||||||
other_way = mess.get_instance_variable :layout
|
# other_way = mess.get_instance_variable :layout
|
||||||
#puts mess.get_instance_variables
|
|
||||||
# assert other_way
|
# assert other_way
|
||||||
# assert_equal one_way , other_way , "not same "
|
# assert_equal one_way , other_way , "not same "
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user