From 375e4ac48b1c440a562ca448096b3580dfc0e720 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 24 Feb 2015 19:39:47 +0100 Subject: [PATCH] add test for quadratic complexity remove file with wrong name --- test/stQuadraticComplexityTestFiller.json | 49 +++++++++++++++++++++++ test/stSystemOperationsTestFiller.json | 48 ++++++++++++++++++++++ test/state.cpp | 5 +++ test/stquadraticcomplexitytestfiller.json | 1 - 4 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 test/stQuadraticComplexityTestFiller.json delete mode 100644 test/stquadraticcomplexitytestfiller.json diff --git a/test/stQuadraticComplexityTestFiller.json b/test/stQuadraticComplexityTestFiller.json new file mode 100644 index 000000000..f474cb214 --- /dev/null +++ b/test/stQuadraticComplexityTestFiller.json @@ -0,0 +1,49 @@ +{ + "Call50000" : { + "env" : { + "currentCoinbase" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "currentDifficulty" : "45678256", + "currentGasLimit" : "0xffffffffffffffffffffffffffffffff", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : + { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0xffffffffffffffffffffffffffffffff", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + + "aaaf5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "7000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + + "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000", + "code" : "{ (for {} (< @i 100) [i](+ @i 1) [[ 0 ]](CALL 0xfffffffffff 0xaaaf5374fce5edbc8e2a8697c15331677e6ebf0b 1 0 50000 0 0) ) [[ 1 ]] @i}", + "nonce" : "0", + "storage" : { + } + } + }, + + "transaction" : + { + "data" : "", + "gasLimit" : "0xffffffffffffffffffffffffffffff", + "gasPrice" : "1", + "nonce" : "", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b", + "value" : "10" + } + } +} diff --git a/test/stSystemOperationsTestFiller.json b/test/stSystemOperationsTestFiller.json index 9fbfbe252..3b08ca67b 100644 --- a/test/stSystemOperationsTestFiller.json +++ b/test/stSystemOperationsTestFiller.json @@ -2268,5 +2268,53 @@ "secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data": "" } + }, + + "Call10" : { + "env" : { + "currentCoinbase" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "currentDifficulty" : "45678256", + "currentGasLimit" : "0xffffffffffffffffffffffffffffffff", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : + { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0xffffffffffffffffffffffffffffffff", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + + "aaaf5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "7000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + + "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000", + "code" : "{ (for {} (< @i 10) [i](+ @i 1) [[ 0 ]](CALL 0xfffffffffff 0xaaaf5374fce5edbc8e2a8697c15331677e6ebf0b 1 0 50000 0 0) ) [[ 1 ]] @i}", + "nonce" : "0", + "storage" : { + } + } + }, + + "transaction" : + { + "data" : "", + "gasLimit" : "0xffffffffffffffffffffffffffffff", + "gasPrice" : "1", + "nonce" : "", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b", + "value" : "10" + } } } diff --git a/test/state.cpp b/test/state.cpp index 03f01d0fb..4e955df49 100644 --- a/test/state.cpp +++ b/test/state.cpp @@ -159,6 +159,11 @@ BOOST_AUTO_TEST_CASE(stBlockHashTest) dev::test::executeTests("stBlockHashTest", "/StateTests", dev::test::doStateTests); } +BOOST_AUTO_TEST_CASE(stQuadraticComplexityTest) +{ + dev::test::executeTests("stQuadraticComplexityTest", "/StateTests", dev::test::doStateTests); +} + BOOST_AUTO_TEST_CASE(stSolidityTest) { dev::test::executeTests("stSolidityTest", "/StateTests", dev::test::doStateTests); diff --git a/test/stquadraticcomplexitytestfiller.json b/test/stquadraticcomplexitytestfiller.json deleted file mode 100644 index 8b1378917..000000000 --- a/test/stquadraticcomplexitytestfiller.json +++ /dev/null @@ -1 +0,0 @@ -