tests: add test for StateTests/stCallCodes.json

This commit is contained in:
Gustav Simonsson 2015-09-21 11:34:02 +02:00
parent e40b447fea
commit 5621308949
3 changed files with 6807 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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 {

View File

@ -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)