[Python-checkins] python/dist/src/Lib/test test_deque.py,1.15,1.16

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Fri Oct 1 04:01:08 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18895/Lib/test

Modified Files:
	test_deque.py 
Log Message:
deque_traverse():  If the deque had one block, and its rightindex was
BLOCKLEN-1, this assert-failed in a debug build, or went wild with a
NULL pointer in a release build.  Reported on c.l.py by Stefan Behnel.


Index: test_deque.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_deque.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- test_deque.py	27 Sep 2004 15:29:04 -0000	1.15
+++ test_deque.py	1 Oct 2004 02:01:03 -0000	1.16
@@ -324,6 +324,15 @@
         for s in ('abcd', xrange(2000)):
             self.assertEqual(list(reversed(deque(s))), list(reversed(s)))
 
+    def test_gc_doesnt_blowup(self):
+        import gc
+        # This used to assert-fail in deque_traverse() under a debug
+        # build, or run wild with a NULL pointer in a release build.
+        d = deque()
+        for i in xrange(100):
+            d.append(1)
+            gc.collect()
+
 def R(seqn):
     'Regular generator'
     for i in seqn:



More information about the Python-checkins mailing list