6 |
use blib; |
use blib; |
7 |
use lib './lib'; |
use lib './lib'; |
8 |
|
|
9 |
use Test::More tests => 19; |
use Test::More tests => 27; |
10 |
use Test::Exception; |
use Test::Exception; |
11 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
12 |
|
|
25 |
|
|
26 |
is_deeply( $orao->prefs, { scale => 1, show_mem => 0, debug => 0, trace => 0 }, 'prefs' ); |
is_deeply( $orao->prefs, { scale => 1, show_mem => 0, debug => 0, trace => 0 }, 'prefs' ); |
27 |
|
|
28 |
ok( $orao->boot, 'boot' ); |
*Orao::loop = sub { |
29 |
|
my $self = shift; |
30 |
|
isa_ok( $self->app, 'SDL::App' ); |
31 |
|
isa_ok( $self->event, 'SDL::Event' ); |
32 |
|
}; |
33 |
|
|
34 |
|
ok( $orao->run, 'run' ); |
35 |
|
|
36 |
sub test_mem { |
sub test_mem { |
37 |
my $a = shift; |
my $a = shift; |
59 |
test_mem( 0x7000 ); |
test_mem( 0x7000 ); |
60 |
dies_ok { $orao->poke_code( 0xf000, 1 ) } 'access to ro memory'; |
dies_ok { $orao->poke_code( 0xf000, 1 ) } 'access to ro memory'; |
61 |
|
|
62 |
|
my $path = '/tmp/foo'; |
63 |
|
unlink $path if -e $path; |
64 |
|
|
65 |
|
my $size = 0; |
66 |
|
|
67 |
|
foreach my $data ( qw/a b c foo bar aaaabbbbccccddddeeeeffff/ ) { |
68 |
|
VRac->append_to_file( $path, $data ); |
69 |
|
$size += length($data); |
70 |
|
cmp_ok(-s $path, '==', $size); |
71 |
|
} |