Bug#733301: clhep: FTBFS on *i386
Philipp Kern
pkern at debian.org
Fri Apr 25 22:07:56 UTC 2014
Control: tag -1 + pending
Hi,
On Sat, Dec 28, 2013 at 11:48:04AM +0100, Ivo De Decker wrote:
> The version of clhep in unstable fails with testsuite errors on i386:
> https://buildd.debian.org/status/package.php?p=clhep
the attached patch fixes the failing test. I hope in time to not have
all the rdeps removed. I'll upload the NMU tomorrow when I have more
bandwidth.
Kind regards
Philipp Kern
-------------- next part --------------
diff -Nru clhep-2.1.4.1/debian/changelog clhep-2.1.4.1/debian/changelog
--- clhep-2.1.4.1/debian/changelog 2013-12-14 09:49:56.000000000 +0100
+++ clhep-2.1.4.1/debian/changelog 2014-04-25 23:58:14.000000000 +0200
@@ -1,3 +1,9 @@
+clhep (2.1.4.1-1.1) unstable; urgency=medium
+
+ * Fix broken double comparision in a testcase. (Closes: #733301)
+
+ -- Philipp Kern <pkern at debian.org> Fri, 25 Apr 2014 23:56:31 +0200
+
clhep (2.1.4.1-1) unstable; urgency=low
* New upstream release. (Closes: #713377)
diff -Nru clhep-2.1.4.1/debian/patches/fix-double-comparision-in-testBug58950.patch clhep-2.1.4.1/debian/patches/fix-double-comparision-in-testBug58950.patch
--- clhep-2.1.4.1/debian/patches/fix-double-comparision-in-testBug58950.patch 1970-01-01 01:00:00.000000000 +0100
+++ clhep-2.1.4.1/debian/patches/fix-double-comparision-in-testBug58950.patch 2014-04-26 00:01:06.000000000 +0200
@@ -0,0 +1,35 @@
+Description: fix double comparision in testBug58950.cc
+ The double comparision using != failed on i386 due to the way floating
+ point works. The other test cases already ship this equals function;
+ copy it and use it.
+Author: Philipp Kern <pkern at debian.org>
+Bug-Debian: http://bugs.debian.org/733301
+
+--- clhep-2.1.4.1.orig/Random/test/testBug58950.cc
++++ clhep-2.1.4.1/Random/test/testBug58950.cc
+@@ -14,6 +14,16 @@
+ #include "CLHEP/Random/Random.h"
+ #include "pretend.h"
+
++// Absolutely Safe Equals Without Registers Screwing Us Up
++bool equals01(const std::vector<double> &ab) {
++ return ab[1]==ab[0];
++}
++bool equals(double a, double b) {
++ std::vector<double> ab(2);
++ ab[0]=a; ab[1]=b;
++ return (equals01(ab));
++}
++
+ bool printCheck( int & i, double & r, std::ofstream & os )
+ {
+ os << i << " " << r << std::endl;
+@@ -151,7 +161,7 @@ int main() {
+ g->setTheSeeds(seeds);
+ for (int i=0; i < nNumbers; ++i) {
+ double r = g->flat();
+- if(v[i] != r ) {
++ if(! equals(v[i],r) ) {
+ ++badcount;
+ std::cerr << " rollback fails: i, v[i], r "
+ << i << " " << v[i] << " " << r << std::endl;
diff -Nru clhep-2.1.4.1/debian/patches/series clhep-2.1.4.1/debian/patches/series
--- clhep-2.1.4.1/debian/patches/series 2013-12-14 09:49:56.000000000 +0100
+++ clhep-2.1.4.1/debian/patches/series 2014-04-25 23:59:57.000000000 +0200
@@ -2,3 +2,4 @@
doxygen.conf
clhep-config.patch
tests.patch
+fix-double-comparision-in-testBug58950.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/debian-science-maintainers/attachments/20140426/2ad44248/attachment.sig>
More information about the debian-science-maintainers
mailing list