]> err.no Git - libchamplain/commitdiff
Test the reset of the font name
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Mon, 11 May 2009 20:10:43 +0000 (22:10 +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 3abdb618159db0b9258688d4a7609c1e25d02d63..d87772203f9edfe025495fd315b3b685017893c6 100644 (file)
@@ -12,6 +12,10 @@ use File::Spec;
 # Path to a valid image
 my $FILENAME = File::Spec->catfile('examples', 'images', 'who.png');
 
+my $DEFAULT_COLOR = Champlain::Marker->new()->get_color;
+my $DEFAULT_TEXT_COLOR = Champlain::Marker->new()->get_text_color;
+my $DEFAULT_FONT_NAME = Champlain::Marker->new()->get_font_name;
+
 
 exit tests();
 
@@ -160,7 +164,7 @@ sub generic_test {
        $marker->set_color(undef);
        is_color(
                $marker->get_color, 
-               Champlain::Marker->new()->get_color, 
+               $DEFAULT_COLOR,
                "set_color(undef) resets the color"
        );
 
@@ -172,14 +176,14 @@ sub generic_test {
        $marker->set_text_color(undef);
        is_color(
                $marker->get_text_color, 
-               Champlain::Marker->new()->get_text_color
+               $DEFAULT_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()");
        $marker->set_font_name(undef);
-       is($marker->get_font_name, undef, "set_font_name(undef)");
+       is($marker->get_font_name, $DEFAULT_FONT_NAME, "set_font_name(undef)");
 }