Added Mix_VolumeChunk to SDL::Mixer + tests
[sdlgit/SDL_perl.git] / t / rectpm.t
CommitLineData
8fde61e3 1#!/usr/bin/perl -w
2#
3# Copyright (C) 2003 Tels
4# Copyright (C) 2004 David J. Goehrig
5#
6# basic testing of SDL::Rect
7
8BEGIN {
9 unshift @INC, 'blib/lib','blib/arch';
10}
11
12use strict;
13
14use Test::More;
15
16plan ( tests => 15 );
17
18use_ok( 'SDL::Rect' );
19
20can_ok ('SDL::Rect', qw/
21 new
22 x
23 y
24 width
25 height /);
26
27my $rect = SDL::Rect->new();
28
29# creating with defaults
30is (ref($rect),'SDL::Rect','new went ok');
31is ($rect->x(), 0, 'x is 0');
32is ($rect->y(), 0, 'y is 0');
33is ($rect->width(), 0, 'w is 0');
34is ($rect->height(), 0, 'h is 0');
35
36# set and get at the same time
37is ($rect->x(12), 12, 'x is now 12');
38is ($rect->y(123), 123, 'y is now 12');
39is ($rect->width(45), 45, 'w is now 45');
40is ($rect->height(67), 67, 'h is now 67');
41
42# get alone
43is ($rect->x(), 12, 'x is 12');
44is ($rect->y(), 123, 'y is 12');
45is ($rect->width(), 45, 'w is 45');
46is ($rect->height(), 67, 'h is 67');
47