diff options
Diffstat (limited to 'test/xmlrpc/test_marshal.rb')
-rw-r--r-- | test/xmlrpc/test_marshal.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/xmlrpc/test_marshal.rb b/test/xmlrpc/test_marshal.rb index 267b43e2e2..ca029d3b06 100644 --- a/test/xmlrpc/test_marshal.rb +++ b/test/xmlrpc/test_marshal.rb @@ -43,7 +43,7 @@ class Test_Marshal < Test::Unit::TestCase def test_parser_values v1 = [ - 1, -7778, # integers + 1, -7778, -(2**31), 2**31-1, # integers 1.0, 0.0, -333.0, 2343434343.0, # floats false, true, true, false, # booleans "Hallo", "with < and >", "" # strings @@ -81,6 +81,21 @@ class Test_Marshal < Test::Unit::TestCase # Struct end + def test_parser_invalid_values + values = [ + -1-(2**31), 2**31, + Float::INFINITY, -Float::INFINITY, Float::NAN + ] + XMLRPC::XMLParser.each_installed_parser do |parser| + m = XMLRPC::Marshal.new(parser) + + values.each do |v| + assert_raise(RuntimeError, "#{v} shouldn't be dumped, but dumped") \ + { m.dump_response(v) } + end + end + end + def test_no_params_tag # bug found by Idan Sofer |