]> err.no Git - libchamplain/commitdiff
Test set_color() and set_text_color()
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Mon, 11 May 2009 19:49:00 +0000 (21:49 +0200)
committerEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Tue, 12 May 2009 05:01:04 +0000 (07:01 +0200)
bindings/perl/Champlain/t/ChamplainMarker.t

index 4ef50e081b20d5d241836c23ee5d863b83ea6fd4..3abdb618159db0b9258688d4a7609c1e25d02d63 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Clutter::TestHelper tests => 228;
+use Clutter::TestHelper tests => 312;
 use Test::Builder;
 
 use Champlain ':coords';
@@ -155,14 +155,26 @@ sub generic_test {
        my $color = Clutter::Color->new(0xca, 0xfe, 0xbe, 0xef);
        $marker->set_color($color);
        is_color($marker->get_color, $color, "set_color()");
-#      $marker->set_color(undef);
-#      is($marker->get_color, undef, "set_color(undef)");
+
+       # Setting the background color to undef resets the color to the default value
+       $marker->set_color(undef);
+       is_color(
+               $marker->get_color, 
+               Champlain::Marker->new()->get_color, 
+               "set_color(undef) resets the color"
+       );
 
        my $text_color = Clutter::Color->new(0xca, 0xfe, 0xbe, 0xef);
        $marker->set_text_color($text_color);
        is_color($marker->get_text_color, $text_color, "set_text_color()");
-#      $marker->set_text_color(undef);
-#      is($marker->get_text_color, undef, "set_text_color(undef)");
+       
+       # Setting the text color to undef resets the color to the default value
+       $marker->set_text_color(undef);
+       is_color(
+               $marker->get_text_color, 
+               Champlain::Marker->new()->get_text_color, 
+               "set_text_color(undef) resets the color"
+       );
 
        $marker->set_font_name("Mono 14");
        is($marker->get_font_name, "Mono 14", "set_font_name()");