From 3f8dd19dafdf1ee2848f445a447db2cf4d9ac174 Mon Sep 17 00:00:00 2001 From: Emmanuel Rodriguez Date: Mon, 11 May 2009 21:49:00 +0200 Subject: [PATCH] Test set_color() and set_text_color() --- bindings/perl/Champlain/t/ChamplainMarker.t | 22 ++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/bindings/perl/Champlain/t/ChamplainMarker.t b/bindings/perl/Champlain/t/ChamplainMarker.t index 4ef50e0..3abdb61 100644 --- a/bindings/perl/Champlain/t/ChamplainMarker.t +++ b/bindings/perl/Champlain/t/ChamplainMarker.t @@ -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()"); -- 2.39.5