- Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathcore_rwops.t
66 lines (59 loc) · 1.1 KB
/
core_rwops.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/perl -w
use strict;
use warnings;
use SDL;
use Test::More;
use SDL::RWOps;
my@done = qw/
new_file
seek
close
/;
can_ok( 'SDL::RWOps', @done );
open FH, '>', '.rwops';
print FH 'rwops';
close FH;
my$file = SDL::RWOps->new_file( '.rwops', 'rw' );
isa_ok( $file, 'SDL::RWOps', '[from_file] returns RWOps' );
#0 SEEK_SET
#1 SEEK_CUR
#2 SEEK_END
my$len = $file->seek( 0, 0 );
is( $len, 0, '[seek] gets seek_end' );
$len = $file->seek( 0, 1 );
is( $len, 0, '[seek] gets seek_start' );
$len = $file->seek( 0, 2 );
is( $len, 5, '[seek] gets seek_cur' );
SKIP:
{
skip( 'crashing', 1 );
my$char;
my$blocks = $file->read( $char, 16, 1 );
is( $blocks, 5, '[read] got ' . $char );
}
$file->close();
unlink'.rwops';
my@left = qw/
from_fp
from_mem
from_const_mem
alloc
free
tell
read
write
/;
my$why =
'[Percentage Completion] '
. int( 100 * ( $#done + 1 ) / ( $#done + $#left + 2 ) )
. "\% implementation. "
. ( $#done + 1 ) . " / "
. ( $#done + $#left + 2 );
TODO:
{
local$TODO = $why;
fail "Not Implmented $_"foreach (@left)
}
print"$why\n";
done_testing;
sleep(2);