summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_struct.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix incorrect stacklevel for DeprecationWarnings originating from the struct ↵Mark Dickinson2010-03-051-36/+15
| | | | | | | module. Also clean up related tests in test_struct. The stacklevel fix should be backported to 2.6 once that branch is unfrozen.
* Remove unused imports in test modules.Georg Brandl2010-02-071-1/+1
|
* Reverting the Revision: 77368. I committed Flox's big patch for tests bySenthil Kumaran2010-01-081-6/+2
| | | | mistake. ( It may come in for sure tough)
* Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. ↵Senthil Kumaran2010-01-081-2/+6
| | | | Patch by flox
* Issue #1523: Remove deprecated overflow masking in struct module, andMark Dickinson2009-07-071-19/+1
| | | | make sure that out-of-range values consistently raise struct.error.
* Expand test coverage for struct.pack with native integer packing;Mark Dickinson2009-07-071-170/+107
| | | | reorganize the test_struct module to remove duplicated code and tests.
* Add skipping to struct test that only applies when overflow masking is in effectMark Dickinson2009-07-071-0/+2
|
* Issues #1530559, #1741130: Fix various inconsistencies in struct.packMark Dickinson2009-07-051-25/+26
| | | | integer packing, and reenable some previously broken tests.
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-2/+2
|
* The unittest.TestCase.assertEqual() now displays the differences in lists,Gregory P. Smith2009-03-311-0/+1
| | | | | | | | | | tuples, dicts and sets on failure. Many new handy type and comparison specific assert* methods have been added that fail with error messages actually useful for debugging. Contributed in by Google and completed with help from mfoord and GvR at PyCon 2009 sprints. Discussion lives in http://bugs.python.org/issue2578.
* #3694: add test for fix committed in r66693.Georg Brandl2009-02-131-0/+4
|
* Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError forMark Dickinson2009-02-101-2/+2
| | | | | | negative arguments. Previously, it raised TypeError. Thanks Lisandro Dalcin.
* #4228: Pack negative values the same way as 2.4Georg Brandl2009-01-011-0/+7
| | | | in struct's L format.
* warnings.catch_warnings() now returns a list or None instead of the customBrett Cannon2008-09-091-2/+2
| | | | | | | | WarningsRecorder object. This makes the API simpler to use as no special object must be learned. Closes issue 3781. Review by Benjamin Peterson.
* Fix bug 3625: test issues on 64bit windows. r=pitrouMark Hammond2008-08-231-1/+1
|
* Make test.test_support.catch_warnings more robust as discussed on ↵Nick Coghlan2008-07-131-7/+4
| | | | python-dev. Also add explicit tests for itto test_warnings.
* silence the test when it is skipped on some platforms. should fix aGregory P. Smith2008-06-141-4/+2
| | | | buildbot.
* Merge in release25-maint r60793:Gregory P. Smith2008-06-111-0/+8
| | | | | | Added checks for integer overflows, contributed by Google. Some are only available if asserts are left in the code, in cases where they can't be triggered from Python code.
* convert test_struct to a unittest thanks to Giampaolo RodolaBenjamin Peterson2008-06-111-624/+524
| | | | | I had to disable one test because it was functioning incorrectly, see #1530559 I also removed the debugging prints
* Issue 705836: Fix struct.pack(">f", 1e40) to behave consistentlyMark Dickinson2008-03-141-1/+1
| | | | | | | | | | across platforms: it should now raise OverflowError on all platforms. (Previously it raised OverflowError only on non IEEE 754 platforms.) Also fix the (already existing) test for this behaviour so that it actually raises TestFailed instead of just referencing it.
* Issue 1872: Changed the struct module typecode from 't' to '?', forThomas Heller2008-03-051-14/+14
| | | | compatibility with PEP3118.
* Remove test.test_support.guard_warnings_filter.Brett Cannon2007-08-141-1/+1
| | | | | | | | test.test_support.catch_warning is more full-featured and provides the same functionality. Since guard_warnings_filter was added in 2.6 there is no backwards-compatibility issues.
* Bug #1563759: struct.unpack doens't support buffer protocol objectsRaymond Hettinger2007-04-051-0/+8
|
* Whitespace normalization.Tim Peters2007-01-301-49/+49
|
* Patch #1610575: Add support for _Bool to struct.Martin v. Löwis2007-01-211-7/+61
|
* Add test.test_support.guard_warnings_filter . This function returns a contextBrett Cannon2006-12-131-15/+10
| | | | | manager that protects warnings.filter from being modified once the context is exited.
* Fix #1530559, struct.pack raises TypeError where it used to convert.Bob Ippolito2006-08-041-26/+69
| | | | | Passing float arguments to struct.pack when integers are expected now triggers a DeprecationWarning.
* Access _struct attributes directly instead of mucking with getattr.Tim Peters2006-06-051-20/+18
| | | | | | | | | | string_reverse(): Simplify. assertRaises(): Raise TestFailed on failure. test_unpack_from(), test_pack_into(), test_pack_into_fn(): never use `assert` to test for an expected result (it doesn't test anything when Python is run with -O).
* Fixes in struct and socket from merge reviews.Martin Blais2006-06-041-13/+13
| | | | | | | | | | | | | - Following Guido's comments, renamed * pack_to -> pack_into * recv_buf -> recv_into * recvfrom_buf -> recvfrom_into - Made fixes to _struct.c according to Neal Norwitz comments on the checkins list. - Converted some ints into the appropriate -- I hope -- ssize_t and size_t.
* Whitespace normalization.Tim Peters2006-06-041-2/+1
|
* Fixed struct test to not use unittest.Martin Blais2006-06-021-78/+84
|
* On 64-bit platforms running test_struct after test_tarfile would failNeal Norwitz2006-05-311-0/+6
| | | | since the deprecation warning wouldn't be raised.
* Change wrapping terminology to overflow maskingBob Ippolito2006-05-301-3/+3
|
* deprecated_err(): Stop bizarre warning messages when the testsTim Peters2006-05-301-2/+6
| | | | | | | | | | | are run in the order: test_genexps (or any other doctest-based test) test_struct test_doctest The `warnings` module needs an advertised way to save/restore its internal filter list.
* struct: modulo math plus warning on all endian-explicit formats for ↵Bob Ippolito2006-05-291-11/+36
| | | | compatibility with older struct usage (ugly)
* Fix up struct docstrings, add struct.pack_to function for symmetryBob Ippolito2006-05-271-0/+22
|
* enable all of the struct tests, use ssize_t, fix some whitespaceBob Ippolito2006-05-261-1/+1
|
* fix #1229380 No struct.pack exception for some out of range integersBob Ippolito2006-05-261-3/+5
|
* Whitespace normalization.Tim Peters2006-05-261-2/+1
|
* Support for buffer protocol for socket and struct.Martin Blais2006-05-261-25/+60
| | | | | | | | | | * Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer protocol (send and sendto already did). * Added struct.pack_to(), that is the corresponding buffer compatible method to unpack_from(). * Fixed minor typos in arraymodule.
* refactor unpack, add unpack_fromBob Ippolito2006-05-241-0/+41
|
* Patch #1011240: SystemError generated by struct.pack('P', 'foo').Armin Rigo2004-09-271-0/+1
|
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-121-9/+9
| | | | From SF patch #852334.
* SF bug 705836: struct.pack of floats in non-native endian orderTim Peters2003-03-201-0/+46
| | | | | | | | | | | | | | pack_float, pack_double, save_float: All the routines for creating IEEE-format packed representations of floats and doubles simply ignored that rounding can (in rare cases) propagate out of a long string of 1 bits. At worst, the end-off carry can (by mistake) interfere with the exponent value, and then unpacking yields a result wrong by a factor of 2. In less severe cases, it can end up losing more low-order bits than intended, or fail to catch overflow *caused* by rounding. Bugfix candidate, but I already backported this to 2.2. In 2.3, this code remains in severe need of refactoring.
* Get rid of many apply() calls.Guido van Rossum2003-02-271-5/+2
|
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* The 'p' (Pascal string) pack code acts unreasonably when the string sizeTim Peters2001-09-151-0/+25
| | | | | and count exceed 255. Changed to preserve as much of the string as possible (instead of count%256 characters).
* Added "i" and "l" to the list of std-mode struct codes that don't range-Tim Peters2001-06-181-1/+4
| | | | | check correctly on pack(). While these were checking OK on my 32-bit box, Mark Favas reported failures on a 64-bit box (alas, easy to believe).
* Generalize the new qQ std-mode tests to all int codes (bBhHiIlLqQ).Tim Peters2001-06-131-158/+202
| | | | | | | | Unfortunately, the std-mode bBhHIL codes don't do any range-checking; if and when some of those get fixed, remove their letters from the IntTester.BUGGY_RANGE_CHECK string. In the meantime, a msg saying that range-tests are getting skipped is printed to stdout whenever one is skipped.
* The new {b,l}p_{u,}longlong() didn't check get_pylong()'s return for NULL.Tim Peters2001-06-131-0/+6
| | | | Repaired that, and added appropriate tests for it to test_struct.py.