Developing lightweight computation at the DSG edge
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LightKone
antidote-go-client
Commits
55b86d68
Commit
55b86d68
authored
Mar 22, 2018
by
Mathias Weber
Browse files
fixed tests
parent
7683bbe1
Changes
1
Hide whitespace changes
Inline
Side-by-side
antidoteclient_test.go
View file @
55b86d68
...
@@ -21,7 +21,7 @@ func TestSimple(t *testing.T) {
...
@@ -21,7 +21,7 @@ func TestSimple(t *testing.T) {
}
}
bucket
:=
Bucket
{[]
byte
(
"bucket"
)}
bucket
:=
Bucket
{[]
byte
(
"bucket"
)}
key
:=
Key
(
"keyCounter"
)
key
:=
Key
(
"keyCounter"
)
_
,
err
=
bucket
.
Update
(
tx
,
CounterInc
(
key
,
1
))
err
=
bucket
.
Update
(
tx
,
CounterInc
(
key
,
1
))
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
@@ -33,7 +33,7 @@ func TestSimple(t *testing.T) {
...
@@ -33,7 +33,7 @@ func TestSimple(t *testing.T) {
fmt
.
Print
(
counterVal
)
fmt
.
Print
(
counterVal
)
_
,
err
=
tx
.
Commit
()
err
=
tx
.
Commit
()
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
@@ -55,7 +55,7 @@ func TestSetUpdate(t *testing.T) {
...
@@ -55,7 +55,7 @@ func TestSetUpdate(t *testing.T) {
bucket
:=
Bucket
{[]
byte
(
"bucket"
)}
bucket
:=
Bucket
{[]
byte
(
"bucket"
)}
key
:=
Key
(
"keySet"
)
key
:=
Key
(
"keySet"
)
_
,
err
=
bucket
.
Update
(
tx
,
SetAdd
(
key
,
[]
byte
(
"test1"
)))
err
=
bucket
.
Update
(
tx
,
SetAdd
(
key
,
[]
byte
(
"test1"
)))
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
@@ -70,7 +70,7 @@ func TestSetUpdate(t *testing.T) {
...
@@ -70,7 +70,7 @@ func TestSetUpdate(t *testing.T) {
fmt
.
Println
(
string
(
v
))
fmt
.
Println
(
string
(
v
))
}
}
_
,
err
=
tx
.
Commit
()
err
=
tx
.
Commit
()
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
@@ -97,20 +97,14 @@ func TestManyUpdates(t *testing.T) {
...
@@ -97,20 +97,14 @@ func TestManyUpdates(t *testing.T) {
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
updateResp
,
err
:
=
bucket
.
Update
(
tx
,
CounterInc
(
key
,
1
))
err
=
bucket
.
Update
(
tx
,
CounterInc
(
key
,
1
))
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
if
!
(
*
updateResp
.
Success
)
{
err
=
tx
.
Commit
()
fmt
.
Printf
(
"Update #%d not successful
\n
"
,
i
)
}
commitResp
,
err
:=
tx
.
Commit
()
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
if
!
(
*
commitResp
.
Success
)
{
fmt
.
Printf
(
"Commit #%d not successful
\n
"
,
i
)
}
if
i
%
1000
==
0
{
if
i
%
1000
==
0
{
fmt
.
Println
(
i
)
fmt
.
Println
(
i
)
}
}
...
@@ -156,7 +150,7 @@ func TestStatic(t *testing.T) {
...
@@ -156,7 +150,7 @@ func TestStatic(t *testing.T) {
tx
:=
client
.
CreateStaticTransaction
()
tx
:=
client
.
CreateStaticTransaction
()
_
,
err
=
bucket
.
Update
(
tx
,
CounterInc
(
key
,
1
))
err
=
bucket
.
Update
(
tx
,
CounterInc
(
key
,
1
))
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
...
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