good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
56213089
Commit
56213089
authored
9 years ago
by
Gustav Simonsson
Browse files
Options
Downloads
Patches
Plain Diff
tests: add test for StateTests/stCallCodes.json
parent
e40b447f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/files/StateTests/stCallCodes.json
+6798
-0
6798 additions, 0 deletions
tests/files/StateTests/stCallCodes.json
tests/state_test.go
+7
-0
7 additions, 0 deletions
tests/state_test.go
tests/state_test_util.go
+2
-1
2 additions, 1 deletion
tests/state_test_util.go
with
6807 additions
and
1 deletion
tests/files/StateTests/stCallCodes.json
0 → 100644
+
6798
−
0
View file @
56213089
This diff is collapsed.
Click to expand it.
tests/state_test.go
+
7
−
0
View file @
56213089
...
...
@@ -115,6 +115,13 @@ func TestCallCreateCallCode(t *testing.T) {
}
}
func
TestCallCodes
(
t
*
testing
.
T
)
{
fn
:=
filepath
.
Join
(
stateTestDir
,
"stCallCodes.json"
)
if
err
:=
RunStateTest
(
fn
,
StateSkipTests
);
err
!=
nil
{
t
.
Error
(
err
)
}
}
func
TestMemory
(
t
*
testing
.
T
)
{
fn
:=
filepath
.
Join
(
stateTestDir
,
"stMemoryTest.json"
)
if
err
:=
RunStateTest
(
fn
,
StateSkipTests
);
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
tests/state_test_util.go
+
2
−
1
View file @
56213089
...
...
@@ -128,6 +128,7 @@ func runStateTests(tests map[string]VmTest, skipTests []string) error {
return
nil
}
//fmt.Println("StateTest name:", name)
if
err
:=
runStateTest
(
test
);
err
!=
nil
{
return
fmt
.
Errorf
(
"%s: %s
\n
"
,
name
,
err
.
Error
())
}
...
...
@@ -172,7 +173,7 @@ func runStateTest(test VmTest) error {
ret
,
logs
,
_
,
_
=
RunState
(
statedb
,
env
,
test
.
Transaction
)
//
//
Compare expected
and actual return
// Compare expected and actual return
rexp
:=
common
.
FromHex
(
test
.
Out
)
if
bytes
.
Compare
(
rexp
,
ret
)
!=
0
{
return
fmt
.
Errorf
(
"return failed. Expected %x, got %x
\n
"
,
rexp
,
ret
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment