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
cbd785cf
Commit
cbd785cf
authored
Oct 16, 2014
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ethvm, tests/*: use log level constants
parent
0165c183
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
vm_test.go
ethvm/vm_test.go
+7
-7
init.go
tests/helper/init.go
+1
-1
gh_test.go
tests/vm/gh_test.go
+4
-0
No files found.
ethvm/vm_test.go
View file @
cbd785cf
...
...
@@ -39,14 +39,14 @@ for i := 0; i < 10; i++ {
return x`
func
setup
(
level
int
,
typ
Type
)
(
*
Closure
,
VirtualMachine
)
{
func
setup
(
level
ethlog
.
LogLevel
,
typ
Type
)
(
*
Closure
,
VirtualMachine
)
{
code
,
err
:=
ethutil
.
Compile
(
mutcode
,
true
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
// Pipe output to /dev/null
ethlog
.
AddLogSystem
(
ethlog
.
NewStdLogSystem
(
ioutil
.
Discard
,
log
.
LstdFlags
,
ethlog
.
LogLevel
(
level
)
))
ethlog
.
AddLogSystem
(
ethlog
.
NewStdLogSystem
(
ioutil
.
Discard
,
log
.
LstdFlags
,
level
))
ethutil
.
ReadConfig
(
".ethtest"
,
"/tmp/ethtest"
,
""
)
...
...
@@ -57,7 +57,7 @@ func setup(level int, typ Type) (*Closure, VirtualMachine) {
}
func
TestDebugVm
(
t
*
testing
.
T
)
{
closure
,
vm
:=
setup
(
4
,
DebugVmTy
)
closure
,
vm
:=
setup
(
ethlog
.
DebugLevel
,
DebugVmTy
)
ret
,
_
,
e
:=
closure
.
Call
(
vm
,
nil
)
if
e
!=
nil
{
fmt
.
Println
(
"error"
,
e
)
...
...
@@ -69,7 +69,7 @@ func TestDebugVm(t *testing.T) {
}
func
TestVm
(
t
*
testing
.
T
)
{
closure
,
vm
:=
setup
(
4
,
StandardVmTy
)
closure
,
vm
:=
setup
(
ethlog
.
DebugLevel
,
StandardVmTy
)
ret
,
_
,
e
:=
closure
.
Call
(
vm
,
nil
)
if
e
!=
nil
{
fmt
.
Println
(
"error"
,
e
)
...
...
@@ -81,7 +81,7 @@ func TestVm(t *testing.T) {
}
func
BenchmarkDebugVm
(
b
*
testing
.
B
)
{
closure
,
vm
:=
setup
(
3
,
DebugVmTy
)
closure
,
vm
:=
setup
(
ethlog
.
InfoLevel
,
DebugVmTy
)
b
.
ResetTimer
()
...
...
@@ -91,7 +91,7 @@ func BenchmarkDebugVm(b *testing.B) {
}
func
BenchmarkVm
(
b
*
testing
.
B
)
{
closure
,
vm
:=
setup
(
3
,
StandardVmTy
)
closure
,
vm
:=
setup
(
ethlog
.
InfoLevel
,
StandardVmTy
)
b
.
ResetTimer
()
...
...
@@ -106,7 +106,7 @@ func RunCode(mutCode string, typ Type) []byte {
log
.
Fatal
(
err
)
}
ethlog
.
AddLogSystem
(
ethlog
.
NewStdLogSystem
(
os
.
Stdout
,
log
.
LstdFlags
,
ethlog
.
LogLevel
(
3
)
))
ethlog
.
AddLogSystem
(
ethlog
.
NewStdLogSystem
(
os
.
Stdout
,
log
.
LstdFlags
,
ethlog
.
InfoLevel
))
ethutil
.
ReadConfig
(
".ethtest"
,
"/tmp/ethtest"
,
""
)
...
...
tests/helper/init.go
View file @
cbd785cf
...
...
@@ -12,7 +12,7 @@ var Logger ethlog.LogSystem
var
Log
=
ethlog
.
NewLogger
(
"TEST"
)
func
init
()
{
Logger
=
ethlog
.
NewStdLogSystem
(
os
.
Stdout
,
log
.
LstdFlags
,
ethlog
.
LogLevel
(
3
)
)
Logger
=
ethlog
.
NewStdLogSystem
(
os
.
Stdout
,
log
.
LstdFlags
,
ethlog
.
InfoLevel
)
ethlog
.
AddLogSystem
(
Logger
)
ethutil
.
ReadConfig
(
".ethtest"
,
"/tmp/ethtest"
,
""
)
...
...
tests/vm/gh_test.go
View file @
cbd785cf
...
...
@@ -4,6 +4,7 @@ import (
"bytes"
"testing"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethstate"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/tests/helper"
...
...
@@ -87,6 +88,9 @@ func RunVmTest(url string, t *testing.T) {
}
// I've created a new function for each tests so it's easier to identify where the problem lies if any of them fail.
func
TestVMSha3
(
t
*
testing
.
T
)
{
helper
.
Logger
.
SetLogLevel
(
ethlog
.
Silence
)
defer
helper
.
Logger
.
SetLogLevel
(
ethlog
.
DebugLevel
)
func
TestVMArithmetic
(
t
*
testing
.
T
)
{
const
url
=
"https://raw.githubusercontent.com/ethereum/tests/develop/vmtests/vmArithmeticTest.json"
...
...
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