[DRE-commits] [ruby-rgen] 02/04: Import upstream patch for build test
Stig Sandbeck Mathisen
ssm at debian.org
Sun Sep 7 14:49:08 UTC 2014
This is an automated email from the git hooks/post-receive script.
ssm pushed a commit to branch master
in repository ruby-rgen.
commit 58d76ad35512a9f24bdb305af9f7f9d7220a23be
Author: Stig Sandbeck Mathisen <ssm at debian.org>
Date: Sun Sep 7 16:25:35 2014 +0200
Import upstream patch for build test
---
...-larger-than-Fixnum-max-to-test-Bignum-su.patch | 29 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 30 insertions(+)
diff --git a/debian/patches/0001-Use-a-value-larger-than-Fixnum-max-to-test-Bignum-su.patch b/debian/patches/0001-Use-a-value-larger-than-Fixnum-max-to-test-Bignum-su.patch
new file mode 100644
index 0000000..43a010d
--- /dev/null
+++ b/debian/patches/0001-Use-a-value-larger-than-Fixnum-max-to-test-Bignum-su.patch
@@ -0,0 +1,29 @@
+From: Hans de Graaff <hans at degraaff.org>
+Date: Thu, 21 Aug 2014 09:06:26 +0200
+Subject: Use a value larger than Fixnum max to test Bignum support.
+
+On 64 bit system the previous test value 1234567890 still fits in a Fixnum
+so the tests will fail. Use a dynamically calculated value instead to ensure
+that the value will force a Bignum in all cases.
+
+Fixnum maximum calculation from
+http://stackoverflow.com/questions/535721/ruby-max-integer
+---
+ test/metamodel_builder_test.rb | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/test/metamodel_builder_test.rb b/test/metamodel_builder_test.rb
+index 4f0308b..4567a86 100644
+--- a/test/metamodel_builder_test.rb
++++ b/test/metamodel_builder_test.rb
+@@ -268,8 +268,8 @@ class MetamodelBuilderTest < Test::Unit::TestCase
+ sc = mm::SimpleClass.new
+ sc.longWithDefault = 5
+ assert_equal 5, sc.longWithDefault
+- sc.longWithDefault = 1234567890
+- assert_equal 1234567890, sc.longWithDefault
++ sc.longWithDefault = (2**(0.size * 8 -2) -1) + 1
++ assert_equal (2**(0.size * 8 -2) -1) + 1, sc.longWithDefault
+ assert sc.longWithDefault.is_a?(Bignum)
+ assert sc.longWithDefault.is_a?(Integer)
+ err = assert_raise StandardError do
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..7d55dbf
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Use-a-value-larger-than-Fixnum-max-to-test-Bignum-su.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-rgen.git
More information about the Pkg-ruby-extras-commits
mailing list