summaryrefslogtreecommitdiff
path: root/test/soap
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-01 15:29:43 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-01 15:29:43 +0000
commit637af54751be6cae06f9cafda9e6ba50b76c61eb (patch)
tree35f0a5b4fb6324e3695cef7149036b6fcd0e3d3e /test/soap
parent379c5c1e437821941802946fd370f0b84eb7363b (diff)
* test/logger/test_logger.rb: unlinking file before close causes problem under
win32 box. * lib/xsd/datatypes.rb(XSDFloat, XSDDouble): add +/- sign explicitly when stringified and embedded into XML instance. Ruby's sprintf may format -0.0 as "0.0" (no minus sign) depending on underlying C sprintf implementation. * test/xsd/test_xsd.rb, test/soap/test_basetype.rb: follow above change. * test/soap/calc/*: give httpd config param "CGIInterpreter". "/usr/bin/env ruby" thing does not work under non-Unix boxes. * ChangeLog: corrected wrong DoW of my log entries... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/soap')
-rw-r--r--test/soap/calc/server.cgi2
-rw-r--r--test/soap/calc/test_calc_cgi.rb6
-rw-r--r--test/soap/test_basetype.rb48
3 files changed, 29 insertions, 27 deletions
diff --git a/test/soap/calc/server.cgi b/test/soap/calc/server.cgi
index c4fa687..1eb0d1d 100644
--- a/test/soap/calc/server.cgi
+++ b/test/soap/calc/server.cgi
@@ -1,5 +1,3 @@
-#!/usr/bin/env ruby
-
require 'soap/rpc/cgistub'
class CalcServer < SOAP::RPC::CGIStub
diff --git a/test/soap/calc/test_calc_cgi.rb b/test/soap/calc/test_calc_cgi.rb
index 6d1204d..14b0097 100644
--- a/test/soap/calc/test_calc_cgi.rb
+++ b/test/soap/calc/test_calc_cgi.rb
@@ -2,6 +2,7 @@ require 'test/unit'
require 'soap/rpc/driver'
require 'logger'
require 'webrick'
+require 'rbconfig'
module SOAP
@@ -9,6 +10,8 @@ module Calc
class TestCalcCGI < Test::Unit::TestCase
+ # This test shuld be run after installing ruby.
+ RUBYBIN = File.join(Config::CONFIG["bindir"], Config::CONFIG["ruby_install_name"])
def setup
logger = Logger.new(STDERR)
logger.level = Logger::Severity::FATAL
@@ -18,7 +21,8 @@ class TestCalcCGI < Test::Unit::TestCase
:Port => 8808,
:AccessLog => [],
:DocumentRoot => File.dirname(File.expand_path(__FILE__)),
- :CGIPathEnv => ENV['PATH']
+ :CGIPathEnv => ENV['PATH'],
+ :CGIInterpreter => RUBYBIN
)
@t = Thread.new {
@server.start
diff --git a/test/soap/test_basetype.rb b/test/soap/test_basetype.rb
index 16f211c..0125f80 100644
--- a/test/soap/test_basetype.rb
+++ b/test/soap/test_basetype.rb
@@ -162,9 +162,9 @@ class TestSOAP < Test::Unit::TestCase
end
targets = [
- "3.141592654",
- "1.234e+37",
- "1.4e-45",
+ "+3.141592654",
+ "+1.234e+37",
+ "+1.4e-45",
"-1.4e-45",
]
targets.each do |f|
@@ -172,23 +172,23 @@ class TestSOAP < Test::Unit::TestCase
end
targets = [
- [3, "3"], # should be 3.0?
+ [3, "+3"], # should be 3.0?
[-2, "-2"], # ditto
- [3.14159265358979, "3.141592654"],
- [12.34e36, "1.234e+37"],
- [1.4e-45, "1.4e-45"],
+ [3.14159265358979, "+3.141592654"],
+ [12.34e36, "+1.234e+37"],
+ [1.4e-45, "+1.4e-45"],
[-1.4e-45, "-1.4e-45"],
- ["1.4e", "1.4"],
- ["12.34E36", "1.234e+37"],
- ["1.4E-45", "1.4e-45"],
+ ["1.4e", "+1.4"],
+ ["12.34E36", "+1.234e+37"],
+ ["1.4E-45", "+1.4e-45"],
["-1.4E-45", "-1.4e-45"],
- ["1.4E", "1.4"],
+ ["1.4E", "+1.4"],
]
targets.each do |f, str|
assert_equal(str, SOAP::SOAPFloat.new(f).to_s)
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(-0.0).to_s)
assert(SOAP::SOAPFloat.new(0.0/0.0).data.nan?)
assert_equal("INF", SOAP::SOAPFloat.new(1.0/0.0).to_s)
@@ -227,9 +227,9 @@ class TestSOAP < Test::Unit::TestCase
end
targets = [
- "3.14159265358979",
- "1.234e+37",
- "1.4e-45",
+ "+3.14159265358979",
+ "+1.234e+37",
+ "+1.4e-45",
"-1.4e-45",
]
targets.each do |f|
@@ -237,23 +237,23 @@ class TestSOAP < Test::Unit::TestCase
end
targets = [
- [3, "3"], # should be 3.0?
+ [3, "+3"], # should be 3.0?
[-2, "-2"], # ditto.
- [3.14159265358979, "3.14159265358979"],
- [12.34e36, "1.234e+37"],
- [1.4e-45, "1.4e-45"],
+ [3.14159265358979, "+3.14159265358979"],
+ [12.34e36, "+1.234e+37"],
+ [1.4e-45, "+1.4e-45"],
[-1.4e-45, "-1.4e-45"],
- ["1.4e", "1.4"],
- ["12.34E36", "1.234e+37"],
- ["1.4E-45", "1.4e-45"],
+ ["1.4e", "+1.4"],
+ ["12.34E36", "+1.234e+37"],
+ ["1.4E-45", "+1.4e-45"],
["-1.4E-45", "-1.4e-45"],
- ["1.4E", "1.4"],
+ ["1.4E", "+1.4"],
]
targets.each do |f, str|
assert_equal(str, SOAP::SOAPDouble.new(f).to_s)
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(-0.0).to_s)
assert_equal("NaN", SOAP::SOAPDouble.new(0.0/0.0).to_s)
assert(SOAP::SOAPDouble.new(0.0/0.0).data.nan?)