reenable now working tests

This commit is contained in:
Torsten Ruger 2018-03-28 13:04:25 +03:00
parent 606e3f8cb3
commit 5eee79719d
4 changed files with 9 additions and 11 deletions

View File

@ -21,7 +21,6 @@ module Risc
instruction.assemble(self) instruction.assemble(self)
end end
instruction = instruction.next instruction = instruction.next
puts "Next #{instruction.to_s}"
end end
end end

View File

@ -97,7 +97,7 @@ module Risc
def create_binary def create_binary
objects.each do |id , method| objects.each do |id , method|
next unless method.is_a? Parfait::TypedMethod next unless method.is_a? Parfait::TypedMethod
puts "Binary for #{method.name}:#{}" #puts "Binary for #{method.name}:#{}"
writer = BinaryWriter.new(method.binary) writer = BinaryWriter.new(method.binary)
writer.assemble(method.cpu_instructions) writer.assemble(method.cpu_instructions)
end end

View File

@ -6,26 +6,25 @@ module Risc
def setup def setup
@machine = Risc.machine.boot @machine = Risc.machine.boot
end end
def pest_no_object def test_no_object
@assembler = Assembler.new(@machine , {}) @assembler = Assembler.new(@machine , {})
end end
def pest_space def test_space
@assembler = Assembler.new(@machine , Collector.collect_space) @assembler = Assembler.new(@machine , Collector.collect_space)
end end
def pest_write_fails def test_write_fails
@assembler = Assembler.new(@machine , {}) @assembler = Assembler.new(@machine , {})
assert_raises{ @assembler.write_as_string} #must translate first assert_raises{ @assembler.write_as_string} #must translate first
end end
def pest_assemble_no_objects def test_assemble_no_objects
@assembler = Assembler.new(@machine , {}) @assembler = Assembler.new(@machine , {})
assert @machine.translate_arm assert @machine.translate_arm
assert @assembler.assemble assert @machine.position_all
end end
def pest_assemble_space def test_assemble_space
@assembler = Assembler.new(@machine , Collector.collect_space) @assembler = Assembler.new(@machine , Collector.collect_space)
assert @machine.translate_arm assert @machine.position_all
assert @assembler.assemble
end end
def test_write_space def test_write_space
assert @machine.translate_arm assert @machine.translate_arm

View File

@ -24,7 +24,7 @@ module Risc
end end
def test_binary def test_binary
# @machine.create_binary @machine.create_binary
end end
end end
end end