From acd1cabb80c78fcc20b5ce04fc7c75e9f26b82da Mon Sep 17 00:00:00 2001 From: Dimitry Kh Date: Sun, 3 Nov 2019 18:35:10 +0300 Subject: [PATCH] adress Andrey's comments --- test/tools/jsontests/BlockChainTests.cpp | 4 ++-- test/tools/jsontests/BlockChainTests.h | 23 ++--------------------- test/tools/jsontests/LegacyTests.h | 12 ++++++------ 3 files changed, 10 insertions(+), 29 deletions(-) diff --git a/test/tools/jsontests/BlockChainTests.cpp b/test/tools/jsontests/BlockChainTests.cpp index 6be80f9c610..3c285b260bd 100644 --- a/test/tools/jsontests/BlockChainTests.cpp +++ b/test/tools/jsontests/BlockChainTests.cpp @@ -1062,7 +1062,7 @@ class bcTransitionFixture { BOOST_AUTO_TEST_SUITE(BlockchainTests) // Tests that contain only valid blocks and check that import is correct -BOOST_FIXTURE_TEST_SUITE(ValidBlocks, bcValidTestFixture) +BOOST_FIXTURE_TEST_SUITE(ValidBlocks, bcTestFixture) BOOST_AUTO_TEST_CASE(bcBlockGasLimitTest) {} BOOST_AUTO_TEST_CASE(bcExploitTest) {} BOOST_AUTO_TEST_CASE(bcForkStressTest) {} @@ -1078,7 +1078,7 @@ BOOST_AUTO_TEST_CASE(bcWalletTest) {} BOOST_AUTO_TEST_SUITE_END() // Tests that might have invalid blocks and check that those are rejected -BOOST_FIXTURE_TEST_SUITE(InvalidBlocks, bcInvalidTestFixture) +BOOST_FIXTURE_TEST_SUITE(InvalidBlocks, bcTestFixture) BOOST_AUTO_TEST_CASE(bcBlockGasLimitTest) {} BOOST_AUTO_TEST_CASE(bcForgedTest) {} BOOST_AUTO_TEST_CASE(bcInvalidHeaderTest) {} diff --git a/test/tools/jsontests/BlockChainTests.h b/test/tools/jsontests/BlockChainTests.h index 1242a18400c..2c570edc67c 100644 --- a/test/tools/jsontests/BlockChainTests.h +++ b/test/tools/jsontests/BlockChainTests.h @@ -45,10 +45,10 @@ class bcGeneralTestsFixture : public StateTestFixtureBase -class bcValidTestFixture +class bcTestFixture { public: - bcValidTestFixture(std::set const& _execFlags = {}) + bcTestFixture(std::set const& _execFlags = {}) { T suite; if (_execFlags.count(TestExecution::NotRefillable) && @@ -71,25 +71,6 @@ class bcValidTestFixture } }; -template -class bcInvalidTestFixture -{ -public: - bcInvalidTestFixture(std::set const& _execFlags = {}) - { - T suite; - if (_execFlags.count(TestExecution::NotRefillable) && - (Options::get().fillchain || Options::get().filltests)) - BOOST_FAIL("Tests are sealed and not refillable!"); - - string const casename = boost::unit_test::framework::current_test_case().p_name; - boost::filesystem::path suiteFillerPath = suite.getFullPathFiller(casename).parent_path(); - - suite.runAllTestsInFolder(casename); - test::TestOutputHelper::get().markTestFolderAsFinished(suiteFillerPath, casename); - } -}; - class TransitionTestsSuite: public TestSuite { json_spirit::mValue doTests(json_spirit::mValue const& _input, bool _fillin) const override; diff --git a/test/tools/jsontests/LegacyTests.h b/test/tools/jsontests/LegacyTests.h index 2c71246fee6..106d9386ed3 100644 --- a/test/tools/jsontests/LegacyTests.h +++ b/test/tools/jsontests/LegacyTests.h @@ -37,7 +37,7 @@ class BCGeneralStateTestsSuiteLegacyConstantinople : public BCGeneralStateTestsS } }; -class BlockchainInvalidTestSuiteLegacyConstantinople : public BlockchainInvalidTestSuite +class LegacyConstantinopleBlockchainInvalidTestSuite : public BlockchainInvalidTestSuite { boost::filesystem::path suiteFolder() const override { @@ -49,7 +49,7 @@ class BlockchainInvalidTestSuiteLegacyConstantinople : public BlockchainInvalidT } }; -class BlockchainValidTestSuiteLegacyConstantinople : public BlockchainValidTestSuite +class LegacyConstantinopleBlockchainValidTestSuite : public BlockchainValidTestSuite { boost::filesystem::path suiteFolder() const override { @@ -81,19 +81,19 @@ class LegacyConstantinopleBCGeneralStateTestFixture }; class LegacyConstantinoplebcInvalidTestFixture - : public bcInvalidTestFixture + : public bcTestFixture { public: LegacyConstantinoplebcInvalidTestFixture() - : bcInvalidTestFixture({TestExecution::NotRefillable}) + : bcTestFixture({TestExecution::NotRefillable}) {} }; class LegacyConstantinoplebcValidTestFixture - : public bcValidTestFixture + : public bcTestFixture { public: - LegacyConstantinoplebcValidTestFixture() : bcValidTestFixture({TestExecution::NotRefillable}) {} + LegacyConstantinoplebcValidTestFixture() : bcTestFixture({TestExecution::NotRefillable}) {} };