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
6b2c1d79
Commit
6b2c1d79
authored
Jul 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
1ba21b2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
wcfs/internal/zdata/δftail_test.go
wcfs/internal/zdata/δftail_test.go
+21
-7
No files found.
wcfs/internal/zdata/δftail_test.go
View file @
6b2c1d79
...
...
@@ -241,6 +241,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
i
:=
0
delfilePrev
:=
false
epochv
:=
[]
zodb
.
Tid
{
0
}
for
test
:=
range
testq
{
i
++
δblk
:=
setI64
{}
...
...
@@ -252,11 +253,11 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
delfile
=
true
}
e
poch
:=
delfile
||
(
!
delfile
&&
delfilePrev
&&
!
delfilePrev
)
newE
poch
:=
delfile
||
(
!
delfile
&&
delfilePrev
&&
!
delfilePrev
)
delfilePrev
=
delfile
//
e
poch -> reset
if
e
poch
{
//
newE
poch -> reset
if
newE
poch
{
blkTab
=
map
[
int64
]
string
{}
Zinblk
=
map
[
string
]
setI64
{}
δblk
=
nil
...
...
@@ -315,6 +316,9 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
req
=
tTxt
+
" "
+
dTxt
}
commit
:=
t
.
CommitTree
(
req
)
if
newEpoch
{
epochv
=
append
(
epochv
,
commit
.
At
)
}
// update blkRevAt
var
blkRevPrev
map
[
int64
]
zodb
.
Tid
...
...
@@ -323,7 +327,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
}
blkRev
:=
map
[
int64
]
zodb
.
Tid
{}
for
blk
,
rev
:=
range
blkRevPrev
{
if
e
poch
{
if
newE
poch
{
blkRev
[
blk
]
=
commit
.
At
}
else
{
blkRev
[
blk
]
=
rev
...
...
@@ -340,10 +344,10 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
err
=
zconn
.
Resync
(
ctx
,
commit
.
At
);
X
(
err
)
var
δfok
*
ΔFile
if
e
poch
||
len
(
δblk
)
!=
0
{
if
newE
poch
||
len
(
δblk
)
!=
0
{
δfok
=
&
ΔFile
{
Rev
:
commit
.
At
,
Epoch
:
e
poch
,
Epoch
:
newE
poch
,
Blocks
:
δblk
,
Size
:
δtree
,
// not strictly ok, but matches current ΔFtail code
}
...
...
@@ -454,7 +458,17 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
blkRev
:=
blkRevAt
[
at
]
for
_
,
blk
:=
range
blkv
{
rev
,
exact
:=
δftail
.
LastBlkRev
(
ctx
,
zfile
,
blk
,
at
)
revOK
,
exactOK
:=
blkRev
[
blk
],
true
revOK
,
ok
:=
blkRev
[
blk
]
if
!
ok
{
k
:=
len
(
epochv
)
-
1
for
;
k
>=
0
;
k
--
{
if
epochv
[
k
]
<=
at
{
break
}
}
revOK
=
epochv
[
k
]
}
exactOK
:=
true
if
revOK
<=
δftail
.
Tail
()
{
revOK
,
exactOK
=
δftail
.
Tail
(),
false
}
...
...
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