[clhep] 03/07: Fix broken double comparision in a testcase. (Closes: #733301)
Ole Streicher
olebole at moszumanska.debian.org
Tue Feb 7 11:25:30 UTC 2017
This is an automated email from the git hooks/post-receive script.
olebole pushed a commit to branch master
in repository clhep.
commit 5c24836bf1daeab41e85a9933b115f69fdc21267
Author: Philipp Kern <pkern at debian.org>
Date: Fri Apr 25 23:56:31 2014 +0200
Fix broken double comparision in a testcase. (Closes: #733301)
---
debian/changelog | 7 +++++
.../fix-double-comparision-in-testBug58950.patch | 35 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 43 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 3b4b90e..1de3786 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+clhep (2.1.4.1-1.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * 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 --git a/debian/patches/fix-double-comparision-in-testBug58950.patch b/debian/patches/fix-double-comparision-in-testBug58950.patch
new file mode 100644
index 0000000..8325168
--- /dev/null
+++ b/debian/patches/fix-double-comparision-in-testBug58950.patch
@@ -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 --git a/debian/patches/series b/debian/patches/series
index ba3f063..3e08479 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ soname.patch
doxygen.conf
clhep-config.patch
tests.patch
+fix-double-comparision-in-testBug58950.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/clhep.git
More information about the debian-science-commits
mailing list