An error occurred fetching the project authors.
  1. 29 Jun, 2004 1 commit
  2. 07 Jun, 2004 1 commit
  3. 02 Jun, 2004 1 commit
  4. 31 May, 2004 2 commits
    • Tim Peters's avatar
      testItemsNegativeIndex (3 instances): repaired off-by-one glitch in loop... · 23e7bd75
      Tim Peters authored
      testItemsNegativeIndex (3 instances):  repaired off-by-one glitch in loop (range(i, j, k) is always exclusive of j).
      23e7bd75
    • Casey Duncan's avatar
      Fix bug indexing BTreeItems with negative values. Previous code assumed that... · 47fb1d59
      Casey Duncan authored
      Fix bug indexing BTreeItems with negative values. Previous code assumed that idexes passed to BTreeItem_item would be negative, in practice this was not the case, and an index of -1 actually passed len(items)-1 as the index argument. Consequently, it was possible to access each item using two negative indexes (i.e., -1 and -len(items)-1). This made each item appear twice in a reverse iteration.
      
      Code in BTreeItems_seek attempted to match the sign of the pseudoindex kept in the BTreeItems obj and the incoming index. Since this incoming index was never legitimately negative as it assumed, actually negatives passed in due to "overshooting" the first item would repeat the items again from the end. Removal of this code corrects the problem.
      
      Unittests which provoke the error in the original code have also been added.
      
      47fb1d59
  5. 16 Apr, 2004 1 commit
  6. 28 Nov, 2003 1 commit
  7. 18 Nov, 2003 1 commit
  8. 02 Oct, 2003 1 commit
  9. 23 Apr, 2003 1 commit
  10. 31 Jan, 2003 1 commit
  11. 14 Jan, 2003 1 commit
    • Tim Peters's avatar
      New btrees module check.py (and test program). The primary new function · 6f1a3364
      Tim Peters authored
      is check.check(btree), which performs value-based sanity checks on a
      BTree (or TreeSet) that the btree._check() method doesn't do.  The new
      checks include that all the bucket keys are in sorted order, and that
      all the keys within each bucket, and within each internal BTree node,
      lie within the range necessary for that node.  That last is a subtle
      invariant that can't be checked locally:  it requires propagating range
      info down the tree, and modifying it for each child and each level.
      This *should* catch any BTree B for which iterating over the keys yields
      a key K for which B.has_key(K) returns false.
      
      Another function check.display(btree) prints the internal structure of
      a BTree (or TreeSet, Bucket, or Set) to stdout.  If check.check(B) ever
      complains, a clearer picture of the damage can be gotten by staring at
      check.display(B)'s output.
      
      Also beefed up the regular BTree tests by calling check.check() in key
      places.  No surprises (the tests still pass).
      6f1a3364
  12. 27 Aug, 2002 1 commit
  13. 14 Aug, 2002 1 commit
  14. 08 Aug, 2002 1 commit
    • Jeremy Hylton's avatar
      Refactor test cleanup to use removefs() helper function. · ea50891b
      Jeremy Hylton authored
      StorageTestBase.removefs() will attempt to remove files with all the
      possible extensions that FileStorage will create.  It will raise
      os.error for any error except ENOENT.
      
      Remove many variants of removefs() implemented in the various test
      suites.
      ea50891b
  15. 28 Jun, 2002 1 commit
  16. 19 Jun, 2002 1 commit
  17. 17 Jun, 2002 1 commit
  18. 14 Jun, 2002 1 commit
  19. 13 Jun, 2002 7 commits
    • Tim Peters's avatar
      BTree_rangeSearch(): Repaired more cases where a should-be empty range · 78d794e2
      Tim Peters authored
      search returned a seemingly random slice of the tree.  A new test on the
      painfully constructed highly-degenerate BTree turned up lots of these.
      It turns out that BTree_rangeSearch had a much harder job than it
      thought it had <0.7 wink>.
      78d794e2
    • Tim Peters's avatar
      BTree_rangeSearch(): Like its bucket counterpart, this wasn't checking · cca859ed
      Tim Peters authored
      for lo > hi either, except if they happened to be in the same bucket.  All
      sorts of strange results followed (the range should be empty if lo > hi,
      and is after this patch).
      cca859ed
    • Tim Peters's avatar
      Bucket_rangeSearch(): If the min key passed in was larger than the max key · c600f339
      Tim Peters authored
      passed in, it was quite possible for this to return *low > *high, and the
      caller could crash due to trying to create a list with "negative length".
      Changed the routine to consider a range empty if min>max on input, and added
      test cases that fail before this patch.
      c600f339
    • Tim Peters's avatar
      Repaired comments. · 582c9917
      Tim Peters authored
      582c9917
    • Tim Peters's avatar
      New method _build_degenerate_tree() builds a horridly degenerate (but · be7deebb
      Tim Peters authored
      legitimate) BTree.  New test testDegenerateBasicOps() does basic sanity
      checks on it.  More tests against this tree will follow.
      be7deebb
    • Tim Peters's avatar
      test_suite(): Yikes! Typos in this function caused us to skip some test · e97aeb86
      Tim Peters authored
      classes entirely (like for IITreeSets), and to run other test classes
      twice.
      e97aeb86
    • Tim Peters's avatar
      BTree_findRangeEnd(): Fixed "the range search bug": if the smallest · 48152bf0
      Tim Peters authored
      key S in a bucket in a BTree is deleted, doing a range search on the
      BTree with S on the high end may claim that the range is empty even when
      it's not.  It proved difficult to fix this correctly and efficiently in
      all cases (our BTrees don't like "searching backwards").  The
      implementation here is a new and non-recursive one (in effect, to do
      this efficiently you have to remember the deepest point in the tree where
      it was *possible* to "go one left" of where binary search tells you to go;
      an iterative algorithm makes that part all but obvious).  Alas, the
      number of uses of persistence macros is amazing, unfortunately making
      this still-hairy algorithm hard to follow.
      
      testPathologicalRangeSearch():  uncommented the lines that failed
      before this patch.  They pass now.
      
      Insecurity:  The test case only exercises the simplest possible form
      of the failure.  Any failing case is hard to provoke, even the simplest.
      The hairier failing cases require generating degenerate trees, deep
      and with some interior nodes near the top having just one or two children
      (since the tree needs to be deep too, that isn't easy to provoke).  I'll
      think about how to provoke this without needing to build up multi-million
      element trees first; maybe using __setstate__ directly is the answer.
      48152bf0
  20. 12 Jun, 2002 1 commit
    • Tim Peters's avatar
      New testPathologicalRangeSearch(). The nasty part of this test is · 4a27c9a0
      Tim Peters authored
      commented out for now, because it fails.  I'm working on a fix.  The
      problem was found by eyeballing the range-test implementation.  If you
      delete a key from a BTree that just happens to be the first key in a
      bucket, then a later high-end range search giving that specific key as
      the endpoint claims that no keys are in the range, and whether or not
      that's actually true.
      4a27c9a0
  21. 09 Jun, 2002 2 commits
    • Tim Peters's avatar
      Fix for http://collector.zope.org/Zope/419, · ac7d6949
      Tim Peters authored
      "BTreeItems slice contains 1 too many elements"
      This also fixes many related glitches, such as that giving an
      out-of-bound slice index raised IndexError instead of clipping.
      
      BTreeItems_slice():  Emulate Python slicing semantics in all cases.
      
      testBTrees.py:  new testSlicing() tests in MappingBase and NormalSetTests
      to ensure that slicing of .keys()/.items()/.values() works exactly the
      same way as slicing of Python lists, in all one-sided, two-sided and
      whole-structure ([:]) cases, with both negative and positive slice indices,
      and mixtures of + and -, and whether in bounds or out of bounds.
      ac7d6949
    • Tim Peters's avatar
      Trimmed trailing whitespace. · 1fe4df52
      Tim Peters authored
      1fe4df52
  22. 31 May, 2002 1 commit
  23. 30 May, 2002 2 commits
  24. 28 May, 2002 1 commit
  25. 11 Feb, 2002 1 commit
  26. 25 Jan, 2002 1 commit
    • Guido van Rossum's avatar
      Fix a problem I saw when some tests here failed: there's a pattern in · 8fdd9369
      Guido van Rossum authored
      the code
      
          try:
              root = self._getRoot()
              ...
          except:
              self._closeDB(root)
      	self._delDB()
      	raise
      
      which fails with an UnboundLocalError if the first line in the try
      clause fails.  Fixed this by setting 'root = None' before each such
      try clause, and adding a None check to _closeDB().  Also removed a
      useless 'root = None' from the body of _closeDB().
      
      Barry: I saw this in the saz 1.0c1 release.  Is it worth backporting?
      Probably not given that we're not going to do a merge pre-1.0.
      8fdd9369
  27. 21 Dec, 2001 1 commit
  28. 20 Dec, 2001 1 commit
  29. 28 Nov, 2001 1 commit
  30. 19 Oct, 2001 1 commit
  31. 20 Sep, 2001 1 commit