Merge pull request #6355 from ethereum/test-consistency

Exclude metadata in compiler test
This commit is contained in:
chriseth 2019-03-25 10:22:51 +01:00 committed by GitHub
commit cc4d30a7ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@
*/
#include <test/libsolidity/AnalysisFramework.h>
#include <test/Metadata.h>
#include <test/Options.h>
using namespace std;
@ -31,7 +31,7 @@ namespace solidity
namespace test
{
BOOST_FIXTURE_TEST_SUITE(Compiler, AnalysisFramework)
BOOST_FIXTURE_TEST_SUITE(SolidityCompiler, AnalysisFramework)
BOOST_AUTO_TEST_CASE(does_not_include_creation_time_only_internal_functions)
{
@ -45,12 +45,12 @@ BOOST_AUTO_TEST_CASE(does_not_include_creation_time_only_internal_functions)
m_compiler.setOptimiserSettings(dev::test::Options::get().optimize);
BOOST_REQUIRE(success(sourceCode));
BOOST_REQUIRE_MESSAGE(m_compiler.compile(), "Compiling contract failed");
bytes const& creationBytecode = m_compiler.object("C").bytecode;
bytes const& runtimeBytecode = m_compiler.runtimeObject("C").bytecode;
BOOST_CHECK(creationBytecode.size() >= 130);
BOOST_CHECK(creationBytecode.size() <= 160);
BOOST_CHECK(runtimeBytecode.size() >= 50);
BOOST_CHECK(runtimeBytecode.size() <= 70);
bytes const& creationBytecode = dev::test::bytecodeSansMetadata(m_compiler.object("C").bytecode);
bytes const& runtimeBytecode = dev::test::bytecodeSansMetadata(m_compiler.runtimeObject("C").bytecode);
BOOST_CHECK(creationBytecode.size() >= 90);
BOOST_CHECK(creationBytecode.size() <= 120);
BOOST_CHECK(runtimeBytecode.size() >= 10);
BOOST_CHECK(runtimeBytecode.size() <= 30);
}
BOOST_AUTO_TEST_SUITE_END()