[msgpack] Apply patch for int->float test failure

Daiki Ueno ueno at fedoraproject.org
Fri Jul 18 08:12:56 UTC 2014


commit 9eab9dc3c356003d9f6af4c2d576f4fe9807f28e
Author: Daiki Ueno <dueno at redhat.com>
Date:   Fri Jul 18 17:13:01 2014 +0900

    Apply patch for int->float test failure

 msgpack-fix-int-float-test.patch |   30 ++++++++++++++++++++++++++++++
 msgpack.spec                     |    3 +++
 2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/msgpack-fix-int-float-test.patch b/msgpack-fix-int-float-test.patch
new file mode 100644
index 0000000..4f49adc
--- /dev/null
+++ b/msgpack-fix-int-float-test.patch
@@ -0,0 +1,30 @@
+From c203928fae924e017f39afb2723414d458fc01a1 Mon Sep 17 00:00:00 2001
+From: Daiki Ueno <ueno at gnu.org>
+Date: Thu, 17 Jul 2014 18:38:04 +0900
+Subject: [PATCH] Fix test failure regarding int->float conversion
+
+Supply only small integers (< 1^24) to int->float conversion tests,
+so they can roundtrip without error.
+---
+ test/msgpack_test.cpp | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/test/msgpack_test.cpp b/test/msgpack_test.cpp
+index fb35c68..6917caf 100644
+--- a/test/msgpack_test.cpp
++++ b/test/msgpack_test.cpp
+@@ -201,10 +201,8 @@ TYPED_TEST_P(IntegerToFloatingPointTest, simple_buffer)
+   v.push_back(1);
+   if (numeric_limits<integer_type>::is_signed) v.push_back(-1);
+   else v.push_back(2);
+-  v.push_back(numeric_limits<integer_type>::min());
+-  v.push_back(numeric_limits<integer_type>::max());
+   for (unsigned int i = 0; i < kLoop; i++) {
+-    v.push_back(rand());
++    v.push_back(rand() % 0x7FFFFF);
+   }
+   for (unsigned int i = 0; i < v.size() ; i++) {
+     msgpack::sbuffer sbuf;
+-- 
+1.9.3
+
diff --git a/msgpack.spec b/msgpack.spec
index e46fd3e..58fb328 100644
--- a/msgpack.spec
+++ b/msgpack.spec
@@ -7,6 +7,7 @@ Group:		System Environment/Libraries
 License:	ASL 2.0
 URL:		http://msgpack.org
 Source0:	https://github.com/msgpack/msgpack-c/releases/download/cpp-%{version}/%{name}-%{version}.tar.gz
+Patch0:		msgpack-fix-int-float-test.patch
 
 # for regenerating configure
 BuildRequires:	libtool
@@ -31,6 +32,7 @@ Libraries and header files for %{name}
 
 %prep
 %setup -q
+%patch0 -p1 -b .fix-int-float-test
 
 
 %build
@@ -66,6 +68,7 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f '{}' ';'
 %changelog
 * Fri Jul 11 2014 Daiki Ueno <dueno at redhat.com> - 0.5.9-1
 - new upstream release
+- apply patch to fix int->float test failure
 
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.5.8-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild


More information about the scm-commits mailing list