bind: test __len__

Change-Id: I17dbafd6014bcc2ca6faafd46a4bd50fb1693a33
This commit is contained in:
Sebastien Binet 2015-08-05 17:44:49 +02:00
parent 1fd60af396
commit 45b32c5643
2 changed files with 17 additions and 0 deletions

View File

@ -141,3 +141,14 @@ for i,o in enumerate(objs):
print "--- len(vs):",len(vs) print "--- len(vs):",len(vs)
del objs del objs
print "--- testing GC... [ok]" print "--- testing GC... [ok]"
print "--- testing array..."
arr = hi.GetIntArray()
print "arr:",arr
print "len(arr):",len(arr)
print "--- testing slice..."
s = hi.GetIntSlice()
print "slice:",s
print "len(slice):",len(s)

View File

@ -137,6 +137,12 @@ hi.Couple{P1=hi.Person{Name="mom", Age=50}, P2=hi.Person{Name="bob", Age=51}}
--- len(objs): 100000 --- len(objs): 100000
--- len(vs): 100000 --- len(vs): 100000
--- testing GC... [ok] --- testing GC... [ok]
--- testing array...
arr: [2]int{1, 2}
len(arr): 2
--- testing slice...
slice: []int{1, 2}
len(slice): 2
`) `)
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
cmd = exec.Command("python2", "./test.py") cmd = exec.Command("python2", "./test.py")