Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
b6b314d9
Commit
b6b314d9
authored
Sep 12, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
113c3f7d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
go/neo/server/cluster_test.go
go/neo/server/cluster_test.go
+15
-15
No files found.
go/neo/server/cluster_test.go
View file @
b6b314d9
...
...
@@ -427,15 +427,15 @@ func TestMasterStorage(t *testing.T) {
// C starts loading first object ...
wg
=
&
xsync
.
WorkGroup
{}
xid1
:=
zodb
.
Xid
{
Oid
:
1
,
XTid
:
zodb
.
XTid
{
Tid
:
zodb
.
TidMax
,
TidBefore
:
true
}}
data
1
,
serial1
,
err
:=
zstor
.
Load
(
bg
,
xid1
)
buf
1
,
serial1
,
err
:=
zstor
.
Load
(
bg
,
xid1
)
exc
.
Raiseif
(
err
)
wg
.
Gox
(
func
()
{
data
,
serial
,
err
:=
C
.
Load
(
bg
,
xid1
)
buf
,
serial
,
err
:=
C
.
Load
(
bg
,
xid1
)
exc
.
Raiseif
(
err
)
if
!
(
bytes
.
Equal
(
data
,
data1
)
&&
serial
==
serial1
)
{
if
!
(
bytes
.
Equal
(
buf
.
Data
,
buf1
.
Data
)
&&
serial
==
serial1
)
{
exc
.
Raisef
(
"C.Load(%v) ->
\n
data:
\n
%s
\n
serial:
\n
%s
\n
"
,
xid1
,
pretty
.
Compare
(
data1
,
d
ata
),
pretty
.
Compare
(
serial1
,
serial
))
pretty
.
Compare
(
buf1
.
Data
,
buf
.
D
ata
),
pretty
.
Compare
(
serial1
,
serial
))
}
})
...
...
@@ -468,9 +468,9 @@ func TestMasterStorage(t *testing.T) {
Serial
:
serial1
,
NextSerial
:
0
,
// XXX
Compression
:
false
,
Data
:
data
1
,
Data
:
buf
1
,
DataSerial
:
0
,
// XXX
Checksum
:
sha1
.
Sum
(
data1
),
Checksum
:
sha1
.
Sum
(
buf1
.
Data
),
}))
xwait
(
wg
)
...
...
@@ -509,18 +509,18 @@ func TestMasterStorage(t *testing.T) {
xid
.
Tid
++
}
data
,
tid
,
err
:=
C
.
Load
(
bg
,
xid
)
buf
,
tid
,
err
:=
C
.
Load
(
bg
,
xid
)
if
datai
.
Data
!=
nil
{
if
!
(
bytes
.
Equal
(
d
ata
,
datai
.
Data
)
&&
tid
==
datai
.
Tid
&&
err
==
nil
)
{
if
!
(
bytes
.
Equal
(
buf
.
D
ata
,
datai
.
Data
)
&&
tid
==
datai
.
Tid
&&
err
==
nil
)
{
t
.
Fatalf
(
"load: %v:
\n
have: %v %v %q
\n
want: %v nil %q"
,
xid
,
tid
,
err
,
d
ata
,
datai
.
Tid
,
datai
.
Data
)
xid
,
tid
,
err
,
buf
.
D
ata
,
datai
.
Tid
,
datai
.
Data
)
}
}
else
{
// deleted
errWant
:=
&
zodb
.
ErrXidMissing
{
xid
}
if
!
(
data
==
nil
&&
tid
==
0
&&
reflect
.
DeepEqual
(
err
,
errWant
))
{
if
!
(
buf
==
nil
&&
tid
==
0
&&
reflect
.
DeepEqual
(
err
,
errWant
))
{
t
.
Fatalf
(
"load: %v:
\n
have: %v, %#v, %#v
\n
want: %v, %#v, %#v"
,
xid
,
tid
,
err
,
data
,
zodb
.
Tid
(
0
),
errWant
,
[]
byte
(
nil
))
xid
,
tid
,
err
,
buf
,
zodb
.
Tid
(
0
),
errWant
,
[]
byte
(
nil
))
}
}
}
...
...
@@ -600,20 +600,20 @@ func BenchmarkGetObject(b *testing.B) {
xid1
.
Tid
=
zodb
.
TidMax
xid1
.
TidBefore
=
true
data
1
,
serial1
,
err
:=
zstor
.
Load
(
ctx
,
xid1
)
buf
1
,
serial1
,
err
:=
zstor
.
Load
(
ctx
,
xid1
)
if
err
!=
nil
{
b
.
Fatal
(
err
)
}
// C.Load(xid1)
xcload1
:=
func
()
{
c
data
1
,
cserial1
,
err
:=
C
.
Load
(
ctx
,
xid1
)
c
buf
1
,
cserial1
,
err
:=
C
.
Load
(
ctx
,
xid1
)
if
err
!=
nil
{
b
.
Fatal
(
err
)
}
if
!
(
bytes
.
Equal
(
c
data1
,
data1
)
&&
cserial1
==
serial1
)
{
b
.
Fatalf
(
"C.Load first -> %q %v ; want %q %v"
,
c
data1
,
cserial1
,
data1
,
serial1
)
if
!
(
bytes
.
Equal
(
c
buf1
.
Data
,
buf1
.
Data
)
&&
cserial1
==
serial1
)
{
b
.
Fatalf
(
"C.Load first -> %q %v ; want %q %v"
,
c
buf1
.
Data
,
cserial1
,
buf1
.
Data
,
serial1
)
}
}
...
...
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