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
c533edce
Commit
c533edce
authored
Jun 10, 2001
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed some stuff to tell the truth about what it does.
parent
7b9542a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Lib/test/test_struct.py
Lib/test/test_struct.py
+4
-4
No files found.
Lib/test/test_struct.py
View file @
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