[libnet-dbus-perl] 273/335: Don't test precise equality for doubles (rt #37707)

Intrigeri intrigeri at moszumanska.debian.org
Sat Mar 21 01:08:09 UTC 2015


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch experimental
in repository libnet-dbus-perl.

commit 0b18d78d33fd56dd6be18ab029255ffb0b70c2db
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Mon May 4 17:31:32 2009 +0100

    Don't test precise equality for doubles (rt #37707)
---
 t/15-message.t | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/t/15-message.t b/t/15-message.t
index fc9a8fa..d07c221 100644
--- a/t/15-message.t
+++ b/t/15-message.t
@@ -64,7 +64,10 @@ ok($iter->next(), "next");
 
 ok($iter->get_string() eq "Hello world", "string");
 ok($iter->next(), "next");
-ok($iter->get_double() == 1.424141, "double");
+# Don't test precise equality, because floating point arithmetic
+# is not an exact science. (see RT #37707)
+my $d = $iter->get_double();
+ok($d > 1.424100 && $d < 1.424200, "double");
 
 ok($iter->next(), "next");
 is_deeply($iter->get_array(&Net::DBus::Binding::Message::TYPE_STRING), ["one", "two", "three"], "array");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-dbus-perl.git



More information about the Pkg-perl-cvs-commits mailing list