Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
fb71c9f6
Commit
fb71c9f6
authored
Mar 12, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return 1 on fail
parent
83cc08f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
main.go
cmd/ethtest/main.go
+5
-0
No files found.
cmd/ethtest/main.go
View file @
fb71c9f6
...
...
@@ -136,6 +136,7 @@ func RunVmTest(r io.Reader) (failed int) {
rexp
:=
helper
.
FromHex
(
test
.
Out
)
if
bytes
.
Compare
(
rexp
,
ret
)
!=
0
{
fmt
.
Printf
(
"%s's return failed. Expected %x, got %x
\n
"
,
name
,
rexp
,
ret
)
failed
=
1
}
for
addr
,
account
:=
range
test
.
Post
{
...
...
@@ -147,6 +148,7 @@ func RunVmTest(r io.Reader) (failed int) {
if
len
(
test
.
Exec
)
==
0
{
if
obj
.
Balance
()
.
Cmp
(
ethutil
.
Big
(
account
.
Balance
))
!=
0
{
fmt
.
Printf
(
"%s's : (%x) balance failed. Expected %v, got %v => %v
\n
"
,
name
,
obj
.
Address
()[
:
4
],
account
.
Balance
,
obj
.
Balance
(),
new
(
big
.
Int
)
.
Sub
(
ethutil
.
Big
(
account
.
Balance
),
obj
.
Balance
()))
failed
=
1
}
}
...
...
@@ -156,17 +158,20 @@ func RunVmTest(r io.Reader) (failed int) {
if
bytes
.
Compare
(
v
,
vexp
)
!=
0
{
fmt
.
Printf
(
"%s's : (%x: %s) storage failed. Expected %x, got %x (%v %v)
\n
"
,
name
,
obj
.
Address
()[
0
:
4
],
addr
,
vexp
,
v
,
ethutil
.
BigD
(
vexp
),
ethutil
.
BigD
(
v
))
failed
=
1
}
}
}
if
!
bytes
.
Equal
(
ethutil
.
Hex2Bytes
(
test
.
PostStateRoot
),
statedb
.
Root
())
{
fmt
.
Printf
(
"%s's : Post state root error. Expected %s, got %x"
,
name
,
test
.
PostStateRoot
,
statedb
.
Root
())
failed
=
1
}
if
len
(
test
.
Logs
)
>
0
{
if
len
(
test
.
Logs
)
!=
len
(
logs
)
{
fmt
.
Printf
(
"log length mismatch. Expected %d, got %d"
,
len
(
test
.
Logs
),
len
(
logs
))
failed
=
1
}
else
{
/*
fmt.Println("A", test.Logs)
...
...
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