Accepting request 311108 from devel:libraries:c_c++

Fix test suite with gcc5 as a side effect of another bugfix (forwarded request 311105 from dimstar)

OBS-URL: https://build.opensuse.org/request/show/311108
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gsl?expand=0&rev=33
This commit is contained in:
Dominique Leuenberger 2015-06-12 18:27:10 +00:00 committed by Git OBS Bridge
parent 4d249a3537
commit c17287f785
3 changed files with 89 additions and 0 deletions

View File

@ -0,0 +1,81 @@
From 9cc12d0377dd634b1b97954d076b715f982853b7 Mon Sep 17 00:00:00 2001
From: Patrick Alken <alken@colorado.edu>
Date: Fri, 04 Apr 2014 19:36:16 +0000
Subject: bug fix in sorting of complex numbers (bug #39055)
---
diff --git a/poly/test.c b/poly/test.c
index 9c147f6..d090802 100644
--- a/poly/test.c
+++ b/poly/test.c
@@ -25,11 +25,21 @@
#include <gsl/gsl_poly.h>
#include <gsl/gsl_heapsort.h>
+/* sort by Re(z) then by Im(z) */
static int
cmp_cplx(const double *a, const double *b)
{
- double t = (a[0] * a[0] + a[1] * a[1]) - (b[0] * b[0] + b[1] * b[1]);
- return t < 0.0 ? -1 : t > 0.0 ? 1 : 0;
+ double r = a[0] - b[0];
+
+ if (r == 0.0)
+ {
+ double t = a[1] - b[1];
+ return t < 0.0 ? -1 : t > 0.0 ? 1 : 0;
+ }
+ else if (r < 0.0)
+ return -1;
+ else
+ return 1;
}
int
@@ -534,25 +544,26 @@ main (void)
Problem reported by Munagala Ramanath (bug #39055)
*/
- double a[16] = { 32, -48, -8, 28, -8, 16, -16, 12, -16, 6, 10, -17, 10, 2, -4, 1 };
+ double a[16] = { 32, -48, -8, 28, -8, 16, -16, 12,
+ -16, 6, 10, -17, 10, 2, -4, 1 };
double z[16*2];
- double expected[16*20] = {
- 1.0000000000000000, 0.00000000000000000,
- 1.0000000000000000, 0.00000000000000000,
- -1.0000000000000000, 0.00000000000000000,
- -0.65893856175240950, 0.83459757287426684,
- -0.65893856175240950, -0.83459757287426684,
- -0.070891117403341281, -1.1359249087587791,
- -0.070891117403341281, 1.1359249087587791,
- 1.1142366961812986, -0.48083981203389980,
- 1.1142366961812986, 0.48083981203389980,
- -1.3066982484920768, 0.00000000000000000,
- 0.57284747839410854, 1.1987808988289705,
- 0.57284747839410854, -1.1987808988289705,
- -1.6078107423472359, 0.00000000000000000,
- 2.0000000000000000, 0.00000000000000000,
- 2.0000000000000000, 0.00000000000000000 };
+ double expected[16*2] = {
+ -1.6078107423472359, 0.00000000000000000,
+ -1.3066982484920768, 0.00000000000000000,
+ -1.0000000000000000, 0.00000000000000000,
+ -0.65893856175240950, -0.83459757287426684,
+ -0.65893856175240950, 0.83459757287426684,
+ -0.070891117403341281, -1.1359249087587791,
+ -0.070891117403341281, 1.1359249087587791,
+ 0.57284747839410854, -1.1987808988289705,
+ 0.57284747839410854, 1.1987808988289705,
+ 1.0000000000000000, 0.00000000000000000,
+ 1.0000000000000000, 0.00000000000000000,
+ 1.1142366961812986, -0.48083981203389980,
+ 1.1142366961812986, 0.48083981203389980,
+ 2.0000000000000000, 0.00000000000000000,
+ 2.0000000000000000, 0.00000000000000000 };
int i;
--
cgit v0.9.0.2

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jun 8 07:25:20 UTC 2015 - dimstar@opensuse.org
- Add gsl-sorting-complex-numbers.patch: fix in sorting of complex
numbers (http://savannah.gnu.org/bugs/?39055).
-------------------------------------------------------------------
Wed Feb 25 20:04:58 UTC 2015 - mpluskal@suse.com

View File

@ -32,6 +32,7 @@ Patch5: gsl-wrap.diff
Patch6: gsl-qawc-test-x86-precision.diff
Patch7: gsl-disable-fma.patch
Patch8: gsl-fsf_address.patch
Patch9: gsl-sorting-complex-numbers.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: blas-devel
@ -134,6 +135,7 @@ Least-Squares Fitting - Physical Constants - IEEE Floating-Point
%patch6
%patch7 -p1
%patch8
%patch9 -p1
%build
autoreconf -fi