Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e7becc50
Kaydet (Commit)
e7becc50
authored
Eki 24, 2007
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added unittest for calling a function with paramflags (backport from py3k branch).
üst
f5ade63e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
test_prototypes.py
Lib/ctypes/test/test_prototypes.py
+18
-0
No files found.
Lib/ctypes/test/test_prototypes.py
Dosyayı görüntüle @
e7becc50
...
@@ -48,6 +48,24 @@ class CharPointersTestCase(unittest.TestCase):
...
@@ -48,6 +48,24 @@ class CharPointersTestCase(unittest.TestCase):
func
.
restype
=
c_long
func
.
restype
=
c_long
func
.
argtypes
=
None
func
.
argtypes
=
None
def
test_paramflags
(
self
):
# function returns c_void_p result,
# and has a required parameter named 'input'
prototype
=
CFUNCTYPE
(
c_void_p
,
c_void_p
)
func
=
prototype
((
"_testfunc_p_p"
,
testdll
),
((
1
,
"input"
),))
try
:
func
()
except
TypeError
as
details
:
self
.
failUnlessEqual
(
str
(
details
),
"required argument 'input' missing"
)
else
:
self
.
fail
(
"TypeError not raised"
)
self
.
failUnlessEqual
(
func
(
None
),
None
)
self
.
failUnlessEqual
(
func
(
input
=
None
),
None
)
def
test_int_pointer_arg
(
self
):
def
test_int_pointer_arg
(
self
):
func
=
testdll
.
_testfunc_p_p
func
=
testdll
.
_testfunc_p_p
func
.
restype
=
c_long
func
.
restype
=
c_long
...
...
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