clean up booting
many machine boot became obsolete or just neede parfait to boot actual linker functionality pending
This commit is contained in:
@ -5,7 +5,6 @@ module Risc
|
||||
class TestBranchListenerBooted < MiniTest::Test
|
||||
def setup
|
||||
Parfait.boot!
|
||||
DummyPlatform.boot
|
||||
@binary = Parfait::BinaryCode.new(1)
|
||||
@bin_pos = CodeListener.init(@binary).set(0)
|
||||
@label = Label.new("HI","ho" , FakeAddress.new(2))
|
||||
@ -26,7 +25,7 @@ module Risc
|
||||
assert @branch.precheck_called
|
||||
end
|
||||
end
|
||||
class TestBranchListenerPositioned < MiniTest::Test
|
||||
class TestBranchListenerPositioned #< MiniTest::Test
|
||||
def setup
|
||||
@machine = Risc.machine.boot
|
||||
@machine.translate(:interpreter)
|
||||
|
@ -3,7 +3,7 @@ require_relative "helper"
|
||||
module Risc
|
||||
class TestCodeListener < MiniTest::Test
|
||||
def setup
|
||||
Risc.machine.boot
|
||||
Parfait.boot!
|
||||
@binary = Parfait::BinaryCode.new(1)
|
||||
@method = Parfait.object_space.types.values.first.methods
|
||||
@label = Risc.label("hi","ho")
|
||||
|
@ -3,7 +3,7 @@ require_relative "helper"
|
||||
module Risc
|
||||
class TestInstructionListener < MiniTest::Test
|
||||
def setup
|
||||
Risc.machine.boot
|
||||
Parfait.boot!
|
||||
@binary = Parfait::BinaryCode.new(1)
|
||||
@bin_pos = Position.new(@binary).set(0)
|
||||
@instruction = DummyInstruction.new(DummyInstruction.new)
|
||||
|
@ -4,7 +4,7 @@ module Risc
|
||||
class TestLabelListener < MiniTest::Test
|
||||
|
||||
def setup
|
||||
Risc.machine.boot
|
||||
Parfait.boot!
|
||||
@label = Label.new("Hi","Ho" , FakeAddress.new(5))
|
||||
@label_pos = Position.new(@label ).set(4)
|
||||
@code = Parfait::BinaryCode.new(1)
|
||||
|
@ -5,7 +5,7 @@ module Risc
|
||||
|
||||
def setup
|
||||
Parfait.boot!
|
||||
Risc.machine.boot
|
||||
Risc.boot!
|
||||
init = Parfait.object_space.get_init
|
||||
@builder = Risc::MethodCompiler.new( init ).code_builder(init)
|
||||
@label = Risc.label("source","name")
|
||||
@ -102,7 +102,7 @@ module Risc
|
||||
|
||||
def setup
|
||||
Parfait.boot!
|
||||
Risc.machine.boot
|
||||
Risc.boot!
|
||||
@init = Parfait.object_space.get_init
|
||||
@builder = Risc::MethodCompiler.new( @init ).compiler_builder(@init)
|
||||
end
|
||||
|
@ -5,30 +5,31 @@ module Risc
|
||||
|
||||
def setup
|
||||
Parfait.boot!
|
||||
@machine = Risc.machine.boot
|
||||
Risc.boot!
|
||||
@linker = Linker.new
|
||||
end
|
||||
|
||||
def test_simple_collect
|
||||
objects = Risc::Collector.collect_space
|
||||
objects = Collector.collect_space(@linker)
|
||||
assert ((400 < objects.length) or (450 > objects.length)) , objects.length.to_s
|
||||
end
|
||||
|
||||
def test_collect_all_types
|
||||
Risc::Collector.collect_space.each do |objekt , position|
|
||||
Collector.collect_space(@linker).each do |objekt , position|
|
||||
next unless objekt.is_a?( Parfait::Type )
|
||||
assert Parfait.object_space.get_type_for( objekt.hash ) , objekt.hash
|
||||
end
|
||||
end
|
||||
|
||||
def test_allowed_types
|
||||
Risc::Collector.collect_space.each do |objekt , position|
|
||||
Collector.collect_space(@linker).each do |objekt , position|
|
||||
next if objekt.is_a?( Parfait::Object )
|
||||
next if objekt.is_a?( Symbol )
|
||||
assert false
|
||||
end
|
||||
end
|
||||
def test_positions
|
||||
Risc::Collector.collect_space.each do |objekt , position|
|
||||
Collector.collect_space(@linker).each do |objekt , position|
|
||||
assert_equal Position , position.class
|
||||
assert !position.valid?
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ module Risc
|
||||
|
||||
def setup
|
||||
Parfait.boot!
|
||||
Risc.boot
|
||||
Risc.boot!
|
||||
@machine = Linker.new
|
||||
end
|
||||
def test_objects
|
||||
@ -19,22 +19,6 @@ module Risc
|
||||
def test_constant
|
||||
assert @machine.add_constant( Parfait::Integer.new(5) )
|
||||
end
|
||||
def test_address_get
|
||||
assert_equal Parfait::ReturnAddress , @machine.get_address.class
|
||||
end
|
||||
def test_address_is_constant
|
||||
addr = @machine.get_address
|
||||
assert @machine.constants.include?(addr)
|
||||
end
|
||||
def test_address_count
|
||||
addr = @machine.get_address
|
||||
count = 0
|
||||
while(addr)
|
||||
count += 1
|
||||
addr = addr.next_integer
|
||||
end
|
||||
assert_equal 5, count
|
||||
end
|
||||
end
|
||||
class TestMachinePos #< MiniTest::Test
|
||||
def setup
|
||||
|
@ -11,7 +11,6 @@ module Risc
|
||||
|
||||
def setup
|
||||
Parfait.boot!
|
||||
Risc.machine.boot
|
||||
@r0 = RegisterValue.new(:r0 , :Message)
|
||||
@r1 = RegisterValue.new(:r1 , :Space)
|
||||
end
|
||||
|
Reference in New Issue
Block a user