Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZODB
Commits
4f378e5c
Commit
4f378e5c
authored
Aug 28, 2009
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed to use dictionary keys consistently.
Fixed to use a separate Random instance.
parent
9f3652c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
27 deletions
+26
-27
src/BTrees/tests/testBTrees.py
src/BTrees/tests/testBTrees.py
+26
-27
No files found.
src/BTrees/tests/testBTrees.py
View file @
4f378e5c
...
...
@@ -1618,7 +1618,7 @@ class BugFixes(TestCase):
t
=
OOBTree
()
random
.
seed
(
'OOBTree'
)
trandom
=
random
.
Random
(
'OOBTree'
)
global
LP294788_ids
...
...
@@ -1626,22 +1626,22 @@ class BugFixes(TestCase):
LP294788_ids
=
{}
ids
=
{}
for
i
in
xrange
(
1024
):
if
random
.
random
()
>
0.1
:
if
t
random
.
random
()
>
0.1
:
#add
id
=
None
while
id
is
None
or
id
in
ids
:
id
=
random
.
randint
(
0
,
1000000
)
id
=
t
random
.
randint
(
0
,
1000000
)
ids
[
id
]
=
1
t
[
id
]
=
ToBeDeleted
(
id
)
else
:
#del
id
=
random
.
choice
(
ids
.
keys
())
id
=
t
random
.
choice
(
ids
.
keys
())
del
t
[
id
]
del
ids
[
id
]
ids
=
ids
.
keys
()
random
.
shuffle
(
ids
)
t
random
.
shuffle
(
ids
)
for
id
in
ids
:
del
t
[
id
]
ids
=
None
...
...
@@ -1659,22 +1659,22 @@ class BugFixes(TestCase):
LP294788_ids
=
{}
ids
=
{}
for
i
in
xrange
(
1024
):
if
random
.
random
()
>
0.1
:
if
t
random
.
random
()
>
0.1
:
#add
id
=
None
while
id
is
None
or
id
in
ids
:
id
=
random
.
randint
(
0
,
1000000
)
id
=
t
random
.
randint
(
0
,
1000000
)
ids
[
id
]
=
1
t
[
id
]
=
(
id
,
ToBeDeleted
(
id
),
u'somename'
)
else
:
#del
id
=
random
.
choice
(
ids
.
keys
())
id
=
t
random
.
choice
(
ids
.
keys
())
del
t
[
id
]
del
ids
[
id
]
ids
=
ids
.
keys
()
random
.
shuffle
(
ids
)
t
random
.
shuffle
(
ids
)
for
id
in
ids
:
del
t
[
id
]
ids
=
None
...
...
@@ -1694,23 +1694,22 @@ class BugFixes(TestCase):
LP294788_ids
=
{}
ids
=
{}
for
i
in
xrange
(
1024
):
if
random
.
random
()
>
0.1
:
if
t
random
.
random
()
>
0.1
:
#add
id
=
None
while
id
is
None
or
id
in
ids
:
id
=
random
.
randint
(
0
,
1000000
)
id
=
ToBeDeleted
(
trandom
.
randint
(
0
,
1000000
)
)
obj
=
ToBeDeleted
(
id
)
ids
[
obj
]
=
1
t
[
obj
]
=
1
ids
[
id
]
=
1
t
[
id
]
=
1
else
:
#del
obj
=
random
.
choice
(
ids
.
keys
())
del
ids
[
obj
]
del
t
[
obj
]
id
=
t
random
.
choice
(
ids
.
keys
())
del
ids
[
id
]
del
t
[
id
]
ids
=
ids
.
keys
()
random
.
shuffle
(
ids
)
t
random
.
shuffle
(
ids
)
for
id
in
ids
:
del
t
[
id
]
#release all refs
...
...
@@ -1729,23 +1728,23 @@ class BugFixes(TestCase):
LP294788_ids
=
{}
ids
=
{}
for
i
in
xrange
(
1024
):
if
random
.
random
()
>
0.1
:
if
t
random
.
random
()
>
0.1
:
#add
id
=
None
while
id
is
None
or
id
in
ids
:
id
=
random
.
randint
(
0
,
1000000
)
id
=
trandom
.
randint
(
0
,
1000000
)
id
=
(
id
,
ToBeDeleted
(
id
),
u'somename'
)
key
=
(
id
,
ToBeDeleted
(
id
),
u'somename'
)
ids
[
key
]
=
1
t
[
key
]
=
1
ids
[
id
]
=
1
t
[
id
]
=
1
else
:
#del
key
=
random
.
choice
(
ids
.
keys
())
del
ids
[
key
]
del
t
[
key
]
id
=
t
random
.
choice
(
ids
.
keys
())
del
ids
[
id
]
del
t
[
id
]
ids
=
ids
.
keys
()
random
.
shuffle
(
ids
)
t
random
.
shuffle
(
ids
)
for
id
in
ids
:
del
t
[
id
]
#release all refs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment