Commit 04d9b464 authored by Tim Peters's avatar Tim Peters

checkExtendedIteration(): On Windows revids are often consecutive

integers, due to MS's slothful 18.2Hz updating of time.time().  The test
implicitly assumed in one spot that "the midpoint" between two revids was
strictly larger than the smaller one, but that wasn't true on Windows.
Adjusted the computation (as suggested by Guido) so that "strictly larger"
holds in the end even when the inputs are adjacent integers.
parent 2577e9ff
......@@ -129,8 +129,12 @@ class ExtendedIteratorStorage(IteratorCompare):
revid3a = p64((U64(revid3) + U64(revid4)) / 2)
txniter = self._storage.iterator(revid2, revid3a)
self.iter_verify(txniter, [revid2, revid3], 12)
# Specify a lower bound somewhere in between values
revid1a = p64((U64(revid1) + U64(revid2)) / 2)
# Specify a lower bound somewhere in between values.
# revid2 == revid1+1 is very likely on Windows. Adding 1 before
# dividing ensures that "the midpoint" we compute is strictly larger
# than revid1.
revid1a = p64((U64(revid1) + 1 + U64(revid2)) / 2)
assert revid1 < revid1a
txniter = self._storage.iterator(revid1a, revid3a)
self.iter_verify(txniter, [revid2, revid3], 12)
# Specify an empty range
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment