From: Kartik Thakore Date: Sat, 29 Aug 2009 17:03:35 +0000 (-0400) Subject: A new test for surface leaks. I made is as simple as possible but it does get worse... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=57450fae6adb3bf9f606f7c24235dfa023da1d71;p=sdlgit%2FSDL_perl.git A new test for surface leaks. I made is as simple as possible but it does get worse if you undo the comments --- diff --git a/Build.PL b/Build.PL index ddf7520..3c42138 100755 --- a/Build.PL +++ b/Build.PL @@ -142,7 +142,7 @@ my $build = SDL::Build->new( xs_files => \%xs, meta_add => { - no_index => { file => [ , ] }, + no_index => { file => [ , , , , ] }, }, dist_author => 'David J. Goehrig ', ); diff --git a/META.yml b/META.yml index 77bbcd8..28e1f26 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- name: SDL_Perl -version: v2.2.2 +version: v2.2.2.1 author: - 'David J. Goehrig ' abstract: Simple DirectMedia Layer for Perl @@ -17,7 +17,7 @@ configure_requires: provides: SDL: file: lib/SDL.pm - version: v2.2.2 + version: v2.2.2.1 SDL::App: file: lib/SDL/App.pm SDL::Cdrom: @@ -90,3 +90,6 @@ no_index: - make/lib/SDL/Build/Netbsd.pm - make/lib/SDL/Build/Openbsd.pm - make/lib/SDL/Build/Solaris.pm + - make/lib/ExtUtils/CBuilder/Platform + - make/lib/ExtUtils/CBuilder + - make/lib/ExtUtils/CBuilder/Platform/Windows.pm diff --git a/README b/README index f013bb0..8369559 100644 --- a/README +++ b/README @@ -1,12 +1,16 @@ -README for SDL_Perl-2.2.1 +README for SDL_Perl-2.2.2 -What's New in 2.2.1: +What's New in 2.2.2: -SDL_Perl-2.2.1 -Adds critical bug fixes in the following areas: --SDL and Constants --SFont and TTFont --SDL::Tutorial +SDL_Perl-2.2.2 + + -Made App loop() faster https://rt.cpan.org/Public/Bug/Display.html?id=16988 + -Patched support for add support for gluquadric* sub https://rt.cpan.org/Public/Bug/Display.html?id=25598 + -Made App init slimer https://rt.cpan.org/Public/Bug/Display.html?id=16987 + -Added faster SDL::Color alternative https://rt.cpan.org/Public/Bug/Display.html?id=17975 + -Added better error reporting for TTFont errors + -Added win32 support https://rt.cpan.org/Ticket/Display.html?id=49003 + Prerequisites: diff --git a/lib/SDL.pm b/lib/SDL.pm index 55a44b0..0feec39 100644 --- a/lib/SDL.pm +++ b/lib/SDL.pm @@ -54,7 +54,7 @@ sub import { $self->export_to_level(1, @_); SDL::Constants->export_to_level(1); } -$VERSION = '2.2.2'; +$VERSION = '2.2.2.1'; print "$VERSION" if (defined($ARGV[0]) && ($ARGV[0] eq '--SDLperl')); diff --git a/t/surfaceML.t b/t/surfaceML.t new file mode 100644 index 0000000..a459e52 --- /dev/null +++ b/t/surfaceML.t @@ -0,0 +1,73 @@ +#!/usr/bin/perl -w +# +# Copyright (C) 2009 Kartik Thakore +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# Kartik Thakore +# kthakore\@cpan.org +# +# +# Memory leaks testing + +BEGIN { + unshift @INC, 'blib/lib', 'blib/arch'; +} + +use strict; + +use Test::More; + +# This is stolen for Gabor's examples in padre's SDL plugin +sub surface_leak() +{ + use SDL; + use SDL::Surface; + use SDL::Rect; + use SDL::Color; + + my $window = SDL::Surface->new( + -width => 640, + -height => 480, + -depth => 16, + -title => 'SDL Demo', + + ); + + my $rect = SDL::Rect->new( -height => 10, -width => 20); + + #my $blue = SDL::Color->new( + # -r => 0x00, +# -g => 0x00, +# -b => 0xff, +# ); +# $window->fill($rect, $blue); + $window->update($rect); + +} + +eval 'use Test::Valgrind'; +plan skip_all => 'Test::Valgrind is required to test your distribution with valgrind' if $@; + +surface_leak(); + + +