Merge pull request #1827 from Gustav-Simonsson/common_tests

tests: add test for StateTests/stCallCodes.json
pull/1318/merge
Jeffrey Wilcke 9 years ago
commit e456f27795
  1. 6798
      tests/files/StateTests/stCallCodes.json
  2. 7
      tests/state_test.go
  3. 3
      tests/state_test_util.go

File diff suppressed because it is too large Load Diff

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

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

Loading…
Cancel
Save