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
05cbb319
Commit
05cbb319
authored
Sep 20, 2016
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for typedef cpp strings.
parent
d1be46e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
tests/run/cpp_custom_string.srctree
tests/run/cpp_custom_string.srctree
+10
-1
No files found.
tests/run/cpp_custom_string.srctree
View file @
05cbb319
...
...
@@ -36,6 +36,8 @@ class MyString2 : public MyString {
MyString2(const char* data, size_t size) : MyString(data, size) { }
};
typedef MyString MyTypedefString;
######## a.pyx ########
# distutils: language = c++
...
...
@@ -44,19 +46,26 @@ cdef extern from "my_string.cpp":
cdef cppclass MyString:
pass
cdef extern from "my_string.cpp":
cdef cppclass MyString2:
pass
ctypedef MyString2 MyTypedefString # really a MyString
def do_convert(MyString value):
return value
def do_convert2(MyString2 value):
return value
def do_convert_typedef(MyTypedefString value):
return value
def test_convert():
assert do_convert(b"abc") == b"abc"
assert do_convert(b"ab\0c") == b"ab\0c"
assert do_convert2(b"abc") == b"abc"
assert do_convert2(b"ab\0c") == b"ab\0c"
assert do_convert_typedef(b"abc") == "abc"
assert do_convert_typedef(b"ab\0c") == b"ab\0c"
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