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
c533edce
Kaydet (Commit)
c533edce
authored
Haz 10, 2001
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Renamed some stuff to tell the truth about what it does.
üst
7b9542a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
test_struct.py
Lib/test/test_struct.py
+4
-4
No files found.
Lib/test/test_struct.py
Dosyayı görüntüle @
c533edce
...
...
@@ -128,7 +128,7 @@ simple_err(struct.pack, "Q", -1) # can't pack -1 as unsigned regardless
simple_err
(
struct
.
pack
,
"q"
,
"a"
)
# can't pack string as 'q' regardless
simple_err
(
struct
.
pack
,
"Q"
,
"a"
)
# ditto, but 'Q'
def
force_bigendian
(
value
):
def
bigendian_to_native
(
value
):
if
isbigendian
:
return
value
chars
=
list
(
value
)
...
...
@@ -148,10 +148,10 @@ if has_native_qQ:
(
'Q'
,
(
1L
<<
(
8
*
bytes
))
-
1
,
'
\xff
'
*
bytes
),
(
'q'
,
(
1L
<<
(
8
*
bytes
-
1
))
-
1
,
'
\x7f
'
+
'
\xff
'
*
(
bytes
-
1
))):
got
=
struct
.
pack
(
format
,
input
)
bigexpected
=
force_bigendian
(
expected
)
verify
(
got
==
big
expected
,
native_expected
=
bigendian_to_native
(
expected
)
verify
(
got
==
native_
expected
,
"
%
r-pack of
%
r gave
%
r, not
%
r"
%
(
format
,
input
,
got
,
big
expected
))
(
format
,
input
,
got
,
native_
expected
))
retrieved
=
struct
.
unpack
(
format
,
got
)[
0
]
verify
(
retrieved
==
input
,
"
%
r-unpack of
%
r gave
%
r, not
%
r"
%
...
...
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