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
|
2018-06-29 23:39:23 +02:00
|
|
|
Parfait.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
|
2018-05-08 18:59:43 +02:00
|
|
|
@binary.extend_to(16)
|
2018-07-02 16:01:07 +02:00
|
|
|
CodeListener.init( @binary , :interpreter).set(0)
|
2018-05-08 18:59:43 +02:00
|
|
|
assert_equal @binary.padded_length , Position.get(@binary.next).at
|
|
|
|
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)
|
2018-05-09 19:36:49 +02:00
|
|
|
@binary.extend_to(16)
|
|
|
|
assert_equal @binary.padded_length , Position.get(@binary.next).at
|
|
|
|
end
|
2018-05-08 18:59:43 +02:00
|
|
|
end
|
|
|
|
end
|