constants testing
[sdlgit/SDL_perl.git] / t / colorpm.t
CommitLineData
8fde61e3 1#!/usr/bin/perl -w
2#
7b6a53a1 3# Copyright (C) 2003 Tels
8fde61e3 4# Copyright (C) 2004 David J. Goehrig
5#
7b6a53a1 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.
14#
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.
19#
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#
8fde61e3 32# basic testing of SDL::Color
33
34BEGIN {
35 unshift @INC, 'blib/lib','blib/arch';
36}
37
38use strict;
39
40use Test::More;
41
7b6a53a1 42plan ( tests => 10 );
8fde61e3 43
44use_ok( 'SDL::Color' );
45
46can_ok ('SDL::Color', qw/
47 new
48 r
49 g
50 b
51 pixel /);
52
53# some basic tests:
54
55my $color = SDL::Color->new();
56is (ref($color), 'SDL::Color', 'new was ok');
57is ($color->r(),0, 'r is 0');
58is ($color->g(),0, 'g is 0');
59is ($color->b(),0, 'b is 0');
60
61$color = SDL::Color->new( -r => 0xff, -g => 0xff, -b => 0xff);
62is (ref($color), 'SDL::Color', 'new was ok');
63is ($color->r(),255, 'r is 255');
64is ($color->g(),255, 'g is 255');
65is ($color->b(),255, 'b is 255');
66