[SCM] Debian packaging of libmath-random-mt-perl branch, master, updated. debian/1.15-1-2-g6c36a2e
Salvatore Bonaccorso
carnil at debian.org
Mon Aug 6 20:59:38 UTC 2012
The following commit has been merged in the master branch:
commit 4e39c162f4d76af59ffd4b55f2f4aef325127437
Author: Salvatore Bonaccorso <carnil at debian.org>
Date: Mon Aug 6 22:45:44 2012 +0200
Add 0001-Fix-handling-of-rand-and-irand-arguments.patch patch
Fix handling of rand() and irand() arguments. Fixed the issue introduced
in version 1.15 where rand() took no notice of argument and irand() did.
Closes: #684085
diff --git a/debian/patches/0001-Fix-handling-of-rand-and-irand-arguments.patch b/debian/patches/0001-Fix-handling-of-rand-and-irand-arguments.patch
new file mode 100644
index 0000000..cc8f7c5
--- /dev/null
+++ b/debian/patches/0001-Fix-handling-of-rand-and-irand-arguments.patch
@@ -0,0 +1,86 @@
+Description: Fix handling of rand() and irand() arguments
+ Fixed issue introduced in version 1.15 where rand() took no notice of
+ argument and irand() did.
+Origin: vendor
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=78200
+Bug-Debian: http://bugs.debian.org/684085
+Forwarded: not-needed
+Author: Salvatore Bonaccorso <carnil at debian.org>
+Last-Update: 2012-08-06
+
+--- a/MT.pm
++++ b/MT.pm
+@@ -41,26 +41,27 @@
+ my ($self, $N) = @_;
+
+ unless (ref $self) {
++ $N = $self;
+ Math::Random::MT::srand() unless defined $gen;
+ $self = $gen;
+ }
+
+- return $self->genrand();
++ return ($N || 1) * $self->genrand();
+ }
+
+ sub irand
+ {
+- my ($self, $N) = @_;
++ my ($self) = @_;
+
+ unless (ref $self) {
+- $N = $self;
+ Math::Random::MT::srand() unless defined $gen;
+ $self = $gen;
+ }
+
+- return ($N || 1) * $self->genirand();
++ return $self->genirand();
+ }
+
++
+ # Generate a random seed using the built-in PRNG.
+
+ sub _rand_seed {
+--- a/t/1.t
++++ b/t/1.t
+@@ -3,7 +3,7 @@
+ use Test;
+ use vars qw($loaded);
+
+-BEGIN { plan tests => 6 }
++BEGIN { plan tests => 10 }
+ END { print "not ok 1\n" unless $loaded }
+
+ # Test that the OO interface works
+@@ -15,3 +15,9 @@
+ ok(abs($gen->rand() - 0.135477004107088) < 1e-14);
+ ok($gen->irand() == 3890346734);
+ ok($gen->irand() == 3586334585);
++
++ok(abs($gen->rand(10) - 1.269868118688464) < 1e-13); # rand() takes a multiplier as argument
++ok(abs($gen->rand(10) - 9.688677710946649) < 1e-13);
++
++ok($gen->irand(123) == 3922919429); # irand() takes no argument; given argument does nothing
++ok($gen->irand(123) == 949333985);
+--- a/t/2.t
++++ b/t/2.t
+@@ -3,7 +3,7 @@
+ use Test;
+ use vars qw($loaded);
+
+-BEGIN { plan tests => 5 }
++BEGIN { plan tests => 9 }
+ END { print "not ok 1\n" unless $loaded }
+
+ # Check that the results are the same with the function-call interface
+@@ -16,3 +16,9 @@
+ ok(abs(rand() - 0.135477004107088) < 1e-14);
+ ok(irand() == 3890346734);
+ ok(irand() == 3586334585);
++
++ok(abs(rand(10) - 1.269868118688464) < 1e-13); # rand() takes a multiplier as argument
++ok(abs(rand(10) - 9.688677710946649) < 1e-13);
++
++ok(irand(123) == 3922919429); # irand() takes no argument; given argument does nothing
++ok(irand(123) == 949333985);
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..251cc78
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Fix-handling-of-rand-and-irand-arguments.patch
--
Debian packaging of libmath-random-mt-perl
More information about the Pkg-perl-cvs-commits
mailing list