summaryrefslogtreecommitdiff
path: root/cpp/bindings/qmf/tests/ruby_console_test.rb
diff options
context:
space:
mode:
authorKenneth Anthony Giusti <kgiusti@apache.org>2010-04-27 15:19:14 +0000
committerKenneth Anthony Giusti <kgiusti@apache.org>2010-04-27 15:19:14 +0000
commitf10f690cdd3ea96dc0f2700f9daea8127f5537bf (patch)
tree258700d0e5d27a80ecd8ff4d0b668b9b79c60825 /cpp/bindings/qmf/tests/ruby_console_test.rb
parent165d9cb4734734882082d472db91aabc846c6909 (diff)
downloadqpid-python-f10f690cdd3ea96dc0f2700f9daea8127f5537bf.tar.gz
QPID-2556: fix conversion of signed integers in maps and lists.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@938506 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qmf/tests/ruby_console_test.rb')
-rwxr-xr-xcpp/bindings/qmf/tests/ruby_console_test.rb55
1 files changed, 17 insertions, 38 deletions
diff --git a/cpp/bindings/qmf/tests/ruby_console_test.rb b/cpp/bindings/qmf/tests/ruby_console_test.rb
index 11be03fc34..0782ae795a 100755
--- a/cpp/bindings/qmf/tests/ruby_console_test.rb
+++ b/cpp/bindings/qmf/tests/ruby_console_test.rb
@@ -177,44 +177,6 @@ class ConsoleTest < ConsoleTestBase
end
end
- def test_C_basic_types_map
- parent = @qmfc.object(:class =>"parent")
- assert(parent, "Number of parent objects")
-
- result = parent.set_numerics("big")
- assert_equal(result.status, 0, "Method Response Status")
- assert_equal(result.text, "OK", "Method Response Text")
-
- parent.update
-
- map = parent.mapval
-
- assert_equal(map['u64'], 0x9494949449494949)
- assert_equal(map['u32'], 0xA5A55A5A)
- assert_equal(map['u16'], 0xB66B)
- assert_equal(map['u8'], 0xC7)
-
- assert_equal(map['i64'], 1000000000000000000)
- assert_equal(map['i32'], 1000000000)
- assert_equal(map['i16'], 10000)
- assert_equal(map['i8'], 100)
-
- assert_equal(map['sstr'], "Short String")
-
- submap = map['map']
- assert_equal(submap['first'], "FIRST")
- assert_equal(submap['second'], "SECOND")
-
- result = parent.set_map({'first' => 'FIRST', 'sub' => {'subfirst' => 25}})
- assert_equal(result.status, 0, "Method Response Status")
- assert_equal(result.text, "OK", "Method Response Text")
-
- rmap = result.args.output
- assert_equal(rmap['first'], "FIRST")
- assert_equal(rmap['sub']['subfirst'], 25)
- assert_equal(rmap['added'], 'Added Text')
- end
-
def test_D_userid_for_method
parent = @qmfc.object(:class => "parent")
assert(parent, "Number of parent objects")
@@ -314,6 +276,23 @@ class ConsoleTest < ConsoleTestBase
assert(parent.listval[4][3].class == Hash)
assert_equal(parent.listval[4][3]["hi"], 10)
assert_equal(parent.listval[4][3]["lo"], 5)
+ assert_equal(parent.listval[4][3]["neg"], -3)
+
+ # see agent for structure of mapval
+
+ assert(parent.mapval.class == Hash)
+ assert_equal(parent.mapval.length, 7)
+ assert_equal(parent.mapval['aLong'], 9999999999)
+ assert_equal(parent.mapval['aInt'], 54321)
+ assert_equal(parent.mapval['aSigned'], -666)
+ assert_equal(parent.mapval['aString'], "A String")
+ assert_equal(parent.mapval['aFloat'], 3.1415)
+ assert(parent.mapval['aMap'].class == Hash)
+ assert_equal(parent.mapval['aMap'].length, 2)
+ assert_equal(parent.mapval['aMap']['second'], 2)
+ assert(parent.mapval['aList'].class == Array)
+ assert_equal(parent.mapval['aList'].length, 4)
+ assert_equal(parent.mapval['aList'][1], -1)
end
end