Added Mix_VolumeChunk to SDL::Mixer + tests
[sdlgit/SDL_perl.git] / t / colorpm.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::Color
7
8BEGIN {
9 unshift @INC, 'blib/lib','blib/arch';
10}
11
12use strict;
13
14use Test::More;
15
16plan ( tests => 10 );
17
18use_ok( 'SDL::Color' );
19
20can_ok ('SDL::Color', qw/
21 new
22 r
23 g
24 b
25 pixel /);
26
27# some basic tests:
28
29my $color = SDL::Color->new();
30is (ref($color), 'SDL::Color', 'new was ok');
31is ($color->r(),0, 'r is 0');
32is ($color->g(),0, 'g is 0');
33is ($color->b(),0, 'b is 0');
34
35$color = SDL::Color->new( -r => 0xff, -g => 0xff, -b => 0xff);
36is (ref($color), 'SDL::Color', 'new was ok');
37is ($color->r(),255, 'r is 255');
38is ($color->g(),255, 'g is 255');
39is ($color->b(),255, 'b is 255');
40