~ubuntu-branches/ubuntu/oneiric/python2.5/oneiric

« back to all changes in this revision

Viewing changes to Lib/test/test_struct.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-12-21 08:57:49 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20081221085749-bijjr25h8na5jdsu
Tags: 2.5.3-0ubuntu1
* New upstream version.
* Regenerate the included documentation.
* Add an option --install-layout=deb, which is ignored for 2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import struct
4
4
import array
5
5
import warnings
 
6
warnings.filterwarnings("ignore", "struct integer overflow masking is deprecated",
 
7
                        DeprecationWarning)
6
8
 
7
9
import sys
8
10
ISBIGENDIAN = sys.byteorder == "big"
535
537
 
536
538
test_1530559()
537
539
 
 
540
## Issue 4228. Packing a negative unsigned long warns,
 
541
# but then still should give a value with the
 
542
# topmost bit set.
 
543
 
 
544
def test_issue4228():
 
545
    # Packing a long may yield either 32 or 64 bits
 
546
    x = struct.pack('L', -1)[:4]
 
547
    vereq(x, '\xff'*4)
 
548
 
 
549
test_issue4228()
 
550
 
538
551
###########################################################################
539
552
# Packing and unpacking to/from buffers.
540
553