From 51b79cafaa57b231f3fd87e29fe190a442bd8a81 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Thu, 13 Jan 2011 19:10:07 +0000 Subject: In qmfengine, if a method call or method response requires a buffer larger than the static buffer used for communication, allocate a large-enough buffer temporarily from the heap. A test is included to verify large-buffer behavior. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1058709 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/bindings/qmf/tests/ruby_console_test.rb | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'qpid/cpp/bindings') diff --git a/qpid/cpp/bindings/qmf/tests/ruby_console_test.rb b/qpid/cpp/bindings/qmf/tests/ruby_console_test.rb index 1c4a0a2105..972d5977b8 100755 --- a/qpid/cpp/bindings/qmf/tests/ruby_console_test.rb +++ b/qpid/cpp/bindings/qmf/tests/ruby_console_test.rb @@ -354,6 +354,43 @@ class ConsoleTest < ConsoleTestBase end end + def test_H_map_list_method_call_big + parent = @qmfc.object(:class => "parent") + assert(parent, "Number of 'parent' objects") + + big_string = "" + segment = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + for idx in 1...1500 + big_string = big_string + segment + end + + inMap = {'aLong' => 9999999999, + 'aInt' => 54321, + 'aSigned' => -666, + 'aString' => big_string, + 'another' => big_string, + 'aFloat' => 3.1415, + 'aList' => ['x', -1, 'y', 2], + 'abool' => false} + + inList = ['aString', 1, -1, 2.7182, {'aMap'=> -8}, true] + + result = parent.test_map_list(inMap, inList) + assert_equal(result.status, 0) + assert_equal(result.text, "OK") + + # verify returned values + assert_equal(inMap.length, result.args['outMap'].length) + result.args['outMap'].each do |k,v| + assert_equal(inMap[k], v) + end + + assert_equal(inList.length, result.args['outList'].length) + for idx in 0...inList.length + assert_equal(inList[idx], result.args['outList'][idx]) + end + end + end app = ConsoleTest.new -- cgit v1.2.1