3 # Copyright (C) 2003 Tels
4 # Copyright (C) 2004 David J. Goehrig
6 # Copyright (C) 2005 David J. Goehrig <dgoehrig\@cpan.org>
8 # ------------------------------------------------------------------------------
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.
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.
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
24 # ------------------------------------------------------------------------------
26 # Please feel free to send questions, suggestions or improvements to:
32 # basic testing of SDL::Rect
35 unshift @INC, 'blib/lib','blib/arch';
44 use_ok( 'SDL::Rect' );
46 can_ok ('SDL::Rect', qw/
53 my $rect = SDL::Rect->new();
55 # creating with defaults
56 is (ref($rect),'SDL::Rect','new went ok');
57 is ($rect->x(), 0, 'x is 0');
58 is ($rect->y(), 0, 'y is 0');
59 is ($rect->width(), 0, 'w is 0');
60 is ($rect->height(), 0, 'h is 0');
62 # set and get at the same time
63 is ($rect->x(12), 12, 'x is now 12');
64 is ($rect->y(123), 123, 'y is now 12');
65 is ($rect->width(45), 45, 'w is now 45');
66 is ($rect->height(67), 67, 'h is now 67');
69 is ($rect->x(), 12, 'x is 12');
70 is ($rect->y(), 123, 'y is 12');
71 is ($rect->width(), 45, 'w is 45');
72 is ($rect->height(), 67, 'h is 67');