From 3e9203200c16783f5053854558e9cba3b21a184c Mon Sep 17 00:00:00 2001 From: kthakore Date: Sun, 27 Feb 2011 14:41:02 -0500 Subject: [PATCH] Fixed some test. Seems that for this font TTF_STYLE_BOLD is forced --- t/ttf.t | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/t/ttf.t b/t/ttf.t index 2521385a..00bd8343 100644 --- a/t/ttf.t +++ b/t/ttf.t @@ -97,26 +97,36 @@ isa_ok( SDL::TTF::open_font_index_RW( $file, 0, 16, 0 ), 'SDL::TTF::Font', "[open_font_index_RW]" ); -is( SDL::TTF::get_font_style($font), - TTF_STYLE_NORMAL, "[get_font_style] returns TTF_STYLE_NORMAL" + +# get_font_style returns the style as a bitmask + +my $style = SDL::TTF::get_font_style($font); + +is( $style, TTF_STYLE_NORMAL, "[get_font_style] returns TTF_STYLE_NORMAL" ); is( SDL::TTF::set_font_style( $font, TTF_STYLE_BOLD ), undef, "[set_font_style] to TTF_STYLE_BOLD" ); -is( SDL::TTF::get_font_style($font), - TTF_STYLE_BOLD, "[get_font_style] returns TTF_STYLE_BOLD" + +$style = SDL::TTF::get_font_style($font); + +ok( $style & TTF_STYLE_BOLD , "[get_font_style] returns TTF_STYLE_BOLD" ); is( SDL::TTF::set_font_style( $font, TTF_STYLE_ITALIC ), undef, "[set_font_style] to TTF_STYLE_ITALIC" ); -is( SDL::TTF::get_font_style($font), - TTF_STYLE_ITALIC, "[get_font_style] returns TTF_STYLE_ITALIC" + +$style = SDL::TTF::get_font_style($font); +ok( $style & TTF_STYLE_ITALIC, "[get_font_style] returns TTF_STYLE_ITALIC" ); + is( SDL::TTF::set_font_style( $font, TTF_STYLE_UNDERLINE ), undef, "[set_font_style] to TTF_STYLE_UNDERLINE" ); -is( SDL::TTF::get_font_style($font), - TTF_STYLE_UNDERLINE, "[get_font_style] returns TTF_STYLE_UNDERLINE" + +$style = SDL::TTF::get_font_style($font); + +ok( TTF_STYLE_UNDERLINE, "[get_font_style] returns TTF_STYLE_UNDERLINE" ); is( SDL::TTF::set_font_style( $font, TTF_STYLE_NORMAL ), undef, "[set_font_style] to TTF_STYLE_NORMAL"