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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
wcfs/δbtail.go
wcfs/δbtail.go
+7
-7
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+6
-6
No files found.
wcfs/δbtail.go
View file @
ed81f1bb
...
@@ -316,9 +316,9 @@ func (tidx trackIndex) verify() {
...
@@ -316,9 +316,9 @@ func (tidx trackIndex) verify() {
// Update tidx with trees subsets from tidx2.
// Update tidx with trees subsets from tidx2.
func
(
tidx
trackIndex
)
Update
(
tidx2
trackIndex
)
{
func
(
tidx
trackIndex
)
Update
(
tidx2
trackIndex
)
{
//
fmt.Printf("\n\nUpdate:\n")
fmt
.
Printf
(
"
\n\n
Update:
\n
"
)
//
fmt.Printf("tidx: %s\n", tidx)
fmt
.
Printf
(
"tidx: %s
\n
"
,
tidx
)
//
fmt.Printf("tidx2: %s\n", tidx2)
fmt
.
Printf
(
"tidx2: %s
\n
"
,
tidx2
)
tidx
.
verify
()
tidx
.
verify
()
tidx2
.
verify
()
tidx2
.
verify
()
...
@@ -339,13 +339,13 @@ func (tidx trackIndex) Update(tidx2 trackIndex) {
...
@@ -339,13 +339,13 @@ func (tidx trackIndex) Update(tidx2 trackIndex) {
}
}
t
.
nchild
+=
t2
.
nchild
t
.
nchild
+=
t2
.
nchild
}
/*
if
t
.
parent
!=
zodb
.
InvalidOid
{
if
t
.
parent
!=
zodb
.
InvalidOid
{
δnchild[t.parent]
// this node is already present in both trees
// compensate for that in its parent (which must be present)
tidx
[
t
.
parent
]
.
nchild
--
}
}
}
*/
}
}
tidx
.
verify
()
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
...
@@ -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
// xverifyΔBTail_Update1 verifies how ΔBTail handles ZODB update at1->at2 from initial
// tracked state defined by initialTrackedKeys.
// 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
X
:=
exc
.
Raiseif
tracef
(
"
\n
>>> Track=%s
\n
"
,
initialTrackedKeys
)
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
...
@@ -865,7 +865,7 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
keys1
.
Add
(
tAllKeyv
[
idx1
])
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
)
δbtail
:=
NewΔBtail
(
t0
.
at
,
db
)
// assert trackIdx=ø, trackNew=ø, vδB=[]
// assert trackIdx=ø, trackNew=ø, vδB=[]
...
@@ -895,7 +895,7 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
...
@@ -895,7 +895,7 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
keys2
.
Add
(
tRestKeyv2
[
idx2
])
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
// XXX implement Clone and go the clone way if test starts running too slow
//δbtail_ := δbtail.Clone()
//δbtail_ := δbtail.Clone()
...
@@ -1057,7 +1057,7 @@ func xverifyΔBTail_Get1(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, vt []*tTr
...
@@ -1057,7 +1057,7 @@ func xverifyΔBTail_Get1(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, vt []*tTr
// ΔBTestEntry represents one entry in ΔBTail tests.
// ΔBTestEntry represents one entry in ΔBTail tests.
type
ΔBTestEntry
struct
{
type
ΔBTestEntry
struct
{
tree
string
// next tree topology
tree
string
// next tree topology
kadjOK
map
[
Key
]
SetKey
// adjacency matrix against previous case (optional)
kadjOK
KAdjMatrix
// adjacency matrix against previous case (optional)
}
}
// ΔBTest converts xtest into ΔBTestEntry.
// ΔBTest converts xtest into ΔBTestEntry.
...
@@ -1195,8 +1195,8 @@ func TestΔBTail(t *testing.T) {
...
@@ -1195,8 +1195,8 @@ func TestΔBTail(t *testing.T) {
}
}
// oo is shorthand for kInf
// oo is shorthand for kInf
const
oo
=
kInf
const
oo
=
kInf
// A is shorthand for
map[Key]SetKey
// A is shorthand for
KAdjMatrix
type
A
=
map
[
Key
]
SetKey
type
A
=
KAdjMatrix
// Δ is shorthand for ΔBTestEntry
// Δ is shorthand for ΔBTestEntry
Δ
:=
func
(
tree
string
,
kadjOK
A
)
(
test
ΔBTestEntry
)
{
Δ
:=
func
(
tree
string
,
kadjOK
A
)
(
test
ΔBTestEntry
)
{
test
.
tree
=
tree
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