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
ea3f305a
Kaydet (Commit)
ea3f305a
authored
Eki 02, 2010
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Oops, revert unwanted _testcapi changes of r85174
üst
749261e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
test_unicode.py
Lib/test/test_unicode.py
+11
-11
_testcapimodule.c
Modules/_testcapimodule.c
+4
-4
No files found.
Lib/test/test_unicode.py
Dosyayı görüntüle @
ea3f305a
...
...
@@ -1396,26 +1396,26 @@ class UnicodeTest(string_tests.CommonTest,
# Test PyUnicode_AsWideChar()
def
test_aswidechar
(
self
):
from
_testcapi
import
unicode
_aswidechar
from
_testcapi
import
test
_aswidechar
from
ctypes
import
c_wchar
,
sizeof
wchar
,
size
=
unicode
_aswidechar
(
'abcdef'
,
2
)
wchar
,
size
=
test
_aswidechar
(
'abcdef'
,
2
)
self
.
assertEquals
(
size
,
2
)
self
.
assertEquals
(
wchar
,
'ab'
)
wchar
,
size
=
unicode
_aswidechar
(
'abc'
,
3
)
wchar
,
size
=
test
_aswidechar
(
'abc'
,
3
)
self
.
assertEquals
(
size
,
3
)
self
.
assertEquals
(
wchar
,
'abc'
)
wchar
,
size
=
unicode
_aswidechar
(
'abc'
,
4
)
wchar
,
size
=
test
_aswidechar
(
'abc'
,
4
)
self
.
assertEquals
(
size
,
3
)
self
.
assertEquals
(
wchar
,
'abc
\0
'
)
wchar
,
size
=
unicode
_aswidechar
(
'abc'
,
10
)
wchar
,
size
=
test
_aswidechar
(
'abc'
,
10
)
self
.
assertEquals
(
size
,
3
)
self
.
assertEquals
(
wchar
,
'abc
\0
'
)
wchar
,
size
=
unicode
_aswidechar
(
'abc
\0
def'
,
20
)
wchar
,
size
=
test
_aswidechar
(
'abc
\0
def'
,
20
)
self
.
assertEquals
(
size
,
7
)
self
.
assertEquals
(
wchar
,
'abc
\0
def
\0
'
)
...
...
@@ -1426,20 +1426,20 @@ class UnicodeTest(string_tests.CommonTest,
else
:
# sizeof(c_wchar) == 4
buflen
=
2
nchar
=
1
wchar
,
size
=
unicode
_aswidechar
(
nonbmp
,
buflen
)
wchar
,
size
=
test
_aswidechar
(
nonbmp
,
buflen
)
self
.
assertEquals
(
size
,
nchar
)
self
.
assertEquals
(
wchar
,
nonbmp
+
'
\0
'
)
# Test PyUnicode_AsWideCharString()
def
test_aswidecharstring
(
self
):
from
_testcapi
import
unicode
_aswidecharstring
from
_testcapi
import
test
_aswidecharstring
from
ctypes
import
c_wchar
,
sizeof
wchar
,
size
=
unicode
_aswidecharstring
(
'abc'
)
wchar
,
size
=
test
_aswidecharstring
(
'abc'
)
self
.
assertEquals
(
size
,
3
)
self
.
assertEquals
(
wchar
,
'abc
\0
'
)
wchar
,
size
=
unicode
_aswidecharstring
(
'abc
\0
def'
)
wchar
,
size
=
test
_aswidecharstring
(
'abc
\0
def'
)
self
.
assertEquals
(
size
,
7
)
self
.
assertEquals
(
wchar
,
'abc
\0
def
\0
'
)
...
...
@@ -1448,7 +1448,7 @@ class UnicodeTest(string_tests.CommonTest,
nchar
=
2
else
:
# sizeof(c_wchar) == 4
nchar
=
1
wchar
,
size
=
unicode
_aswidecharstring
(
nonbmp
)
wchar
,
size
=
test
_aswidecharstring
(
nonbmp
)
self
.
assertEquals
(
size
,
nchar
)
self
.
assertEquals
(
wchar
,
nonbmp
+
'
\0
'
)
...
...
Modules/_testcapimodule.c
Dosyayı görüntüle @
ea3f305a
...
...
@@ -1386,7 +1386,7 @@ test_widechar(PyObject *self)
}
static
PyObject
*
unicode
_aswidechar
(
PyObject
*
self
,
PyObject
*
args
)
test
_aswidechar
(
PyObject
*
self
,
PyObject
*
args
)
{
PyObject
*
unicode
,
*
result
;
Py_ssize_t
buflen
,
size
;
...
...
@@ -1417,7 +1417,7 @@ unicode_aswidechar(PyObject *self, PyObject *args)
}
static
PyObject
*
unicode
_aswidecharstring
(
PyObject
*
self
,
PyObject
*
args
)
test
_aswidecharstring
(
PyObject
*
self
,
PyObject
*
args
)
{
PyObject
*
unicode
,
*
result
;
Py_ssize_t
size
;
...
...
@@ -2321,8 +2321,8 @@ static PyMethodDef TestMethods[] = {
{
"test_u_code"
,
(
PyCFunction
)
test_u_code
,
METH_NOARGS
},
{
"test_Z_code"
,
(
PyCFunction
)
test_Z_code
,
METH_NOARGS
},
{
"test_widechar"
,
(
PyCFunction
)
test_widechar
,
METH_NOARGS
},
{
"
unicode_aswidechar"
,
unicode
_aswidechar
,
METH_VARARGS
},
{
"
unicode_aswidecharstring"
,
unicode
_aswidecharstring
,
METH_VARARGS
},
{
"
test_aswidechar"
,
test
_aswidechar
,
METH_VARARGS
},
{
"
test_aswidecharstring"
,
test
_aswidecharstring
,
METH_VARARGS
},
#ifdef WITH_THREAD
{
"_test_thread_state"
,
test_thread_state
,
METH_VARARGS
},
{
"_pending_threadfunc"
,
pending_threadfunc
,
METH_VARARGS
},
...
...
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