qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1655396 - in /qpid/dispatch/trunk: src/python_embedded.c tests/system_tests_management.py
Date Wed, 28 Jan 2015 17:30:33 GMT
Author: aconway
Date: Wed Jan 28 17:30:33 2015
New Revision: 1655396

URL: http://svn.apache.org/r1655396
Log:
NO-JIRA: Dispatch incorrectly decodes negative small long values into python.

Modified:
    qpid/dispatch/trunk/src/python_embedded.c
    qpid/dispatch/trunk/tests/system_tests_management.py

Modified: qpid/dispatch/trunk/src/python_embedded.c
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/python_embedded.c?rev=1655396&r1=1655395&r2=1655396&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/python_embedded.c (original)
+++ qpid/dispatch/trunk/src/python_embedded.c Wed Jan 28 17:30:33 2015
@@ -257,7 +257,7 @@ PyObject *qd_field_to_py(qd_parsed_field
 
       case QD_AMQP_LONG:
       case QD_AMQP_SMALLLONG:
-        result = PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) qd_parse_as_long(field));
+        result = PyLong_FromLongLong((PY_LONG_LONG)qd_parse_as_long(field));
         break;
 
       case QD_AMQP_FLOAT:

Modified: qpid/dispatch/trunk/tests/system_tests_management.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/tests/system_tests_management.py?rev=1655396&r1=1655395&r2=1655396&view=diff
==============================================================================
--- qpid/dispatch/trunk/tests/system_tests_management.py (original)
+++ qpid/dispatch/trunk/tests/system_tests_management.py Wed Jan 28 17:30:33 2015
@@ -19,13 +19,14 @@
 
 """System tests for management of qdrouter"""
 
-import unittest, system_test, re, os
+import unittest, system_test, re, os, json, sys
 from qpid_dispatch.management import Node, ManagementError, Url, BadRequestStatus, NotImplementedStatus,
NotFoundStatus, ForbiddenStatus
 from system_test import Qdrouterd, message, retry, wait_ports, Process
 from proton import ConnectionException
 from itertools import chain
 
-PREFIX = 'org.apache.qpid.dispatch.'
+PREFIX = u'org.apache.qpid.dispatch.'
+MANAGEMENT = PREFIX + 'management'
 CONFIGURATION = PREFIX + 'configurationEntity'
 OPERATIONAL = PREFIX + 'operationalEntity'
 LISTENER = PREFIX + 'listener'
@@ -251,7 +252,8 @@ class ManagementTest(system_test.TestCas
         finally:
             f.close()
 
-    def test_entity(self):
+    def test_dummy(self):
+        """Test all operations on the dummy test entity"""
         entity = self.node.read(type=LISTENER, name='l0')
         self.assertEqual('l0', entity.name)
         self.assertEqual(str(self.router.ports[0]), entity.port)
@@ -300,8 +302,16 @@ class ManagementTest(system_test.TestCas
         dummy2 = self.node.read(type=DUMMY, name='MyDummy')
         self.assertEqual(dummy.attributes, dummy2.attributes)
 
-        self.assertEqual({'operation': 'callme', 'foo': 'bar', 'type': DUMMY, 'identity':
identity},
-                         dummy.call('callme', foo='bar'))
+        integers = [0, 1, 42, (2**63)-1, -1, -42, -(2**63)]
+        test_data = ["bytes", u"string"] + integers
+        for data in test_data:
+            try:
+                self.assertEqual(
+                    {u'operation': u'callme', u'type': DUMMY, u'identity': identity, u'data':
data},
+                    dummy.call('callme', data=data))
+            except TypeError, e:
+                extype, value, trace = sys.exc_info()
+                raise extype, "data=%r: %s" % (data, value), trace
 
         dummy.badattribute = 'Bad'
         self.assertRaises(BadRequestStatus, dummy.update)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message