diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-02-29 22:05:37 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-02-29 22:05:37 +0800 |
commit | 4044a8cea44cd4cee3a8ddaf51a76b71c9d22042 (patch) | |
tree | 1aa3776381e8e117b66e4a8ed1bf83e29d966ff1 /tests/state_test.go | |
parent | c541b38fb36587d23c60f5e2f2b9b3c8700ec489 (diff) | |
parent | 61be63bb9b8527bb3e2357ad35a0f4ef29304da1 (diff) | |
download | go-tangerine-1.3.4.tar go-tangerine-1.3.4.tar.gz go-tangerine-1.3.4.tar.bz2 go-tangerine-1.3.4.tar.lz go-tangerine-1.3.4.tar.xz go-tangerine-1.3.4.tar.zst go-tangerine-1.3.4.zip |
Merge pull request #2258 from obscuren/release/1.3.4v1.3.4
Homestead Release Candidate
Diffstat (limited to 'tests/state_test.go')
-rw-r--r-- | tests/state_test.go | 207 |
1 files changed, 207 insertions, 0 deletions
diff --git a/tests/state_test.go b/tests/state_test.go index 245f60597..4c1820944 100644 --- a/tests/state_test.go +++ b/tests/state_test.go @@ -17,11 +17,13 @@ package tests import ( + "math/big" "os" "path/filepath" "testing" "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" ) func init() { @@ -39,6 +41,8 @@ func BenchmarkStateCall1024(b *testing.B) { } func TestStateSystemOperations(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stSystemOperationsTest.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -46,6 +50,8 @@ func TestStateSystemOperations(t *testing.T) { } func TestStateExample(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stExample.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -53,6 +59,8 @@ func TestStateExample(t *testing.T) { } func TestStatePreCompiledContracts(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stPreCompiledContracts.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -60,6 +68,8 @@ func TestStatePreCompiledContracts(t *testing.T) { } func TestStateRecursiveCreate(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stRecursiveCreate.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -67,6 +77,8 @@ func TestStateRecursiveCreate(t *testing.T) { } func TestStateSpecial(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stSpecialTest.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -74,6 +86,8 @@ func TestStateSpecial(t *testing.T) { } func TestStateRefund(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stRefundTest.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -81,6 +95,8 @@ func TestStateRefund(t *testing.T) { } func TestStateBlockHash(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stBlockHashTest.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -88,6 +104,8 @@ func TestStateBlockHash(t *testing.T) { } func TestStateInitCode(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stInitCodeTest.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -95,6 +113,8 @@ func TestStateInitCode(t *testing.T) { } func TestStateLog(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stLogTests.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -102,13 +122,26 @@ func TestStateLog(t *testing.T) { } func TestStateTransaction(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stTransactionTest.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) } } +func TestStateTransition(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + + fn := filepath.Join(stateTestDir, "stTransitionTest.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + func TestCallCreateCallCode(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stCallCreateCallCodeTest.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -116,13 +149,26 @@ func TestCallCreateCallCode(t *testing.T) { } func TestCallCodes(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stCallCodes.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) } } +func TestDelegateCall(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + + fn := filepath.Join(stateTestDir, "stDelegatecallTest.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + func TestMemory(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stMemoryTest.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -130,6 +176,8 @@ func TestMemory(t *testing.T) { } func TestMemoryStress(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + if os.Getenv("TEST_VM_COMPLEX") == "" { t.Skip() } @@ -140,6 +188,8 @@ func TestMemoryStress(t *testing.T) { } func TestQuadraticComplexity(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + if os.Getenv("TEST_VM_COMPLEX") == "" { t.Skip() } @@ -150,6 +200,8 @@ func TestQuadraticComplexity(t *testing.T) { } func TestSolidity(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stSolidityTest.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -157,6 +209,8 @@ func TestSolidity(t *testing.T) { } func TestWallet(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fn := filepath.Join(stateTestDir, "stWalletTest.json") if err := RunStateTest(fn, StateSkipTests); err != nil { t.Error(err) @@ -164,6 +218,8 @@ func TestWallet(t *testing.T) { } func TestStateTestsRandom(t *testing.T) { + params.HomesteadBlock = big.NewInt(1000000) + fns, _ := filepath.Glob("./files/StateTests/RandomTests/*") for _, fn := range fns { if err := RunStateTest(fn, StateSkipTests); err != nil { @@ -171,3 +227,154 @@ func TestStateTestsRandom(t *testing.T) { } } } + +// homestead tests +func TestHomesteadStateSystemOperations(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stSystemOperationsTest.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadStatePreCompiledContracts(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stPreCompiledContracts.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadStateRecursiveCreate(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stRecursiveCreate.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadStateSpecial(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stSpecialTest.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadStateRefund(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stRefundTest.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadStateInitCode(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stInitCodeTest.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadStateLog(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stLogTests.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadStateTransaction(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stTransactionTest.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadCallCreateCallCode(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stCallCreateCallCodeTest.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadCallCodes(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stCallCodes.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadMemory(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stMemoryTest.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadMemoryStress(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + if os.Getenv("TEST_VM_COMPLEX") == "" { + t.Skip() + } + fn := filepath.Join(stateTestDir, "Homestead", "stMemoryStressTest.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadQuadraticComplexity(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + if os.Getenv("TEST_VM_COMPLEX") == "" { + t.Skip() + } + fn := filepath.Join(stateTestDir, "Homestead", "stQuadraticComplexityTest.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadWallet(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stWalletTest.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadDelegateCodes(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stCallDelegateCodes.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} + +func TestHomesteadDelegateCodesCallCode(t *testing.T) { + params.HomesteadBlock = big.NewInt(0) + + fn := filepath.Join(stateTestDir, "Homestead", "stCallDelegateCodesCallCode.json") + if err := RunStateTest(fn, StateSkipTests); err != nil { + t.Error(err) + } +} |