Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 64 lines (56 sloc) 1.074 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/
7 new_file
8 seek
9 close
10 /;
11 can_ok( 'SDL::RWOps', @done );
12
13 open FH, '>', '.rwops';
14 print FH 'rwops';
15 close FH;
16
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
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');
29 TODO:
30 {
31 my $char;
32 my $blocks = $file->read($char, 16, 1);
33 is ( $blocks, 5, '[read] got '.$char);
34 }
35 $file->close();
36 unlink '.rwops';
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored
37 my @left = qw/
26de90e @kthakore Added tests for RWOps. can figure some stuff out
kthakore authored
38 from_fp
39 from_mem
40 from_const_mem
41 alloc
42 free
43 tell
44 read
45 write
ba85b2c @kthakore Added todo tests for remaining components of SDL. Removed WM build in…
kthakore authored
46 /;
47
48 my $why
49 = '[Percentage Completion] '
50 . int( 100 * ( $#done + 1 ) / ( $#done + $#left + 2 ) )
51 . "\% implementation. "
52 . ( $#done + 1 ) . " / "
53 . ( $#done + $#left + 2 );
54
55 TODO:
56 {
57 local $TODO = $why;
58 fail "Not Implmented $_" foreach(@left)
59
60 }
61 diag $why;
62
63 done_testing;
Something went wrong with that request. Please try again.