2018-06-01 18:13:53 +02:00
|
|
|
require_relative "helper"
|
2018-05-08 18:59:43 +02:00
|
|
|
|
|
|
|
module Risc
|
2018-05-25 18:04:48 +02:00
|
|
|
class TestPositionTranslated < MiniTest::Test
|
|
|
|
def setup
|
2019-02-08 22:03:23 +01:00
|
|
|
Parfait.boot!(Parfait.default_test_options)
|
2018-07-04 08:18:55 +02:00
|
|
|
Risc.boot!
|
2018-05-25 18:04:48 +02:00
|
|
|
@binary = Parfait::BinaryCode.new(1)
|
|
|
|
@method = Parfait.object_space.types.values.first.methods
|
2018-05-29 19:26:00 +02:00
|
|
|
@label = Risc.label("hi","ho")
|
2018-05-25 18:04:48 +02:00
|
|
|
end
|
|
|
|
|
2018-05-09 19:36:49 +02:00
|
|
|
def test_bin_propagates_existing
|
2019-08-22 11:26:40 +02:00
|
|
|
@binary.extend_to(32)
|
2018-07-02 16:01:07 +02:00
|
|
|
CodeListener.init( @binary , :interpreter).set(0)
|
2018-08-12 12:10:44 +02:00
|
|
|
assert_equal @binary.padded_length , Position.get(@binary.next_code).at
|
2018-05-08 18:59:43 +02:00
|
|
|
end
|
2018-05-09 19:36:49 +02:00
|
|
|
def test_bin_propagates_after
|
2018-07-02 16:01:07 +02:00
|
|
|
CodeListener.init( @binary , :interpreter).set(0)
|
2019-08-22 11:26:40 +02:00
|
|
|
@binary.extend_to(32)
|
2018-08-12 12:10:44 +02:00
|
|
|
assert_equal @binary.padded_length , Position.get(@binary.next_code).at
|
2018-05-09 19:36:49 +02:00
|
|
|
end
|
2018-05-08 18:59:43 +02:00
|
|
|
end
|
|
|
|
end
|