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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
f7785cd4
Commit
f7785cd4
authored
May 05, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new test for pointer operations
parent
1e535b45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
tests/run/pointers.pyx
tests/run/pointers.pyx
+49
-0
No files found.
tests/run/pointers.pyx
0 → 100644
View file @
f7785cd4
cdef
char
*
c_string
=
b'abcdefg'
cdef
void
*
void_ptr
=
c_string
def
compare
():
"""
>>> compare()
True
True
True
False
False
"""
print
c_string
==
c_string
print
c_string
==
void_ptr
print
c_string
is
void_ptr
print
c_string
!=
void_ptr
print
c_string
is
not
void_ptr
def
if_tests
():
"""
>>> if_tests()
True
"""
if
c_string
==
void_ptr
:
print
True
if
c_string
!=
void_ptr
:
print
False
def
bool_binop
():
"""
>>> bool_binop()
True
"""
if
c_string
==
void_ptr
and
c_string
==
c_string
:
print
True
def
bool_binop_truth
(
int
x
):
"""
>>> bool_binop_truth(1)
True
True
>>> bool_binop_truth(0)
True
"""
if
c_string
and
void_ptr
and
c_string
==
c_string
:
print
True
if
c_string
and
x
or
not
void_ptr
or
x
:
print
True
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