[Python-checkins] python/dist/src/Lib/bsddb/test test_recno.py, 1.6, 1.6.12.1

greg at users.sourceforge.net greg at users.sourceforge.net
Mon Dec 20 00:59:54 CET 2004


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

Modified Files:
      Tag: release23-maint
	test_recno.py 
Log Message:
* closes SF bug/patch 967763
  - fixes various memory leaks found by valgrind and a follup closer
    code inspection of the bsddb module.  (merges r1.32 of _bsddb.c
    and an associated test case)
  - also merges the one line r1.37 _bsddb.c fix that fixes a leak on
    the rare DBEnv creation failed error path.


Index: test_recno.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/test/test_recno.py,v
retrieving revision 1.6
retrieving revision 1.6.12.1
diff -u -d -r1.6 -r1.6.12.1
--- test_recno.py	28 Jan 2003 17:20:44 -0000	1.6
+++ test_recno.py	19 Dec 2004 23:59:51 -0000	1.6.12.1
@@ -133,6 +133,15 @@
         if verbose:
             print rec
 
+        # test that non-existant key lookups work (and that
+        # DBC_set_range doesn't have a memleak under valgrind)
+        old_grn = d.set_get_returns_none(2)
+        rec = c.set_range(999999)
+        assert rec == None
+        if verbose:
+            print rec
+        d.set_get_returns_none(old_grn)
+
         c.close()
         d.close()
 
@@ -177,6 +186,8 @@
         """
         source = os.path.join(os.path.dirname(sys.argv[0]),
                               'db_home/test_recno.txt')
+        if not os.path.isdir('db_home'):
+            os.mkdir('db_home')
         f = open(source, 'w') # create the file
         f.close()
 



More information about the Python-checkins mailing list