Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
c6d0a5c8
Commit
c6d0a5c8
authored
Sep 06, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for code presented in github issue #1857. (Does not test for leaks.)
parent
bf0c9758
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
tests/run/numpy_test.pyx
tests/run/numpy_test.pyx
+20
-0
No files found.
tests/run/numpy_test.pyx
View file @
c6d0a5c8
...
...
@@ -878,4 +878,24 @@ def test_dispatch_ndim(ndim_t array):
"""
print
cython
.
typeof
(
array
),
np
.
asarray
(
array
).
ndim
@
testcase
def
test_copy_buffer
(
np
.
ndarray
[
double
,
ndim
=
1
]
a
):
"""
>>> a = test_copy_buffer(np.ones(10, dtype=np.double))
>>> len(a)
10
>>> print(a.dtype)
float64
>>> a[0]
1.0
"""
a
=
a
.
copy
()
a
=
a
.
copy
()
a
=
a
.
copy
()
a
=
a
.
copy
()
a
=
a
.
copy
()
return
a
include
"numpy_common.pxi"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment