remove booted flag

just boot if needed
This commit is contained in:
Torsten Ruger 2018-06-29 11:36:14 +03:00
parent f1b09ac58d
commit 606c7bf906
5 changed files with 26 additions and 33 deletions

View File

@ -17,14 +17,13 @@ module Risc
log_level :info log_level :info
def initialize def initialize
@booted = false
@risc_init = nil @risc_init = nil
@constants = [] @constants = []
@next_address = nil @next_address = nil
end end
attr_reader :constants , :cpu_init attr_reader :constants , :cpu_init
attr_reader :booted , :translated attr_reader :translated
attr_reader :platform attr_reader :platform
# Translate code to whatever cpu is specified. # Translate code to whatever cpu is specified.
@ -169,7 +168,6 @@ module Risc
@objects = nil @objects = nil
@translated = false @translated = false
boot_parfait! boot_parfait!
@booted = true
self self
end end

View File

@ -9,10 +9,7 @@ module Vool
statements.to_mom(nil) statements.to_mom(nil)
statements statements
end end
def self.ruby_to_mom(source)
statements = self.ruby_to_vool(source)
statements.to_mom(nil)
end
def self.ruby_to_binary(source , platform = :arm) def self.ruby_to_binary(source , platform = :arm)
machine = Risc.machine.boot machine = Risc.machine.boot
self.ruby_to_vool(source) self.ruby_to_vool(source)

View File

@ -0,0 +1,23 @@
require_relative "helper"
module Parfait
class TestCompat < MiniTest::Test
def setup
Risc.machine.boot
end
def test_list_create_from_array
array = [1,2,3]
list = Parfait.new_list(array)
assert_equal array , list.to_a
end
def test_word_create_from_string
string = "something"
word = Parfait.new_word(string)
assert_equal word , Parfait.new_word(string)
assert_equal string , word.to_string
end
end
end

View File

@ -7,9 +7,6 @@ module Parfait
[:Word,:List,:Message,:NamedList,:Type,:Object,:Class,:Dictionary,:TypedMethod , :Integer] [:Word,:List,:Message,:NamedList,:Type,:Object,:Class,:Dictionary,:TypedMethod , :Integer]
end end
def test_booted
assert_equal true , @machine.booted
end
def test_space_length def test_space_length
assert_equal 8 , @space.get_type.instance_length , @space.get_type.inspect assert_equal 8 , @space.get_type.instance_length , @space.get_type.inspect
end end

View File

@ -1,22 +0,0 @@
require_relative "../helper"
class TestCompat < MiniTest::Test
def setup
Risc.machine.boot unless Risc.machine.booted
end
def test_list_create_from_array
array = [1,2,3]
list = Parfait.new_list(array)
assert_equal array , list.to_a
end
def test_word_create_from_string
string = "something"
word = Parfait.new_word(string)
assert_equal word , Parfait.new_word(string)
assert_equal string , word.to_string
end
end