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
c09d2c10
Commit
c09d2c10
authored
May 06, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended test case
parent
f7785cd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
tests/run/pointers.pyx
tests/run/pointers.pyx
+16
-3
No files found.
tests/run/pointers.pyx
View file @
c09d2c10
...
...
@@ -2,6 +2,12 @@
cdef
char
*
c_string
=
b'abcdefg'
cdef
void
*
void_ptr
=
c_string
cdef
int
i
=
42
cdef
int
*
int_ptr
=
&
i
cdef
float
x
=
42.2
cdef
float
*
float_ptr
=
&
x
def
compare
():
"""
>>> compare()
...
...
@@ -10,29 +16,36 @@ def compare():
True
False
False
True
True
"""
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
print
void_ptr
!=
int_ptr
print
void_ptr
!=
float_ptr
def
if_tests
():
"""
>>> if_tests()
True
True
"""
if
c_string
==
void_ptr
:
print
True
if
c_string
!=
void_ptr
:
print
False
if
int_ptr
!=
void_ptr
:
print
True
def
bool_binop
():
"""
>>> bool_binop()
True
"""
if
c_string
==
void_ptr
and
c_string
==
c_string
:
if
c_string
==
void_ptr
and
c_string
==
c_string
and
int_ptr
!=
void_ptr
and
void_ptr
!=
float_ptr
:
print
True
def
bool_binop_truth
(
int
x
):
...
...
@@ -43,7 +56,7 @@ def bool_binop_truth(int x):
>>> bool_binop_truth(0)
True
"""
if
c_string
and
void_ptr
and
c_string
==
c_string
:
if
c_string
and
void_ptr
and
int_ptr
and
(
c_string
==
c_string
or
int_ptr
!=
void_ptr
)
:
print
True
if
c_string
and
x
or
not
void_ptr
or
x
:
if
c_string
and
x
or
not
(
void_ptr
or
int_ptr
and
float_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