[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/intid/tests.py - fix
for the test for the last intid patch to work on machines
where btrees can handle 2**31$
Christian Theune
cvs-admin at zope.org
Sat Jun 17 01:44:36 EDT 2006
Log message for revision 68705:
- fix for the test for the last intid patch to work on machines where btrees can handle 2**31$
Changed:
U Zope3/trunk/src/zope/app/intid/tests.py
-=-
Modified: Zope3/trunk/src/zope/app/intid/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/intid/tests.py 2006-06-17 05:44:31 UTC (rev 68704)
+++ Zope3/trunk/src/zope/app/intid/tests.py 2006-06-17 05:44:35 UTC (rev 68705)
@@ -117,20 +117,34 @@
u.__randint__ = fake_randint
+ # Check whether something in the area of 2**31 is accepted by the btree
+ try:
+ u.refs[2**31] = True
+ btree_accepts_long = True
+ except TypeError:
+ btree_accepts_long = False
+
# One int that is too large
uid1 = u._generateId()
- self.assertEquals(20, uid1)
+ if btree_accepts_long:
+ self.assertEquals(2**31, uid1)
+ else:
+ self.assertEquals(20, uid1)
# Two ints that are too large
u._v_nextid = None
uid2 = u._generateId()
- self.assertEquals(10, uid2)
+ if btree_accepts_long:
+ self.assertEquals(20, uid2)
+ else:
+ self.assertEquals(10, uid2)
def test_len_items(self):
u = IntIds()
obj = P()
obj._p_jar = ConnectionStub()
+
self.assertEquals(len(u), 0)
self.assertEquals(u.items(), [])
self.assertEquals(list(u), [])
More information about the Zope3-Checkins
mailing list