summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/li_carrays_cpp_runme.py
blob: 112cd00158d2ae1fb9df3dac9804da16e53ee928 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from li_carrays_cpp import *

d = doubleArray(10)

d[0] = 7
d[5] = d[0] + 3

if d[5] + d[0] != 17:
    raise RuntimeError

shorts = shortArray(5)

sum = sum_array(shorts)
if sum != 0:
    raise RuntimeError("incorrect zero sum, got: " + str(sum))

for i in range(5):
    shorts[i] = i

sum = sum_array(shorts)
if sum != 0+1+2+3+4:
    raise RuntimeError("incorrect sum, got: " + str(sum))