diff options
Diffstat (limited to 'py/test/Ice/operations/BatchOneways.py')
-rw-r--r-- | py/test/Ice/operations/BatchOneways.py | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/py/test/Ice/operations/BatchOneways.py b/py/test/Ice/operations/BatchOneways.py index a263d190d07..97d8eec9c04 100644 --- a/py/test/Ice/operations/BatchOneways.py +++ b/py/test/Ice/operations/BatchOneways.py @@ -7,7 +7,7 @@ # # ********************************************************************** -import Ice, Test, array +import Ice, Test, array, sys def test(b): if not b: @@ -15,20 +15,25 @@ def test(b): def batchOneways(p): - bs1 = [] - bs1[0:10 * 1024] = range(0, 10 * 1024) # add 100,000 entries. - bs1 = ['\x00' for x in bs1] # set them all to \x00 - bs1 = ''.join(bs1) # make into a byte array - - bs2 = [] - bs2[0:99 * 1024] = range(0, 99 * 1024) # add 100,000 entries. - bs2 = ['\x00' for x in bs2] # set them all to \x00 - bs2 = ''.join(bs2) # make into a byte array - - bs3 = [] - bs3[0:100 * 1024] = range(0, 100 * 1024) # add 100,000 entries. - bs3 = ['\x00' for x in bs3] # set them all to \x00 - bs3 = ''.join(bs3) # make into a byte array + if sys.version_info[0] == 2: + bs1 = [] + bs1[0:10 * 1024] = range(0, 10 * 1024) # add 100,000 entries. + bs1 = ['\x00' for x in bs1] # set them all to \x00 + bs1 = ''.join(bs1) # make into a byte array + + bs2 = [] + bs2[0:99 * 1024] = range(0, 99 * 1024) # add 100,000 entries. + bs2 = ['\x00' for x in bs2] # set them all to \x00 + bs2 = ''.join(bs2) # make into a byte array + + bs3 = [] + bs3[0:100 * 1024] = range(0, 100 * 1024) # add 100,000 entries. + bs3 = ['\x00' for x in bs3] # set them all to \x00 + bs3 = ''.join(bs3) # make into a byte array + else: + bs1 = bytes([0 for x in range(0, 10 * 1024)]) + bs2 = bytes([0 for x in range(0, 99 * 1024)]) + bs3 = bytes([0 for x in range(0, 100 * 1024)]) try: p.opByteSOneway(bs1) |