summaryrefslogtreecommitdiff
path: root/ruby/test
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2015-12-02 12:42:12 -0800
committerMark Spruiell <mes@zeroc.com>2015-12-02 12:42:12 -0800
commit73f4e5936a12c3ab79479e96e5e2eb45fbb72139 (patch)
tree9cc30b15f7c034f189ae1e5e9398f695a8bc22a5 /ruby/test
parentFixes for ICE-6905 - support NaN/Infinity in scripting languages (diff)
downloadice-73f4e5936a12c3ab79479e96e5e2eb45fbb72139.tar.bz2
ice-73f4e5936a12c3ab79479e96e5e2eb45fbb72139.tar.xz
ice-73f4e5936a12c3ab79479e96e5e2eb45fbb72139.zip
Ruby portability fix for ICE-6905
Diffstat (limited to 'ruby/test')
-rw-r--r--ruby/test/Ice/operations/Twoways.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/ruby/test/Ice/operations/Twoways.rb b/ruby/test/Ice/operations/Twoways.rb
index 453a048b219..2ac21be3874 100644
--- a/ruby/test/Ice/operations/Twoways.rb
+++ b/ruby/test/Ice/operations/Twoways.rb
@@ -135,11 +135,19 @@ def twoways(communicator, p)
r, f, d = p.opFloatDouble(3.402823466E38, 0.0)
r, f, d = p.opFloatDouble(-3.402823466E38, 0.0)
- for val in [Float::NAN, -Float::NAN]
+ #
+ # For portability, don't use Float::NAN here.
+ #
+ nan = 0.0 / 0.0
+ for val in [nan, -nan]
r, f, d = p.opFloatDouble(val, val)
test(r.nan? && f.nan? && d.nan?)
end
- for val in [Float::INFINITY, -Float::INFINITY]
+ #
+ # For portability, don't use Float::INFINITY here.
+ #
+ inf = 1.0 / 0.0
+ for val in [inf, -inf]
r, f, d = p.opFloatDouble(val, val)
test(r.infinite? != 0 && f.infinite? != 0 && d.infinite? != 0)
end