Update soltest related tests.

This commit is contained in:
Alexander Arlt 2019-09-19 14:31:42 -05:00
parent 54c5e604e5
commit e87924a96e
6 changed files with 17 additions and 17 deletions

View File

@ -45,12 +45,12 @@ namespace
static char const* registrarCode = R"DELIMITER( static char const* registrarCode = R"DELIMITER(
pragma solidity >=0.4.0 <0.7.0; pragma solidity >=0.4.0 <0.7.0;
contract NameRegister { abstract contract NameRegister {
function addr(string memory _name) public view returns (address o_owner); function addr(string memory _name) public view returns (address o_owner);
function name(address _owner) public view returns (string memory o_name); function name(address _owner) public view returns (string memory o_name);
} }
contract Registrar is NameRegister { abstract contract Registrar is NameRegister {
event Changed(string indexed name); event Changed(string indexed name);
event PrimaryChanged(string indexed name, address indexed addr); event PrimaryChanged(string indexed name, address indexed addr);
@ -62,7 +62,7 @@ contract Registrar is NameRegister {
function name(address _owner) public override view returns (string memory o_name); function name(address _owner) public override view returns (string memory o_name);
} }
contract AuctionSystem { abstract contract AuctionSystem {
event AuctionEnded(string indexed _name, address _winner); event AuctionEnded(string indexed _name, address _winner);
event NewBid(string indexed _name, address _bidder, uint _value); event NewBid(string indexed _name, address _bidder, uint _value);

View File

@ -55,7 +55,7 @@ static char const* registrarCode = R"DELIMITER(
pragma solidity >=0.4.0 <0.7.0; pragma solidity >=0.4.0 <0.7.0;
contract Registrar { abstract contract Registrar {
event Changed(string indexed name); event Changed(string indexed name);
function owner(string memory _name) public view returns (address o_owner); function owner(string memory _name) public view returns (address o_owner);

View File

@ -276,7 +276,7 @@ contract multiowned {
// inheritable "property" contract that enables methods to be protected by placing a linear limit (specifiable) // inheritable "property" contract that enables methods to be protected by placing a linear limit (specifiable)
// on a particular resource per calendar day. is multiowned to allow the limit to be altered. resource that method // on a particular resource per calendar day. is multiowned to allow the limit to be altered. resource that method
// uses is specified in the modifier. // uses is specified in the modifier.
contract daylimit is multiowned { abstract contract daylimit is multiowned {
// MODIFIERS // MODIFIERS
@ -330,7 +330,7 @@ contract daylimit is multiowned {
} }
// interface contract for multisig proxy contracts; see below for docs. // interface contract for multisig proxy contracts; see below for docs.
contract multisig { abstract contract multisig {
// EVENTS // EVENTS

View File

@ -5446,7 +5446,7 @@ BOOST_AUTO_TEST_CASE(pass_dynamic_arguments_to_the_base_base_with_gap)
} }
uint public m_i; uint public m_i;
} }
contract Base1 is Base { abstract contract Base1 is Base {
constructor(uint k) public {} constructor(uint k) public {}
} }
contract Derived is Base, Base1 { contract Derived is Base, Base1 {
@ -10483,7 +10483,7 @@ BOOST_AUTO_TEST_CASE(mutex)
BOOST_AUTO_TEST_CASE(calling_nonexisting_contract_throws) BOOST_AUTO_TEST_CASE(calling_nonexisting_contract_throws)
{ {
char const* sourceCode = R"YY( char const* sourceCode = R"YY(
contract D { function g() public; } abstract contract D { function g() public; }
contract C { contract C {
D d = D(0x1212); D d = D(0x1212);
function f() public returns (uint) { function f() public returns (uint) {

View File

@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE(function_no_implementation)
{ {
SourceUnit const* sourceUnit = nullptr; SourceUnit const* sourceUnit = nullptr;
char const* text = R"( char const* text = R"(
contract test { abstract contract test {
function functionName(bytes32 input) public returns (bytes32 out); function functionName(bytes32 input) public returns (bytes32 out);
} }
)"; )";
@ -64,8 +64,8 @@ BOOST_AUTO_TEST_CASE(abstract_contract)
{ {
SourceUnit const* sourceUnit = nullptr; SourceUnit const* sourceUnit = nullptr;
char const* text = R"( char const* text = R"(
contract base { function foo() public; } abstract contract base { function foo() public; }
contract derived is base { function foo() public override {} } contract derived is base { function foo() public {} }
)"; )";
sourceUnit = parseAndAnalyse(text); sourceUnit = parseAndAnalyse(text);
std::vector<ASTPointer<ASTNode>> nodes = sourceUnit->nodes(); std::vector<ASTPointer<ASTNode>> nodes = sourceUnit->nodes();
@ -83,8 +83,8 @@ BOOST_AUTO_TEST_CASE(abstract_contract_with_overload)
{ {
SourceUnit const* sourceUnit = nullptr; SourceUnit const* sourceUnit = nullptr;
char const* text = R"( char const* text = R"(
contract base { function foo(bool) public; } abstract contract base { function foo(bool) public; }
contract derived is base { function foo(uint) public {} } abstract contract derived is base { function foo(uint) public {} }
)"; )";
sourceUnit = parseAndAnalyse(text); sourceUnit = parseAndAnalyse(text);
std::vector<ASTPointer<ASTNode>> nodes = sourceUnit->nodes(); std::vector<ASTPointer<ASTNode>> nodes = sourceUnit->nodes();
@ -100,8 +100,8 @@ BOOST_AUTO_TEST_CASE(implement_abstract_via_constructor)
{ {
SourceUnit const* sourceUnit = nullptr; SourceUnit const* sourceUnit = nullptr;
char const* text = R"( char const* text = R"(
contract base { function foo() public; } abstract contract base { function foo() public; }
contract foo is base { constructor() public {} } abstract contract foo is base { constructor() public {} }
)"; )";
sourceUnit = parseAndAnalyse(text); sourceUnit = parseAndAnalyse(text);
std::vector<ASTPointer<ASTNode>> nodes = sourceUnit->nodes(); std::vector<ASTPointer<ASTNode>> nodes = sourceUnit->nodes();
@ -356,7 +356,7 @@ BOOST_AUTO_TEST_CASE(string)
BOOST_AUTO_TEST_CASE(dynamic_return_types_not_possible) BOOST_AUTO_TEST_CASE(dynamic_return_types_not_possible)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract C { abstract contract C {
function f(uint) public returns (string memory); function f(uint) public returns (string memory);
function g() public { function g() public {
string memory x = this.f(2); string memory x = this.f(2);

View File

@ -427,7 +427,7 @@ BOOST_AUTO_TEST_CASE(basic_compilation)
BOOST_CHECK_EQUAL( BOOST_CHECK_EQUAL(
dev::jsonCompactPrint(result["sources"]["fileA"]["legacyAST"]), dev::jsonCompactPrint(result["sources"]["fileA"]["legacyAST"]),
"{\"attributes\":{\"absolutePath\":\"fileA\",\"exportedSymbols\":{\"A\":[1]}},\"children\":" "{\"attributes\":{\"absolutePath\":\"fileA\",\"exportedSymbols\":{\"A\":[1]}},\"children\":"
"[{\"attributes\":{\"baseContracts\":[null],\"contractDependencies\":[null],\"contractKind\":\"contract\"," "[{\"attributes\":{\"abstract\":false,\"baseContracts\":[null],\"contractDependencies\":[null],\"contractKind\":\"contract\","
"\"documentation\":null,\"fullyImplemented\":true,\"linearizedBaseContracts\":[1],\"name\":\"A\",\"nodes\":[null],\"scope\":2}," "\"documentation\":null,\"fullyImplemented\":true,\"linearizedBaseContracts\":[1],\"name\":\"A\",\"nodes\":[null],\"scope\":2},"
"\"id\":1,\"name\":\"ContractDefinition\",\"src\":\"0:14:0\"}],\"id\":2,\"name\":\"SourceUnit\",\"src\":\"0:14:0\"}" "\"id\":1,\"name\":\"ContractDefinition\",\"src\":\"0:14:0\"}],\"id\":2,\"name\":\"SourceUnit\",\"src\":\"0:14:0\"}"
); );