4 use Test::More tests => 15;
8 my $black = SDL::Color->new( 0, 0, 0 );
9 isa_ok( $black, 'SDL::Color' );
10 is( $black->r(), 0, 'black r is 0' );
11 is( $black->g(), 0, 'black g is 0' );
12 is( $black->b(), 0, 'black b is 0' );
15 my $white = SDL::Color->new( 0xff, 0xff, 0xff );
16 isa_ok( $white, 'SDL::Color' );
17 is( $white->r(), 255, 'white r is 255' );
18 is( $white->g(), 255, 'white g is 255' );
19 is( $white->b(), 255, 'white b is 255' );
21 # check setting a value
26 is( $orange->r(), 254, 'orange_notcloned r is 254' );
27 is( $orange->g(), 153, 'orange_notcloned g is 153' );
28 is( $orange->b(), 0, 'orange_notcloned b is 0' );
30 # check that copies also change
31 is( $white->r(), 254, 'white (now orange) r is 254' );
32 is( $white->g(), 153, 'white (now orange) g is 154' );
33 is( $white->b(), 0, 'white (now orange) b is 0' );