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
f280a3b7
Commit
f280a3b7
authored
Apr 06, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
89dd3865
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
wcfs/testdata/zblk_test_gen.py
wcfs/testdata/zblk_test_gen.py
+2
-0
wcfs/zblk_test.go
wcfs/zblk_test.go
+8
-11
No files found.
wcfs/testdata/zblk_test_gen.py
View file @
f280a3b7
...
@@ -67,7 +67,9 @@ def main():
...
@@ -67,7 +67,9 @@ def main():
emit
(
"const blksize = %s"
%
blksize
)
emit
(
"const blksize = %s"
%
blksize
)
emit
(
"const z0_oid = %s"
%
u64
(
z0
.
_p_oid
))
emit
(
"const z0_oid = %s"
%
u64
(
z0
.
_p_oid
))
emit
(
"const z0_rev = %s"
%
u64
(
z0
.
_p_serial
))
emit
(
"const z1_oid = %s"
%
u64
(
z1
.
_p_oid
))
emit
(
"const z1_oid = %s"
%
u64
(
z1
.
_p_oid
))
emit
(
"const z1_rev = %s"
%
u64
(
z1
.
_p_serial
))
emit
(
"const zf_oid = %s"
%
u64
(
zf
.
_p_oid
))
emit
(
"const zf_oid = %s"
%
u64
(
zf
.
_p_oid
))
...
...
wcfs/zblk_test.go
View file @
f280a3b7
...
@@ -28,7 +28,6 @@ package main
...
@@ -28,7 +28,6 @@ package main
import
(
import
(
"context"
"context"
"encoding/binary"
"encoding/binary"
"fmt"
"testing"
"testing"
"lab.nexedi.com/kirr/go123/exc"
"lab.nexedi.com/kirr/go123/exc"
...
@@ -47,7 +46,8 @@ func TestZBlk(t *testing.T) {
...
@@ -47,7 +46,8 @@ func TestZBlk(t *testing.T) {
stor
,
err
:=
zodb
.
Open
(
ctx
,
"testdata/zblk.fs"
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
});
X
(
err
)
stor
,
err
:=
zodb
.
Open
(
ctx
,
"testdata/zblk.fs"
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
});
X
(
err
)
db
:=
zodb
.
NewDB
(
stor
)
db
:=
zodb
.
NewDB
(
stor
)
defer
func
()
{
defer
func
()
{
err
:=
db
.
Close
();
X
(
err
)
err
:=
db
.
Close
();
X
(
err
)
err
=
stor
.
Close
();
X
(
err
)
}()
}()
txn
,
ctx
:=
transaction
.
New
(
ctx
)
txn
,
ctx
:=
transaction
.
New
(
ctx
)
...
@@ -55,8 +55,6 @@ func TestZBlk(t *testing.T) {
...
@@ -55,8 +55,6 @@ func TestZBlk(t *testing.T) {
conn
,
err
:=
db
.
Open
(
ctx
,
&
zodb
.
ConnOptions
{});
X
(
err
)
conn
,
err
:=
db
.
Open
(
ctx
,
&
zodb
.
ConnOptions
{});
X
(
err
)
// XXX close db/stor
xz0
,
err
:=
conn
.
Get
(
ctx
,
z0_oid
);
X
(
err
)
xz0
,
err
:=
conn
.
Get
(
ctx
,
z0_oid
);
X
(
err
)
xz1
,
err
:=
conn
.
Get
(
ctx
,
z1_oid
);
X
(
err
)
xz1
,
err
:=
conn
.
Get
(
ctx
,
z1_oid
);
X
(
err
)
xzf
,
err
:=
conn
.
Get
(
ctx
,
zf_oid
);
X
(
err
)
xzf
,
err
:=
conn
.
Get
(
ctx
,
zf_oid
);
X
(
err
)
...
@@ -89,14 +87,13 @@ func TestZBlk(t *testing.T) {
...
@@ -89,14 +87,13 @@ func TestZBlk(t *testing.T) {
binary
.
BigEndian
.
PutUint32
(
data
[
i
*
4
:
],
i
)
binary
.
BigEndian
.
PutUint32
(
data
[
i
*
4
:
],
i
)
}
}
z0Data
,
_
,
err
:=
z0
.
loadBlkData
(
ctx
);
X
(
err
)
// FIXME check rev
z0Data
,
z0Rev
,
err
:=
z0
.
loadBlkData
(
ctx
);
X
(
err
)
assert
.
Equal
(
z0Data
,
data
,
"ZBlk0 data wrong"
)
assert
.
Equal
(
z0Data
,
data
,
"ZBlk0 data wrong"
)
assert
.
Equal
(
z0Rev
,
z0_rev
,
"ZBlk0 rev wrong"
)
z1Data
,
_
,
err
:=
z1
.
loadBlkData
(
ctx
);
X
(
err
)
// FIXME check rev
z1Data
,
z1Rev
,
err
:=
z1
.
loadBlkData
(
ctx
);
X
(
err
)
if
false
{
assert
.
Equal
(
z1Data
,
data
,
"ZBlk1 data wrong"
)
fmt
.
Printf
(
"%#v
\n
"
,
z1Data
)
assert
.
Equal
(
z1Rev
,
z1_rev
,
"ZBlk1 rev wrong"
)
}
assert
.
Equal
(
z1Data
[
:
20
],
data
[
:
20
],
"ZBlk1 data wrong"
)
...
...
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