From 5eee79719da8402bec7292682a35743bd0b92dbf Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 28 Mar 2018 13:04:25 +0300 Subject: [PATCH] reenable now working tests --- lib/risc/binary_writer.rb | 1 - lib/risc/machine.rb | 2 +- test/risc/test_assembler.rb | 15 +++++++-------- test/risc/test_machine.rb | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/risc/binary_writer.rb b/lib/risc/binary_writer.rb index 07f78d2e..375d7d3e 100644 --- a/lib/risc/binary_writer.rb +++ b/lib/risc/binary_writer.rb @@ -21,7 +21,6 @@ module Risc instruction.assemble(self) end instruction = instruction.next - puts "Next #{instruction.to_s}" end end diff --git a/lib/risc/machine.rb b/lib/risc/machine.rb index b3d40ca6..fbe09d00 100644 --- a/lib/risc/machine.rb +++ b/lib/risc/machine.rb @@ -97,7 +97,7 @@ module Risc def create_binary objects.each do |id , method| next unless method.is_a? Parfait::TypedMethod - puts "Binary for #{method.name}:#{}" + #puts "Binary for #{method.name}:#{}" writer = BinaryWriter.new(method.binary) writer.assemble(method.cpu_instructions) end diff --git a/test/risc/test_assembler.rb b/test/risc/test_assembler.rb index 07c9b225..ee1a79e7 100644 --- a/test/risc/test_assembler.rb +++ b/test/risc/test_assembler.rb @@ -6,26 +6,25 @@ module Risc def setup @machine = Risc.machine.boot end - def pest_no_object + def test_no_object @assembler = Assembler.new(@machine , {}) end - def pest_space + def test_space @assembler = Assembler.new(@machine , Collector.collect_space) end - def pest_write_fails + def test_write_fails @assembler = Assembler.new(@machine , {}) assert_raises{ @assembler.write_as_string} #must translate first end - def pest_assemble_no_objects + def test_assemble_no_objects @assembler = Assembler.new(@machine , {}) assert @machine.translate_arm - assert @assembler.assemble + assert @machine.position_all end - def pest_assemble_space + def test_assemble_space @assembler = Assembler.new(@machine , Collector.collect_space) - assert @machine.translate_arm - assert @assembler.assemble + assert @machine.position_all end def test_write_space assert @machine.translate_arm diff --git a/test/risc/test_machine.rb b/test/risc/test_machine.rb index aadb739c..81ef1b59 100644 --- a/test/risc/test_machine.rb +++ b/test/risc/test_machine.rb @@ -24,7 +24,7 @@ module Risc end def test_binary -# @machine.create_binary + @machine.create_binary end end end