2015-07-19 09:54:36 +02:00
|
|
|
require_relative "../helper"
|
|
|
|
|
|
|
|
class TestPositioning < MiniTest::Test
|
2015-10-16 16:13:08 +02:00
|
|
|
def setup
|
2015-10-22 17:16:29 +02:00
|
|
|
Register.machine.boot unless Register.machine.booted
|
2015-10-16 16:13:08 +02:00
|
|
|
end
|
2015-07-19 09:54:36 +02:00
|
|
|
def test_list1
|
2015-10-22 17:16:29 +02:00
|
|
|
list = Register.new_list([1])
|
2015-07-19 09:54:36 +02:00
|
|
|
list.set_layout( Parfait::Layout.new Object)
|
|
|
|
assert_equal 32 , list.word_length
|
|
|
|
end
|
|
|
|
def test_list5
|
2015-10-22 17:16:29 +02:00
|
|
|
list = Register.new_list([1,2,3,4,5])
|
2015-07-19 09:54:36 +02:00
|
|
|
list.set_layout( Parfait::Layout.new Object)
|
2015-10-16 16:13:08 +02:00
|
|
|
# TODO check why this is 64 and not 32
|
2015-10-29 11:45:29 +01:00
|
|
|
assert_equal 64 , list.word_length
|
2015-07-19 09:54:36 +02:00
|
|
|
end
|
|
|
|
def test_layout
|
|
|
|
layout = Parfait::Layout.new Object
|
|
|
|
layout.set_layout( Parfait::Layout.new Object)
|
|
|
|
layout.push 5
|
|
|
|
assert_equal 32 , layout.word_length
|
|
|
|
end
|
|
|
|
end
|