This is an automatically generated mail from the syncmail system. Do not reply directly to this email. Further discussion should take place on the hackers list: [EMAIL PROTECTED]
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-BitmapInline/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24505/Win32-GUI-BitmapInline/t Added Files: 01_load.t 02_public_api.t 03_inline.t 04_new.t 05_newCursor.t 06_newIcon.t 98_pod.t 99_pod_coverage.t test.bmp test.cur test.ico Log Message: Re-organisation and bug fixes to BitmapInline --- NEW FILE: 99_pod_coverage.t --- #!perl -wT # Win32::GUI::BitmapInline test suite. # $Id: 99_pod_coverage.t,v 1.1 2008/01/13 11:42:57 robertemay Exp $ # Check the POD covers all method calls use strict; use warnings; use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; plan skip_all => "Pod Coverage tests for Win32::GUI::BitmapInline done by core" if $ENV{W32G_CORE}; all_pod_coverage_ok( { also_private => [ qr/^(share|lock)$/, ] } ); --- NEW FILE: test.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: test.ico --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 05_newCursor.t --- #!perl -w # Win32::GUI::BitmapInline test suite # $Id: 05_newCursor.t,v 1.1 2008/01/13 11:42:57 robertemay Exp $ # # - check the new function works for bitmaps use strict; use warnings; use IO::File(); BEGIN { $| = 1 } # Autoflush use Test::More tests => 3; use Win32::GUI::BitmapInline(); # Check that 'inline' is not exported with empty import list ok(!__PACKAGE__->can('inline'), "'inline' not exported"); # Check that 'new' is not exported with empty import list ok(!__PACKAGE__->can('newCursor'), "'newCursor' not exported"); # use inline to create some inline data # XXX I expect that using scalar reference as filename in open is not 5.6 # compatible { # Bitmap inlining my $fh = IO::File->new_tmpfile() or die "Open failed"; my $old_fh = select $fh; Win32::GUI::BitmapInline::inline('t/test.cur'); select $old_fh; $fh->seek(0,0) or die "Failed to seek back to start of file"; my $buffer = do { local $/; <$fh> }; $fh->close(); my $Cursor1; eval $buffer; isa_ok($Cursor1, "Win32::GUI::Cursor", "Created a cursor"); } --- NEW FILE: test.cur --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 01_load.t --- #!perl -wT # Win32::GUI::BitmapInline test suite # $Id: 01_load.t,v 1.1 2008/01/13 11:42:57 robertemay Exp $ # # - check pre-requsites # - check module loads # - check module has a version use strict; use warnings; BEGIN { $| = 1 } # Autoflush # Pre-requisites: Bail out if we havent got Test::More eval "use Test::More"; if($@) { # As we haven't got Test::More, can't use diag() print "#\n# Test::More required to perform any Win32::GUI::BitmapInline test\n"; chomp $@; $@ =~ s/^/# /gm; print "[EMAIL PROTECTED]"; print "Bail Out! Test::More not available\n"; exit(1); } plan( tests => 3 ); # Pre-requisites: Check that we're on windows or cygwin # bail out if we're not if ( not ($^O =~ /MSwin32|cygwin/i)) { diag("\nWin32::GUI::BitmapInline can only run on MSWin32 or cygwin, not '$^O'"); print "Bail out! Incompatible Operating System\n"; } pass("Correct OS: $^O"); # Check that Win32::GUI::BitmapInline loads, and bail out of all # tests if it doesn't use_ok('Win32::GUI::BitmapInline') or print STDOUT "Bail out! Can't load Win32::GUI::BitmapInline"; # Check that Win32::GUI::BitmapInline has a version ok(defined $Win32::GUI::BitmapInline::VERSION, "Win32::GUI::BitmapInline version check"); --- NEW FILE: 06_newIcon.t --- #!perl -w # Win32::GUI::BitmapInline test suite # $Id: 06_newIcon.t,v 1.1 2008/01/13 11:42:57 robertemay Exp $ # # - check the new function works for bitmaps use strict; use warnings; use IO::File(); BEGIN { $| = 1 } # Autoflush use Test::More tests => 3; use Win32::GUI::BitmapInline(); # Check that 'inline' is not exported with empty import list ok(!__PACKAGE__->can('inline'), "'inline' not exported"); # Check that 'new' is not exported with empty import list ok(!__PACKAGE__->can('newIcon'), "'newIcon' not exported"); # use inline to create some inline data # XXX I expect that using scalar reference as filename in open is not 5.6 # compatible { # Bitmap inlining my $fh = IO::File->new_tmpfile() or die "Open failed"; my $old_fh = select $fh; Win32::GUI::BitmapInline::inline('t/test.ico'); select $old_fh; $fh->seek(0,0) or die "Failed to seek back to start of file"; my $buffer = do { local $/; <$fh> }; $fh->close(); my $Icon1; eval $buffer; isa_ok($Icon1, "Win32::GUI::Icon", "Created an icon"); } --- NEW FILE: 03_inline.t --- #!perl -w # Win32::GUI::BitmapInline test suite # $Id: 03_inline.t,v 1.1 2008/01/13 11:42:57 robertemay Exp $ # # - check the inline function works use strict; use warnings; use IO::File(); BEGIN { $| = 1 } # Autoflush use Test::More tests => 17; # Check that 'inline' is exported by default require Win32::GUI::BitmapInline; ok(!__PACKAGE__->can('inline'), "No 'inline' before import called"); Win32::GUI::BitmapInline->import(); can_ok(__PACKAGE__, 'inline'); # Check what inline's output looks like # XXX I expect that using scalar reference as filename in open is not 5.6 # compatible { # Bitmap inlining my $fh = IO::File->new_tmpfile() or die "Open failed"; my $old_fh = select $fh; inline('t/test.bmp'); select $old_fh; $fh->seek(0,0) or die "Failed to seek back to start of file"; my $buffer = do { local $/; <$fh> }; # slurp $fh->close(); ok(length($buffer), "'inline' generates output"); like($buffer, qr/^\$Bitmap\d+\s*=/m, 'Output starts with "$BitmapX ="'); like($buffer, qr/^\$Bitmap1/, 'Counter starts at 1'); like($buffer, qr/.*=\s*Win32::GUI::BitmapInline->new\s*\(\s*q\s*\(/m, 'Output continues with "Win32::GUI::BitmapInline->new( q("'); like($buffer, qr/\)\s*\)\s*;\s*$/m, 'Output end with ") );"'); } { # Icon inlining my $fh = IO::File->new_tmpfile() or die "Open failed"; my $old_fh = select $fh; inline('t/test.ico'); select $old_fh; $fh->seek(0,0) or die "Failed to seek back to start of file"; my $buffer = do { local $/; <$fh> }; # slurp $fh->close(); ok(length($buffer), "'inline' generates output"); like($buffer, qr/^\$Icon\d+\s*=/m, 'Output starts with "$IconX ="'); like($buffer, qr/^\$Icon2/, 'Counter continues with 2'); like($buffer, qr/.*=\s*Win32::GUI::BitmapInline->newIcon\s*\(\s*q\s*\(/m, 'Output continues with "Win32::GUI::BitmapInlineIcon->newIcon( q("'); like($buffer, qr/\)\s*\)\s*;\s*$/m, 'Output end with ") );"'); } { # Cursor inlining my $fh = IO::File->new_tmpfile() or die "Open failed"; my $old_fh = select $fh; inline('t/test.cur'); select $old_fh; $fh->seek(0,0) or die "Failed to seek back to start of file"; my $buffer = do { local $/; <$fh> }; # slurp $fh->close(); ok(length($buffer), "'inline' generates output"); like($buffer, qr/^\$Cursor\d+\s*=/m, 'Output starts with "$CursorX ="'); like($buffer, qr/^\$Cursor3/, 'Counter continues with 3'); like($buffer, qr/.*=\s*Win32::GUI::BitmapInline->newCursor\s*\(\s*q\s*\(/m, 'Output continues with "Win32::GUI::BitmapInlineIcon->newCursor( q("'); like($buffer, qr/\)\s*\)\s*;\s*$/m, 'Output end with ") );"'); } --- NEW FILE: 04_new.t --- #!perl -w # Win32::GUI::BitmapInline test suite # $Id: 04_new.t,v 1.1 2008/01/13 11:42:57 robertemay Exp $ # # - check the new function works for bitmaps use strict; use warnings; BEGIN { $| = 1 } # Autoflush use Test::More tests => 3; use IO::File(); use Win32::GUI::BitmapInline(); # Check that 'inline' is not exported with empty import list ok(!__PACKAGE__->can('inline'), "'inline' not exported"); # Check that 'new' is not exported with empty import list ok(!__PACKAGE__->can('new'), "'new' not exported"); # use inline to create some inline data # XXX I expect that using scalar reference as filename in open is not 5.6 # compatible { # Bitmap inlining my $fh = IO::File->new_tmpfile() or die "Open failed"; my $old_fh = select $fh; Win32::GUI::BitmapInline::inline('t/test.bmp'); select $old_fh; $fh->seek(0,0) or die "Failed to seek back to start of file"; my $buffer = do { local $/; <$fh> }; $fh->close(); my $Bitmap1; eval $buffer; isa_ok($Bitmap1, "Win32::GUI::Bitmap", "Created a bitmap"); } --- NEW FILE: 02_public_api.t --- #!perl -wT # Win32::GUI::BitmapInline test suite # $Id: 02_public_api.t,v 1.1 2008/01/13 11:42:57 robertemay Exp $ # # - check the public api methods are defined use strict; use warnings; BEGIN { $| = 1 } # Autoflush use Test::More tests => 1; use Win32::GUI::BitmapInline(); can_ok('Win32::GUI::BitmapInline', qw( inline new newCursor newIcon )); --- NEW FILE: 98_pod.t --- #!perl -wT # Win32::GUI::BitmapInline test suite. # $Id: 98_pod.t,v 1.1 2008/01/13 11:42:57 robertemay Exp $ # Check that our pod documentation has valid syntax use strict; use warnings; BEGIN { $| = 1 } # Autoflush use Test::More; eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; plan skip_all => "Pod tests for Win32::GUI::BitmapInline done by core" if $ENV{W32G_CORE}; all_pod_files_ok(); ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Perl-win32-gui-cvscommit mailing list Perl-win32-gui-cvscommit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-cvscommit http://perl-win32-gui.sourceforge.net/