mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/soap/mapping/factory.rb: mark marshalled basetype objects when
@allow_original_mapping is true. multi-referencing basetype node is prohibited in SOAP/1.1 encoding but soap4r's original ruby object mapping requires basetype to be marked to detect self referencing loop. e.g. o = 1; o.instance_eval { @iv = o } soap4r's original mapping is only used through soap/marshal API. * test/soap/marshal/test_marshal.rb: add tests for self referencing immutable objects. * test/soap/calc/test_calc_cgi.rb: fix test name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e6775cc193
commit
3f4d04564b
4 changed files with 41 additions and 3 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
Sat Nov 1 01:49:03 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/soap/mapping/factory.rb: mark marshalled basetype objects when
|
||||||
|
@allow_original_mapping is true. multi-referencing basetype node is
|
||||||
|
prohibited in SOAP/1.1 encoding but soap4r's original ruby object
|
||||||
|
mapping requires basetype to be marked to detect self referencing
|
||||||
|
loop. e.g. o = 1; o.instance_eval { @iv = o } soap4r's original
|
||||||
|
mapping is only used through soap/marshal API.
|
||||||
|
|
||||||
|
* test/soap/marshal/test_marshal.rb: add tests for self referencing
|
||||||
|
immutable objects.
|
||||||
|
|
||||||
|
* test/soap/calc/test_calc_cgi.rb: fix test name.
|
||||||
|
|
||||||
Fri Oct 31 22:26:29 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
|
Fri Oct 31 22:26:29 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
|
||||||
|
|
||||||
* wince/string_wce.c (strrchr): should decrement pointer.
|
* wince/string_wce.c (strrchr): should decrement pointer.
|
||||||
|
|
|
@ -136,7 +136,10 @@ class BasetypeFactory_ < Factory
|
||||||
rescue XSD::ValueSpaceError
|
rescue XSD::ValueSpaceError
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
# Basetype except String should not be multiref-ed in SOAP/1.1.
|
if @allow_original_mapping
|
||||||
|
# Basetype except String should not be multiref-ed in SOAP/1.1.
|
||||||
|
mark_marshalled_obj(obj, soap_obj)
|
||||||
|
end
|
||||||
soap_obj
|
soap_obj
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ class TestCalcCGI < Test::Unit::TestCase
|
||||||
@calc.reset_stream
|
@calc.reset_stream
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_calc
|
def test_calc_cgi
|
||||||
assert_equal(3, @calc.add(1, 2))
|
assert_equal(3, @calc.add(1, 2))
|
||||||
assert_equal(-1.1, @calc.sub(1.1, 2.2))
|
assert_equal(-1.1, @calc.sub(1.1, 2.2))
|
||||||
assert_equal(2.42, @calc.multi(1.1, 2.2))
|
assert_equal(2.42, @calc.multi(1.1, 2.2))
|
||||||
|
|
|
@ -20,7 +20,6 @@ module MarshalTestLib
|
||||||
end
|
end
|
||||||
|
|
||||||
def marshaltest(o1)
|
def marshaltest(o1)
|
||||||
#o1.instance_eval { remove_instance_variable '@v' if defined? @v }
|
|
||||||
str = encode(o1)
|
str = encode(o1)
|
||||||
print str, "\n" if $DEBUG
|
print str, "\n" if $DEBUG
|
||||||
o2 = decode(str)
|
o2 = decode(str)
|
||||||
|
@ -174,6 +173,22 @@ module MarshalTestLib
|
||||||
marshal_equal(0x3fff_ffff)
|
marshal_equal(0x3fff_ffff)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_fixnum_ivar
|
||||||
|
o1 = 1
|
||||||
|
o1.instance_eval { @iv = 2 }
|
||||||
|
marshal_equal(o1) {|o| o.instance_eval { @iv }}
|
||||||
|
ensure
|
||||||
|
1.instance_eval { remove_instance_variable("@iv") }
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_fixnum_ivar_self
|
||||||
|
o1 = 1
|
||||||
|
o1.instance_eval { @iv = 1 }
|
||||||
|
marshal_equal(o1) {|o| o.instance_eval { @iv }}
|
||||||
|
ensure
|
||||||
|
1.instance_eval { remove_instance_variable("@iv") }
|
||||||
|
end
|
||||||
|
|
||||||
def test_float
|
def test_float
|
||||||
marshal_equal(-1.0)
|
marshal_equal(-1.0)
|
||||||
marshal_equal(0.0)
|
marshal_equal(0.0)
|
||||||
|
@ -193,6 +208,12 @@ module MarshalTestLib
|
||||||
marshal_equal(o1) {|o| o.instance_eval { @iv }}
|
marshal_equal(o1) {|o| o.instance_eval { @iv }}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_float_ivar_self
|
||||||
|
o1 = 5.5
|
||||||
|
o1.instance_eval { @iv = o1 }
|
||||||
|
marshal_equal(o1) {|o| o.instance_eval { @iv }}
|
||||||
|
end
|
||||||
|
|
||||||
def test_float_extend
|
def test_float_extend
|
||||||
o1 = 0.0/0.0
|
o1 = 0.0/0.0
|
||||||
o1.extend(Mod1)
|
o1.extend(Mod1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue