summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/soap/marshal/test_marshal.rb2
-rw-r--r--test/soap/test_basetype.rb6
-rw-r--r--test/xsd/test_xsd.rb6
3 files changed, 9 insertions, 5 deletions
diff --git a/test/soap/marshal/test_marshal.rb b/test/soap/marshal/test_marshal.rb
index 9ae08c68d8..d530c06c24 100644
--- a/test/soap/marshal/test_marshal.rb
+++ b/test/soap/marshal/test_marshal.rb
@@ -205,7 +205,7 @@ module MarshalTestLib
marshal_equal(1.0/0.0)
marshal_equal(-1.0/0.0)
marshal_equal(0.0/0.0) {|o| o.nan?}
- marshal_equal(-0.0) {|o| 1.0/o}
+ marshal_equal(-1.0 / (1.0 / 0.0)) {|o| 1.0/o} # -0.0
end
def test_float_ivar
diff --git a/test/soap/test_basetype.rb b/test/soap/test_basetype.rb
index a00f0f549c..7a77946c2c 100644
--- a/test/soap/test_basetype.rb
+++ b/test/soap/test_basetype.rb
@@ -6,6 +6,8 @@ module SOAP
class TestSOAP < Test::Unit::TestCase
+ NegativeZero = (-1.0 / (1.0 / 0.0))
+
def setup
# Nothing to do.
end
@@ -189,7 +191,7 @@ class TestSOAP < Test::Unit::TestCase
end
assert_equal("+0", SOAP::SOAPFloat.new(+0.0).to_s)
- assert_equal("-0", SOAP::SOAPFloat.new(-0.0).to_s)
+ assert_equal("-0", SOAP::SOAPFloat.new(NegativeZero).to_s)
assert(SOAP::SOAPFloat.new(0.0/0.0).data.nan?)
assert_equal("INF", SOAP::SOAPFloat.new(1.0/0.0).to_s)
assert_equal(1, SOAP::SOAPFloat.new(1.0/0.0).data.infinite?)
@@ -254,7 +256,7 @@ class TestSOAP < Test::Unit::TestCase
end
assert_equal("+0", SOAP::SOAPFloat.new(+0.0).to_s)
- assert_equal("-0", SOAP::SOAPFloat.new(-0.0).to_s)
+ assert_equal("-0", SOAP::SOAPFloat.new(NegativeZero).to_s)
assert_equal("NaN", SOAP::SOAPDouble.new(0.0/0.0).to_s)
assert(SOAP::SOAPDouble.new(0.0/0.0).data.nan?)
assert_equal("INF", SOAP::SOAPDouble.new(1.0/0.0).to_s)
diff --git a/test/xsd/test_xsd.rb b/test/xsd/test_xsd.rb
index 9b3a7f0f1f..db38aee7ca 100644
--- a/test/xsd/test_xsd.rb
+++ b/test/xsd/test_xsd.rb
@@ -6,6 +6,8 @@ module XSD
class TestXSD < Test::Unit::TestCase
+ NegativeZero = (-1.0 / (1.0 / 0.0))
+
def setup
end
@@ -222,7 +224,7 @@ class TestXSD < Test::Unit::TestCase
end
assert_equal("+0", XSD::XSDFloat.new(+0.0).to_s)
- assert_equal("-0", XSD::XSDFloat.new(-0.0).to_s)
+ assert_equal("-0", XSD::XSDFloat.new(NegativeZero).to_s)
assert(XSD::XSDFloat.new(0.0/0.0).data.nan?)
assert_equal("INF", XSD::XSDFloat.new(1.0/0.0).to_s)
assert_equal(1, XSD::XSDFloat.new(1.0/0.0).data.infinite?)
@@ -287,7 +289,7 @@ class TestXSD < Test::Unit::TestCase
end
assert_equal("+0", XSD::XSDFloat.new(+0.0).to_s)
- assert_equal("-0", XSD::XSDFloat.new(-0.0).to_s)
+ assert_equal("-0", XSD::XSDFloat.new(NegativeZero).to_s)
assert_equal("NaN", XSD::XSDDouble.new(0.0/0.0).to_s)
assert(XSD::XSDDouble.new(0.0/0.0).data.nan?)
assert_equal("INF", XSD::XSDDouble.new(1.0/0.0).to_s)