Skip to content
Newer
Older
100644 66 lines (58 sloc) 1.09 KB
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored Nov 14, 2009
1 #!/usr/bin/perl -w
2 use strict;
3 use SDL;
4 use Test::More;
0f35edd @kthakore Cleanup. Added RWops xs,pm, and pod. Added tests to 00-load
kthakore authored Nov 19, 2009
5 use SDL::RWOps;
26de90e @kthakore Added tests for RWOps. can figure some stuff out
kthakore authored Nov 19, 2009
6 my @done = qw/
4979eb1 @jtpalmer perltidy
jtpalmer authored Jul 30, 2010
7 new_file
8 seek
9 close
10 /;
26de90e @kthakore Added tests for RWOps. can figure some stuff out
kthakore authored Nov 20, 2009
11 can_ok( 'SDL::RWOps', @done );
12
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored Jul 20, 2010
13 open FH, '>', '.rwops';
26de90e @kthakore Added tests for RWOps. can figure some stuff out
kthakore authored Nov 20, 2009
14 print FH 'rwops';
15 close FH;
16
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored Jul 20, 2010
17 my $file = SDL::RWOps->new_file( '.rwops', 'rw' );
18 isa_ok( $file, 'SDL::RWOps', '[from_file] returns RWOps' );
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored Nov 15, 2009
19
26de90e @kthakore Added tests for RWOps. can figure some stuff out
kthakore authored Nov 20, 2009
20 #0 SEEK_SET
21 #1 SEEK_CUR
22 #2 SEEK_END
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored Jul 20, 2010
23 my $len = $file->seek( 0, 0 );
24 is( $len, 0, '[seek] gets seek_end' );
25 $len = $file->seek( 0, 1 );
26 is( $len, 0, '[seek] gets seek_start' );
27 $len = $file->seek( 0, 2 );
28 is( $len, 5, '[seek] gets seek_cur' );
14767ad @kthakore Skip crashing test
kthakore authored Nov 19, 2009
29 SKIP:
26de90e @kthakore Added tests for RWOps. can figure some stuff out
kthakore authored Nov 20, 2009
30 {
4979eb1 @jtpalmer perltidy
jtpalmer authored Jul 31, 2010
31 skip( 'crashing', 1 );
32 my $char;
33 my $blocks = $file->read( $char, 16, 1 );
34 is( $blocks, 5, '[read] got ' . $char );
26de90e @kthakore Added tests for RWOps. can figure some stuff out
kthakore authored Nov 20, 2009
35 }
36 $file->close();
37 unlink '.rwops';
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored Nov 15, 2009
38 my @left = qw/
4979eb1 @jtpalmer perltidy
jtpalmer authored Jul 31, 2010
39 from_fp
40 from_mem
41 from_const_mem
42 alloc
43 free
44 tell
45 read
46 write
47 /;
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored Nov 15, 2009
48
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored Jul 20, 2010
49 my $why =
4979eb1 @jtpalmer perltidy
jtpalmer authored Jul 31, 2010
50 '[Percentage Completion] '
51 . int( 100 * ( $#done + 1 ) / ( $#done + $#left + 2 ) )
52 . "\% implementation. "
53 . ( $#done + 1 ) . " / "
54 . ( $#done + $#left + 2 );
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored Nov 15, 2009
55
56 TODO:
57 {
4979eb1 @jtpalmer perltidy
jtpalmer authored Jul 31, 2010
58 local $TODO = $why;
59 fail "Not Implmented $_" foreach (@left)
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored Jul 20, 2010
60
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored Nov 15, 2009
61 }
27b1140 silent tests now, unless --verbose switch
Tobias Leich authored Mar 22, 2010
62 print "$why\n";
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored Nov 15, 2009
63
64 done_testing;
fc90dcd @m4gnet time to sleep(2);
m4gnet authored Dec 2, 2009
65 sleep(2);
Something went wrong with that request. Please try again.