rubyx/test/parfait/test_attributes.rb
Torsten Ruger 1132309f6a unify space collection attribute naming
currently space is still acting as a sort of memory manager.
For proper linking, all objects must be reachable from space, hence the plural versions like messages and addresses (even they are instances, it is the list that is important)
To dish out instance to use, the head must be kept, ie next_XXX for intergers, return addresses and messages
2018-07-02 15:49:51 +03:00

42 lines
1006 B
Ruby

require_relative "helper"
module Parfait
class TestAttributes < ParfaitTest
def setup
super
@mess = @space.next_message
@type = @mess.get_type
end
def test_message_get_type
assert_equal Parfait::Type , @type.class
end
def test_message_name_nil
last = @type.names.last
assert_equal :arguments , last , @type.names.inspect
assert_nil @mess.name
end
def test_message_next_set
@mess.next_message = :next_message
assert_equal :next_message , @mess.next_message
end
def test_message_type_set
@mess.set_type @type
assert_equal @type , @mess.get_type
end
def test_attribute_index
@mess.next_message = :message
assert_equal Parfait::Type , @mess.get_type.class
end
def test_type_type
assert_equal Parfait::Type , @type.get_type.get_type.class
end
def test_type_type_type
assert_equal Parfait::Type , @type.get_type.get_type.get_type.class
end
end
end