2015-10-13 13:46:07 +02:00
|
|
|
require_relative "../helper"
|
|
|
|
|
|
|
|
class TestAttributes < MiniTest::Test
|
|
|
|
|
|
|
|
def setup
|
2016-12-30 13:04:59 +01:00
|
|
|
Register.machine.boot
|
2016-12-30 13:10:49 +01:00
|
|
|
@space = Parfait.object_space
|
2016-12-30 13:04:59 +01:00
|
|
|
@mess = @space.first_message
|
2016-02-25 20:50:10 +01:00
|
|
|
@type = @mess.get_type
|
2015-10-13 13:46:07 +02:00
|
|
|
end
|
|
|
|
|
2016-02-25 20:50:10 +01:00
|
|
|
def test_message_get_type
|
|
|
|
assert_equal Parfait::Type , @type.class
|
2015-10-13 13:46:07 +02:00
|
|
|
end
|
2016-12-16 00:14:09 +01:00
|
|
|
|
2015-10-13 13:46:07 +02:00
|
|
|
def test_message_name_nil
|
2016-12-29 17:50:10 +01:00
|
|
|
last = @type.names.last
|
|
|
|
assert_equal :arguments , last , @type.names.inspect
|
2016-12-06 11:08:18 +01:00
|
|
|
assert_nil @mess.name
|
2015-10-13 13:46:07 +02:00
|
|
|
end
|
|
|
|
def test_message_next_set
|
|
|
|
@mess.next_message = :next_message
|
|
|
|
assert_equal :next_message , @mess.next_message
|
|
|
|
end
|
2016-02-25 20:50:10 +01:00
|
|
|
def test_message_type_set
|
2016-12-29 17:50:10 +01:00
|
|
|
@mess.set_type @type
|
|
|
|
assert_equal @type , @mess.get_type
|
2015-10-13 13:46:07 +02:00
|
|
|
end
|
|
|
|
def test_attribute_index
|
|
|
|
@mess.next_message = :message
|
2016-02-25 20:50:10 +01:00
|
|
|
assert_equal Parfait::Type , @mess.get_type.class
|
2015-10-13 13:46:07 +02:00
|
|
|
end
|
2016-12-29 17:50:10 +01:00
|
|
|
|
2016-02-25 20:50:10 +01:00
|
|
|
def test_type_type
|
|
|
|
assert_equal Parfait::Type , @type.get_type.get_type.class
|
2015-10-13 13:46:07 +02:00
|
|
|
end
|
2016-02-25 20:50:10 +01:00
|
|
|
def test_type_type_type
|
|
|
|
assert_equal Parfait::Type , @type.get_type.get_type.get_type.class
|
2015-10-13 13:46:07 +02:00
|
|
|
end
|
|
|
|
end
|