From 6882f396453fdd53ac11017ab3721fe3e9810f79 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Tue, 3 Nov 2015 16:21:50 +0200 Subject: [PATCH] fixing lengths --- lib/parfait/method.rb | 10 ---------- lib/parfait/word.rb | 4 ---- test/register/test_positioning.rb | 7 +++++-- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/lib/parfait/method.rb b/lib/parfait/method.rb index 0747703d..2418aac0 100644 --- a/lib/parfait/method.rb +++ b/lib/parfait/method.rb @@ -78,15 +78,5 @@ module Parfait "#{self.for_class.name}:#{name}(#{arguments.inspect})" end - def total_byte_length - self.instructions.total_byte_length - end - - # position of the function is the position of the entry block, is where we call - def set_position at - at += 8 #for the 2 header words - self.instructions.set_position at - end - end end diff --git a/lib/parfait/word.rb b/lib/parfait/word.rb index 55eb2ab6..706782b4 100644 --- a/lib/parfait/word.rb +++ b/lib/parfait/word.rb @@ -122,10 +122,6 @@ module Parfait "'" + to_s + "'" end - def word_length - padded self.length - end - private def check_length raise "Length out of bounds #{self.char_length}" if self.char_length > 32 diff --git a/test/register/test_positioning.rb b/test/register/test_positioning.rb index aaa06973..f1648b96 100644 --- a/test/register/test_positioning.rb +++ b/test/register/test_positioning.rb @@ -12,8 +12,7 @@ class TestPositioning < MiniTest::Test def test_list5 list = Register.new_list([1,2,3,4,5]) list.set_layout( Parfait::Layout.new Object) - # TODO check why this is 64 and not 32 - assert_equal 64 , list.word_length + assert_equal 32 , list.word_length end def test_layout layout = Parfait::Layout.new Object @@ -21,4 +20,8 @@ class TestPositioning < MiniTest::Test layout.push 5 assert_equal 32 , layout.word_length end + def test_word + word = Parfait::Word.new(12) + assert_equal 32 , word.word_length + end end