/[VRac]/t/10-orao.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /t/10-orao.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

M6502/t/10-orao.t revision 82 by dpavlin, Wed Aug 1 21:40:17 2007 UTC t/10-orao.t revision 154 by dpavlin, Sun Aug 5 16:27:46 2007 UTC
# Line 6  use strict; Line 6  use strict;
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    
# Line 14  BEGIN { Line 14  BEGIN {
14  use_ok( 'Orao' );  use_ok( 'Orao' );
15  }  }
16    
17  ok( my $orao = Orao->new, 'new' );  ok( my $orao = Orao->new(), 'new' );
18    
19  isa_ok( $orao, 'Orao' );  isa_ok( $orao, 'Orao' );
20    
# Line 25  ok( ! $orao->trace( 0 ), 'trace' ); Line 25  ok( ! $orao->trace( 0 ), 'trace' );
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            my $path = '/tmp/foo';
34            unlink $path if -e $path;
35    
36            my $size = 0;
37    
38            foreach my $data ( qw/a b c foo bar aaaabbbbccccddddeeeeffff/ ) {
39                    VRac->append_to_file( $path, $data );
40                    $size += length($data);
41                    cmp_ok(-s $path, '==', $size);
42            }
43    };
44    
45    ok( $orao->run, 'run' );
46    
47  sub test_mem {  sub test_mem {
48          my $a = shift;          my $a = shift;
# Line 51  sub test_mem { Line 68  sub test_mem {
68  test_mem( 0x1000 );  test_mem( 0x1000 );
69  test_mem( 0x6000 );  test_mem( 0x6000 );
70  test_mem( 0x7000 );  test_mem( 0x7000 );
71  dies_ok { test_mem( 0xf000 ) } 'access to ro memory';  dies_ok { $orao->poke_code( 0xf000, 1 ) } 'access to ro memory';
72    

Legend:
Removed from v.82  
changed lines
  Added in v.154

  ViewVC Help
Powered by ViewVC 1.1.26