Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0d8a1fd7
Commit
0d8a1fd7
authored
Jul 12, 2007
by
Thomas Heller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simple fixes.
parent
d68d131d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
Lib/ctypes/test/test_internals.py
Lib/ctypes/test/test_internals.py
+5
-5
Lib/ctypes/test/test_random_things.py
Lib/ctypes/test/test_random_things.py
+2
-2
No files found.
Lib/ctypes/test/test_internals.py
View file @
0d8a1fd7
...
...
@@ -23,16 +23,16 @@ class ObjectsTestCase(unittest.TestCase):
def
test_ints
(
self
):
i
=
42000123
self
.
failUnlessEqual
(
3
,
grc
(
i
)
)
rc
=
grc
(
i
)
ci
=
c_int
(
i
)
self
.
failUnlessEqual
(
3
,
grc
(
i
))
self
.
failUnlessEqual
(
rc
,
grc
(
i
))
self
.
failUnlessEqual
(
ci
.
_objects
,
None
)
def
test_c_char_p
(
self
):
s
=
"Hello, World"
self
.
failUnlessEqual
(
3
,
grc
(
s
)
)
s
=
b
"Hello, World"
rc
=
grc
(
s
)
cs
=
c_char_p
(
s
)
self
.
failUnlessEqual
(
4
,
grc
(
s
))
self
.
failUnlessEqual
(
rc
+
1
,
grc
(
s
))
self
.
failUnlessSame
(
cs
.
_objects
,
s
)
def
test_simple_struct
(
self
):
...
...
Lib/ctypes/test/test_random_things.py
View file @
0d8a1fd7
...
...
@@ -17,7 +17,7 @@ if sys.platform == "win32":
windll
.
kernel32
.
GetProcAddress
.
argtypes
=
c_void_p
,
c_char_p
windll
.
kernel32
.
GetProcAddress
.
restype
=
c_void_p
hdll
=
windll
.
kernel32
.
LoadLibraryA
(
"kernel32"
)
hdll
=
windll
.
kernel32
.
LoadLibraryA
(
b
"kernel32"
)
funcaddr
=
windll
.
kernel32
.
GetProcAddress
(
hdll
,
"GetModuleHandleA"
)
self
.
failUnlessEqual
(
call_function
(
funcaddr
,
(
None
,)),
...
...
@@ -69,7 +69,7 @@ class CallbackTracbackTestCase(unittest.TestCase):
out
=
self
.
capture_stderr
(
cb
,
"spam"
)
self
.
failUnlessEqual
(
out
.
splitlines
()[
-
1
],
"TypeError: "
"unsupported operand type(s) for /: 'int' and 'str'"
)
"unsupported operand type(s) for /: 'int' and 'str
8
'"
)
if
__name__
==
'__main__'
:
unittest
.
main
()
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