--- M6502/t/10-orao.t 2007/08/01 21:40:17 82 +++ t/10-orao.t 2007/08/05 16:27:46 154 @@ -6,7 +6,7 @@ use blib; use lib './lib'; -use Test::More tests => 19; +use Test::More tests => 27; use Test::Exception; use Data::Dump qw/dump/; @@ -14,7 +14,7 @@ use_ok( 'Orao' ); } -ok( my $orao = Orao->new, 'new' ); +ok( my $orao = Orao->new(), 'new' ); isa_ok( $orao, 'Orao' ); @@ -25,7 +25,24 @@ is_deeply( $orao->prefs, { scale => 1, show_mem => 0, debug => 0, trace => 0 }, 'prefs' ); -ok( $orao->boot, 'boot' ); +*Orao::loop = sub { + my $self = shift; + isa_ok( $self->app, 'SDL::App' ); + isa_ok( $self->event, 'SDL::Event' ); + + my $path = '/tmp/foo'; + unlink $path if -e $path; + + my $size = 0; + + foreach my $data ( qw/a b c foo bar aaaabbbbccccddddeeeeffff/ ) { + VRac->append_to_file( $path, $data ); + $size += length($data); + cmp_ok(-s $path, '==', $size); + } +}; + +ok( $orao->run, 'run' ); sub test_mem { my $a = shift; @@ -51,5 +68,5 @@ test_mem( 0x1000 ); test_mem( 0x6000 ); test_mem( 0x7000 ); -dies_ok { test_mem( 0xf000 ) } 'access to ro memory'; +dies_ok { $orao->poke_code( 0xf000, 1 ) } 'access to ro memory';