1 |
#!/usr/bin/perl |
2 |
|
3 |
use warnings; |
4 |
use strict; |
5 |
|
6 |
use lib './lib'; |
7 |
|
8 |
use Test::More tests => 6; |
9 |
use Data::Dump qw/dump/; |
10 |
|
11 |
BEGIN { |
12 |
use_ok( 'Arch' ); |
13 |
} |
14 |
|
15 |
ok( my $orao = Arch->new({ |
16 |
mmu => sub {}, |
17 |
}), 'new' ); |
18 |
isa_ok( $orao, 'Arch' ); |
19 |
|
20 |
my @v = ( 0xff, 0x00, 0xff, 0xaa ); |
21 |
|
22 |
$orao->poke_code( 0x1000, @v ); |
23 |
|
24 |
diag dump( $orao->ram( 0x1000, 0x1004 ) ); |
25 |
|
26 |
is_deeply( [ $orao->ram( 0x1000, 0x1004 ) ], [ @v ], 'ram' ); |
27 |
is_deeply( [ $orao->ram( 0x1000, 0x1004 ) ], [ @v ], 'ram doesn\'t mutate' ); |
28 |
|
29 |
$orao->poke_code( 0x1004, 0x11, 0x22, 0x33, 0x44 ); |
30 |
|
31 |
like( $orao->hexdump( 0x1000, 0x1004 ), qr/1000 ff 00 ff aa 11 22 33 44/, 'hexdump' ); |