/[VRac]/M6502/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

Annotation of /M6502/t/10-orao.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 89 - (hide annotations)
Thu Aug 2 12:01:09 2007 UTC (16 years, 8 months ago) by dpavlin
File MIME type: application/x-troff
File size: 1168 byte(s)
Remove all traces of older attempt to embed perl into CPU emulation module
and move forward to just using it via XS bindings
1 dpavlin 82 #!/usr/bin/perl
2    
3     use warnings;
4     use strict;
5    
6     use blib;
7     use lib './lib';
8    
9 dpavlin 89 use Test::More tests => 22;
10 dpavlin 82 use Test::Exception;
11     use Data::Dump qw/dump/;
12    
13     BEGIN {
14     use_ok( 'Orao' );
15     }
16    
17     ok( my $orao = Orao->new, 'new' );
18    
19     isa_ok( $orao, 'Orao' );
20    
21     ok( $orao->scale( 1 ), 'scale' );
22     ok( ! $orao->show_mem( 0 ), 'show_mem' );
23     ok( ! $orao->debug( 0 ), 'debug' );
24     ok( ! $orao->trace( 0 ), 'trace' );
25    
26     is_deeply( $orao->prefs, { scale => 1, show_mem => 0, debug => 0, trace => 0 }, 'prefs' );
27    
28     ok( $orao->boot, 'boot' );
29    
30     sub test_mem {
31     my $a = shift;
32     my @v = ( 0xff, 0x00, 0xff, 0xaa );
33    
34     my $l = $#v + 1;
35    
36     $orao->poke_code( $a, @v );
37    
38     diag sprintf(" %04x - %04x : ", $a, $a + $#v ), dump( @v );
39     diag "ram = ",dump( $orao->ram( $a, $a + $#v ) );
40     diag $orao->hexdump( $a, $a + $#v );
41    
42     is_deeply( [ $orao->ram( $a, $a + $#v ) ], [ @v ], 'ram' );
43     is_deeply( [ $orao->ram( $a, $a + $#v ) ], [ @v ], 'ram doesn\'t mutate' );
44    
45     $orao->poke_code( $a + 4, 0x11, 0x22, 0x33, 0x44 );
46    
47     like( $orao->hexdump( $a, $a + 4 ), qr/ ff 00 ff aa 11 22 33 44/, 'hexdump' );
48    
49     }
50    
51     test_mem( 0x1000 );
52     test_mem( 0x6000 );
53     test_mem( 0x7000 );
54     dies_ok { test_mem( 0xf000 ) } 'access to ro memory';
55    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26