Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 91 lines (80 sloc) 2.335 kB
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
1 #!/usr/bin/perl -w
2 #
3 # Copyright (C) 2003 Tels
4 # Copyright (C) 2004 David J. Goehrig
5 #
7b6a53a @kthakore Applied patch ready for merge
kthakore authored
6 # Copyright (C) 2005 David J. Goehrig <dgoehrig\@cpan.org>
7 #
8 # ------------------------------------------------------------------------------
9 #
10 # This library is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU Lesser General Public
12 # License as published by the Free Software Foundation; either
13 # version 2.1 of the License, or (at your option) any later version.
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
14 #
7b6a53a @kthakore Applied patch ready for merge
kthakore authored
15 # This library is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 # Lesser General Public License for more details.
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
19 #
7b6a53a @kthakore Applied patch ready for merge
kthakore authored
20 # You should have received a copy of the GNU Lesser General Public
21 # License along with this library; if not, write to the Free Software
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #
24 # ------------------------------------------------------------------------------
25 #
26 # Please feel free to send questions, suggestions or improvements to:
27 #
28 # David J. Goehrig
29 # dgoehrig\@cpan.org
30 #
31 #
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
32 # basic testing of SDL::Tool::Font
33
34 BEGIN {
4979eb1 @jtpalmer perltidy
jtpalmer authored
35 unshift @INC, 'blib/lib', 'blib/arch';
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
36 }
37
38 use strict;
e7e70be @kthakore Added failing test for http://rt.cpan.org/Public/Bug/Display.html?id=…
kthakore authored
39 use SDL;
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
40 use SDL::Config;
41 use Test::More;
42
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
43 plan( skip_all => "Failing test due to moving stuff around" );
1483d6c @kthakore Skiping test for SDL_TTF because they are not aware of new API change…
kthakore authored
44
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
45 if ( SDL::Config->has('SDL_image')
4979eb1 @jtpalmer perltidy
jtpalmer authored
46 && SDL::Config->has('SDL_ttf') )
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
47 {
4979eb1 @jtpalmer perltidy
jtpalmer authored
48 plan( tests => 2 );
49 } else {
50 plan(
51 skip_all => (
52 SDL::Config->has('SDL_image') ? ''
53 : ' SDL_image support not compiled'
54 )
55 . (
56 SDL::Config->has('SDL_ttf') ? ''
57 : ' SDL_ttf support not compiled'
58 )
59 );
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
60 }
61
62 use_ok('SDL::Tool::Font');
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
63
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
64 can_ok(
4979eb1 @jtpalmer perltidy
jtpalmer authored
65 'SDL::Tool::Font', qw/
66 new
67 print
68 /
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
69 );
b127760 @bricas fix as many obvious indirect object notation infractions as i can find.
bricas authored
70 my $font = SDL::Tool::Font->new(
4979eb1 @jtpalmer perltidy
jtpalmer authored
71 -normal => 1,
72 -ttfont => 'test/data/aircut3.ttf',
73 -size => 20,
74 -fg => $SDL::Color::black,
75 -bg => $SDL::Color::black
e6e146e @kthakore Did perl tidy. Stole rc from padre. bricas++
kthakore authored
76 );
e7e70be @kthakore Added failing test for http://rt.cpan.org/Public/Bug/Display.html?id=…
kthakore authored
77
2a66806 @kthakore Patched kmx's patch from here http://rt.cpan.org/Ticket/Display.html?…
kthakore authored
78 #use utf8;
89d02e0 @kthakore Added better error reporting and more tests for TTF Font size
kthakore authored
79
2a66806 @kthakore Patched kmx's patch from here http://rt.cpan.org/Ticket/Display.html?…
kthakore authored
80 #my $string = "Test";
81 #my $aref = SDL::TTFSizeText( $font, $string);
82 #ok( defined($$aref[0]), "Testi width for SDL::TTFSizeText." );
83 #ok( defined($$aref[1]), "Test height for SDL::TTFSizeText." );
89d02e0 @kthakore Added better error reporting and more tests for TTF Font size
kthakore authored
84
2a66806 @kthakore Patched kmx's patch from here http://rt.cpan.org/Ticket/Display.html?…
kthakore authored
85 #utf8::encode($string);
86 #my $bref = SDL::TTFSizeUTF8( $font, $string);
87 #ok( defined($$bref[0]), "Test for width SDL::TTFSizeUTF8." );
88 #ok( defined($$bref[1]), "Test for height SDL::TTFSizeUTF8." );
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
89
fc90dcd @m4gnet time to sleep(2);
m4gnet authored
90 sleep(2);
Something went wrong with that request. Please try again.