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
a28eb1c4
Kaydet (Commit)
a28eb1c4
authored
Nis 04, 2010
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use more specific assert* methods in test_struct.
üst
4edfe963
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
test_struct.py
Lib/test/test_struct.py
+8
-8
No files found.
Lib/test/test_struct.py
Dosyayı görüntüle @
a28eb1c4
...
@@ -170,17 +170,17 @@ class StructTest(unittest.TestCase):
...
@@ -170,17 +170,17 @@ class StructTest(unittest.TestCase):
self
.
assertEqual
(
signed_size
,
unsigned_size
)
self
.
assertEqual
(
signed_size
,
unsigned_size
)
# bounds for native integer sizes
# bounds for native integer sizes
self
.
assert
True
(
struct
.
calcsize
(
'b'
)
==
1
)
self
.
assert
Equal
(
struct
.
calcsize
(
'b'
),
1
)
self
.
assert
True
(
2
<=
struct
.
calcsize
(
'h'
))
self
.
assert
LessEqual
(
2
,
struct
.
calcsize
(
'h'
))
self
.
assert
True
(
4
<=
struct
.
calcsize
(
'l'
))
self
.
assert
LessEqual
(
4
,
struct
.
calcsize
(
'l'
))
self
.
assert
True
(
struct
.
calcsize
(
'h'
)
<=
struct
.
calcsize
(
'i'
))
self
.
assert
LessEqual
(
struct
.
calcsize
(
'h'
),
struct
.
calcsize
(
'i'
))
self
.
assert
True
(
struct
.
calcsize
(
'i'
)
<=
struct
.
calcsize
(
'l'
))
self
.
assert
LessEqual
(
struct
.
calcsize
(
'i'
),
struct
.
calcsize
(
'l'
))
# tests for native 'q' and 'Q' when applicable
# tests for native 'q' and 'Q' when applicable
if
HAVE_LONG_LONG
:
if
HAVE_LONG_LONG
:
self
.
assertEqual
(
struct
.
calcsize
(
'q'
),
struct
.
calcsize
(
'Q'
))
self
.
assertEqual
(
struct
.
calcsize
(
'q'
),
struct
.
calcsize
(
'Q'
))
self
.
assert
True
(
8
<=
struct
.
calcsize
(
'q'
))
self
.
assert
LessEqual
(
8
,
struct
.
calcsize
(
'q'
))
self
.
assert
True
(
struct
.
calcsize
(
'l'
)
<=
struct
.
calcsize
(
'q'
))
self
.
assert
LessEqual
(
struct
.
calcsize
(
'l'
),
struct
.
calcsize
(
'q'
))
def
test_integers
(
self
):
def
test_integers
(
self
):
# Integer tests (bBhHiIlLqQ).
# Integer tests (bBhHiIlLqQ).
...
@@ -218,7 +218,7 @@ class StructTest(unittest.TestCase):
...
@@ -218,7 +218,7 @@ class StructTest(unittest.TestCase):
expected
=
long
(
x
)
expected
=
long
(
x
)
if
self
.
signed
and
x
<
0
:
if
self
.
signed
and
x
<
0
:
expected
+=
1L
<<
self
.
bitsize
expected
+=
1L
<<
self
.
bitsize
self
.
assert
True
(
expected
>=
0
)
self
.
assert
GreaterEqual
(
expected
,
0
)
expected
=
'
%
x'
%
expected
expected
=
'
%
x'
%
expected
if
len
(
expected
)
&
1
:
if
len
(
expected
)
&
1
:
expected
=
"0"
+
expected
expected
=
"0"
+
expected
...
...
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