Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
9104c87b
Commit
9104c87b
authored
Mar 03, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cd86628f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
t/neo/storage/fs1/filestorage_test.go
t/neo/storage/fs1/filestorage_test.go
+18
-3
No files found.
t/neo/storage/fs1/filestorage_test.go
View file @
9104c87b
...
...
@@ -21,8 +21,12 @@ import (
"testing"
"../../zodb"
"lab.nexedi.com/kirr/go123/exc"
)
// XXX -> testDbEntry ?
// one database transaction record
type
dbEntry
struct
{
Header
TxnHeader
...
...
@@ -51,6 +55,7 @@ type oidLoadedOk struct {
data
[]
byte
}
// checkLoad verifies that fs.Load(xid) returns expected result
func
checkLoad
(
t
*
testing
.
T
,
fs
*
FileStorage
,
xid
zodb
.
Xid
,
expect
oidLoadedOk
)
{
data
,
tid
,
err
:=
fs
.
Load
(
xid
)
if
err
!=
nil
{
...
...
@@ -64,12 +69,17 @@ func checkLoad(t *testing.T, fs *FileStorage, xid zodb.Xid, expect oidLoadedOk)
}
}
func
TestLoad
(
t
*
testing
.
T
)
{
fs
,
err
:=
Open
(
"testdata/1.fs"
)
func
xfsopen
(
t
*
testing
.
T
,
path
string
)
*
FileStorage
{
fs
,
err
:=
Open
(
path
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
//defer xclose(fs)
return
fs
}
func
TestLoad
(
t
*
testing
.
T
)
{
fs
:=
xfsopen
(
t
,
"testdata/1.fs"
)
// TODO open read-only
defer
exc
.
XRun
(
fs
.
Close
)
// current knowledge of what was "before" for an oid as we scan over
// data base entries
...
...
@@ -108,6 +118,11 @@ func TestLoad(t *testing.T) {
xid
:=
zodb
.
Xid
{
zodb
.
XTid
{
zodb
.
TidMax
,
true
},
oid
}
checkLoad
(
t
,
fs
,
xid
,
expect
)
}
}
func
TestIterate
(
t
*
testing
.
T
)
{
fs
:=
xfsopen
(
t
,
"testdata/1.fs"
)
// TODO open ro
defer
exc
.
XRun
(
fs
.
Close
)
// check iterating XXX move to separate test ?
// tids we will use for tid{Min,Max}
...
...
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