projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59831f7
)
added new failing C++ test for iterating over the pointer to a C++ vector
author
Stefan Behnel
<stefan_ml@behnel.de>
Sat, 11 Aug 2012 20:08:21 +0000
(22:08 +0200)
committer
Stefan Behnel
<stefan_ml@behnel.de>
Sat, 11 Aug 2012 20:08:21 +0000
(22:08 +0200)
tests/run/cpp_iterators.pyx
patch
|
blob
|
history
diff --git
a/tests/run/cpp_iterators.pyx
b/tests/run/cpp_iterators.pyx
index
ceb25a8
..
2748f47
100644
(file)
--- a/
tests/run/cpp_iterators.pyx
+++ b/
tests/run/cpp_iterators.pyx
@@
-48,3
+48,17
@@
def test_custom():
return [x for x in iter[0]]
finally:
del iter
+
+def test_iteration_over_heap_vector(L):
+ """
+ >>> test_iteration_over_heap_vector([1,2])
+ (1, 2)
+ """
+ cdef int i
+ cdef vector[int] *vint = new vector[int]()
+ try:
+ for i in L:
+ vint.push_back(i)
+ return [ i for i in vint ]
+ finally:
+ del vint