Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 66 lines (58 sloc) 1.116 kB
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored
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
5 use SDL::RWOps;
26de90e @kthakore Added tests for RWOps. can figure some stuff out
kthakore authored
6 my @done = qw/
4979eb1 @jtpalmer perltidy
jtpalmer authored
7 new_file
8 seek
9 close
10 /;
26de90e @kthakore Added tests for RWOps. can figure some stuff out
kthakore authored
11 can_ok( 'SDL::RWOps', @done );
12
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
13 open FH, '>', '.rwops';
26de90e @kthakore Added tests for RWOps. can figure some stuff out
kthakore authored
14 print FH 'rwops';
15 close FH;
16
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
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
19
26de90e @kthakore Added tests for RWOps. can figure some stuff out
kthakore authored
20 #0 SEEK_SET
21 #1 SEEK_CUR
22 #2 SEEK_END
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
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
29 SKIP:
26de90e @kthakore Added tests for RWOps. can figure some stuff out
kthakore authored
30 {
4979eb1 @jtpalmer perltidy
jtpalmer authored
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
35 }
36 $file->close();
37 unlink '.rwops';
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored
38 my @left = qw/
4979eb1 @jtpalmer perltidy
jtpalmer authored
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
48
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
49 my $why =
4979eb1 @jtpalmer perltidy
jtpalmer authored
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
55
56 TODO:
57 {
4979eb1 @jtpalmer perltidy
jtpalmer authored
58 local $TODO = $why;
59 fail "Not Implmented $_" foreach (@left)
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
60
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored
61 }
27b1140 silent tests now, unless --verbose switch
Tobias Leich authored
62 print "$why\n";
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored
63
64 done_testing;
fc90dcd @m4gnet time to sleep(2);
m4gnet authored
65 sleep(2);
Something went wrong with that request. Please try again.