Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BTrees
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
BTrees
Commits
332503d8
Commit
332503d8
authored
May 06, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I was right the first time, the size must be at least two to trigger the bug.
parent
bccbdf8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
BTrees/tests/common.py
BTrees/tests/common.py
+10
-4
No files found.
BTrees/tests/common.py
View file @
332503d8
...
@@ -1148,7 +1148,9 @@ class BTreeTests(MappingBase):
...
@@ -1148,7 +1148,9 @@ class BTreeTests(MappingBase):
def
testRemoveInSmallMapSetsChanged
(
self
):
def
testRemoveInSmallMapSetsChanged
(
self
):
# A bug in the BTree Python implementation once caused
# A bug in the BTree Python implementation once caused
# deleting from a small btree to set _p_changed
# deleting from a small btree to set _p_changed.
# There must be at least two objects so that _firstbucket doesn't
# get set
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
# Note that for the property to actually hold, we have to fake a
# Note that for the property to actually hold, we have to fake a
# _p_jar and _p_oid
# _p_jar and _p_oid
...
@@ -1167,12 +1169,13 @@ class BTreeTests(MappingBase):
...
@@ -1167,12 +1169,13 @@ class BTreeTests(MappingBase):
t
.
_p_jar
=
Jar
()
t
.
_p_jar
=
Jar
()
t
[
0
]
=
1
t
[
0
]
=
1
t
[
1
]
=
2
# reset these, setting _firstbucket triggered a change
# reset these, setting _firstbucket triggered a change
t
.
_p_changed
=
False
t
.
_p_changed
=
False
t
.
_p_jar
.
registered
=
None
t
.
_p_jar
.
registered
=
None
# now remove the second value
# now remove the second value
del
t
[
0
]
del
t
[
1
]
self
.
assertTrue
(
t
.
_p_changed
)
self
.
assertTrue
(
t
.
_p_changed
)
self
.
assertEqual
(
t
,
t
.
_p_jar
.
registered
)
self
.
assertEqual
(
t
,
t
.
_p_jar
.
registered
)
...
@@ -1387,7 +1390,9 @@ class NormalSetTests(Base):
...
@@ -1387,7 +1390,9 @@ class NormalSetTests(Base):
def
testRemoveInSmallSetSetsChanged
(
self
):
def
testRemoveInSmallSetSetsChanged
(
self
):
# A bug in the BTree TreeSet Python implementation once caused
# A bug in the BTree TreeSet Python implementation once caused
# deleting an item in a small set to fail to set _p_changed
# deleting an item in a small set to fail to set _p_changed.
# There must be at least two objects so that _firstbucket doesn't
# get set
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
# Note that for the property to actually hold, we have to fake a
# Note that for the property to actually hold, we have to fake a
# _p_jar and _p_oid
# _p_jar and _p_oid
...
@@ -1406,12 +1411,13 @@ class NormalSetTests(Base):
...
@@ -1406,12 +1411,13 @@ class NormalSetTests(Base):
t
.
_p_jar
=
Jar
()
t
.
_p_jar
=
Jar
()
t
.
add
(
0
)
t
.
add
(
0
)
t
.
add
(
1
)
# reset these, setting _firstbucket triggered a change
# reset these, setting _firstbucket triggered a change
t
.
_p_changed
=
False
t
.
_p_changed
=
False
t
.
_p_jar
.
registered
=
None
t
.
_p_jar
.
registered
=
None
# now remove the second value
# now remove the second value
t
.
remove
(
0
)
t
.
remove
(
1
)
self
.
assertTrue
(
t
.
_p_changed
)
self
.
assertTrue
(
t
.
_p_changed
)
self
.
assertEqual
(
t
,
t
.
_p_jar
.
registered
)
self
.
assertEqual
(
t
,
t
.
_p_jar
.
registered
)
...
...
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