Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
ed81f1bb
Commit
ed81f1bb
authored
Apr 29, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e9ecca3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
wcfs/δbtail.go
wcfs/δbtail.go
+8
-8
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+7
-7
No files found.
wcfs/δbtail.go
View file @
ed81f1bb
...
...
@@ -316,9 +316,9 @@ func (tidx trackIndex) verify() {
// Update tidx with trees subsets from tidx2.
func
(
tidx
trackIndex
)
Update
(
tidx2
trackIndex
)
{
//
fmt.Printf("\n\nUpdate:\n")
//
fmt.Printf("tidx: %s\n", tidx)
//
fmt.Printf("tidx2: %s\n", tidx2)
fmt
.
Printf
(
"
\n\n
Update:
\n
"
)
fmt
.
Printf
(
"tidx: %s
\n
"
,
tidx
)
fmt
.
Printf
(
"tidx2: %s
\n
"
,
tidx2
)
tidx
.
verify
()
tidx2
.
verify
()
...
...
@@ -339,13 +339,13 @@ func (tidx trackIndex) Update(tidx2 trackIndex) {
}
t
.
nchild
+=
t2
.
nchild
}
/*
if t.parent != zodb.InvalidOid {
δnchild[t.parent]
if
t
.
parent
!=
zodb
.
InvalidOid
{
// this node is already present in both trees
// compensate for that in its parent (which must be present)
tidx
[
t
.
parent
]
.
nchild
--
}
}
*/
}
tidx
.
verify
()
...
...
wcfs/δbtail_test.go
View file @
ed81f1bb
...
...
@@ -641,7 +641,7 @@ func xverifyΔBTail_Update(t *testing.T, subj string, db *zodb.DB, treeRoot zodb
// xverifyΔBTail_Update1 verifies how ΔBTail handles ZODB update at1->at2 from initial
// tracked state defined by initialTrackedKeys.
func
xverifyΔBTail_Update1
(
t
*
testing
.
T
,
subj
string
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
at1
,
at2
zodb
.
Tid
,
xkv1
,
xkv2
RBucketSet
,
δZ
*
zodb
.
EventCommit
,
initialTrackedKeys
SetKey
,
kadj
map
[
Key
]
SetKey
)
{
func
xverifyΔBTail_Update1
(
t
*
testing
.
T
,
subj
string
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
at1
,
at2
zodb
.
Tid
,
xkv1
,
xkv2
RBucketSet
,
δZ
*
zodb
.
EventCommit
,
initialTrackedKeys
SetKey
,
kadj
KAdjMatrix
)
{
X
:=
exc
.
Raiseif
tracef
(
"
\n
>>> Track=%s
\n
"
,
initialTrackedKeys
)
...
...
@@ -865,7 +865,7 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
keys1
.
Add
(
tAllKeyv
[
idx1
])
}
t
.
Run
(
fmt
.
Sprintf
(
" T
(%s)
;R"
,
keys1
),
func
(
t
*
testing
.
T
)
{
t
.
Run
(
fmt
.
Sprintf
(
" T
%s
;R"
,
keys1
),
func
(
t
*
testing
.
T
)
{
δbtail
:=
NewΔBtail
(
t0
.
at
,
db
)
// assert trackIdx=ø, trackNew=ø, vδB=[]
...
...
@@ -895,7 +895,7 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
keys2
.
Add
(
tRestKeyv2
[
idx2
])
}
t
.
Run
(
fmt
.
Sprintf
(
" →%s T
(%s)
;R"
,
t2
.
tree
,
keys2
),
func
(
t
*
testing
.
T
)
{
t
.
Run
(
fmt
.
Sprintf
(
" →%s T
%s
;R"
,
t2
.
tree
,
keys2
),
func
(
t
*
testing
.
T
)
{
// XXX implement Clone and go the clone way if test starts running too slow
//δbtail_ := δbtail.Clone()
...
...
@@ -1056,8 +1056,8 @@ func xverifyΔBTail_Get1(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, vt []*tTr
// ΔBTestEntry represents one entry in ΔBTail tests.
type
ΔBTestEntry
struct
{
tree
string
// next tree topology
kadjOK
map
[
Key
]
SetKey
// adjacency matrix against previous case (optional)
tree
string
// next tree topology
kadjOK
KAdjMatrix
// adjacency matrix against previous case (optional)
}
// ΔBTest converts xtest into ΔBTestEntry.
...
...
@@ -1195,8 +1195,8 @@ func TestΔBTail(t *testing.T) {
}
// oo is shorthand for kInf
const
oo
=
kInf
// A is shorthand for
map[Key]SetKey
type
A
=
map
[
Key
]
SetKey
// A is shorthand for
KAdjMatrix
type
A
=
KAdjMatrix
// Δ is shorthand for ΔBTestEntry
Δ
:=
func
(
tree
string
,
kadjOK
A
)
(
test
ΔBTestEntry
)
{
test
.
tree
=
tree
...
...
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