diff options
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/ASTJSON.cpp | 2 | ||||
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 12 | ||||
-rw-r--r-- | test/libsolidity/SolidityTypes.cpp | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/test/libsolidity/ASTJSON.cpp b/test/libsolidity/ASTJSON.cpp index 4fb4f20c..31165922 100644 --- a/test/libsolidity/ASTJSON.cpp +++ b/test/libsolidity/ASTJSON.cpp @@ -221,7 +221,7 @@ BOOST_AUTO_TEST_CASE(function_type) Json::Value retval = fun["children"][1]["children"][0]; BOOST_CHECK_EQUAL(retval["name"], "VariableDeclaration"); BOOST_CHECK_EQUAL(retval["attributes"]["name"], ""); - BOOST_CHECK_EQUAL(retval["attributes"]["type"], "function () constant external returns (uint256)"); + BOOST_CHECK_EQUAL(retval["attributes"]["type"], "function () view external returns (uint256)"); funType = retval["children"][0]; BOOST_CHECK_EQUAL(funType["attributes"]["constant"], true); BOOST_CHECK_EQUAL(funType["attributes"]["payable"], false); diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 1c83e1a3..fb2686fc 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -933,7 +933,7 @@ BOOST_AUTO_TEST_CASE(illegal_override_remove_constness) contract B { function f() constant {} } contract C is B { function f() {} } )"; - CHECK_ERROR(text, TypeError, "Overriding function should be declared constant."); + CHECK_ERROR(text, TypeError, "Overriding function changes state mutability from \"view\" to \"nonpayable\"."); } BOOST_AUTO_TEST_CASE(illegal_override_add_constness) @@ -942,7 +942,7 @@ BOOST_AUTO_TEST_CASE(illegal_override_add_constness) contract B { function f() {} } contract C is B { function f() constant {} } )"; - CHECK_ERROR(text, TypeError, "Overriding function should not be declared constant."); + CHECK_ERROR(text, TypeError, "Overriding function changes state mutability from \"nonpayable\" to \"view\"."); } BOOST_AUTO_TEST_CASE(complex_inheritance) @@ -1363,7 +1363,7 @@ BOOST_AUTO_TEST_CASE(fallback_function_with_constant_modifier) function() constant { x = 2; } } )"; - CHECK_ERROR(text, TypeError, "Fallback function cannot be declared constant."); + CHECK_ERROR(text, TypeError, "Fallback function must be payable or non-payable"); } BOOST_AUTO_TEST_CASE(fallback_function_twice) @@ -4779,7 +4779,7 @@ BOOST_AUTO_TEST_CASE(illegal_override_payable) contract B { function f() payable {} } contract C is B { function f() {} } )"; - CHECK_ERROR(text, TypeError, "Overriding function should be declared payable."); + CHECK_ERROR(text, TypeError, "Overriding function changes state mutability from \"payable\" to \"nonpayable\"."); } BOOST_AUTO_TEST_CASE(illegal_override_payable_nonpayable) @@ -4788,7 +4788,7 @@ BOOST_AUTO_TEST_CASE(illegal_override_payable_nonpayable) contract B { function f() {} } contract C is B { function f() payable {} } )"; - CHECK_ERROR(text, TypeError, "Overriding function should not be declared payable."); + CHECK_ERROR(text, TypeError, "Overriding function changes state mutability from \"nonpayable\" to \"payable\"."); } BOOST_AUTO_TEST_CASE(function_variable_mixin) @@ -4873,7 +4873,7 @@ BOOST_AUTO_TEST_CASE(constant_constructor) function test() constant {} } )"; - CHECK_ERROR(text, TypeError, "Constructor cannot be defined as constant."); + CHECK_ERROR(text, TypeError, "Constructor must be payable or non-payable"); } BOOST_AUTO_TEST_CASE(external_constructor) diff --git a/test/libsolidity/SolidityTypes.cpp b/test/libsolidity/SolidityTypes.cpp index 0b5ab516..9f385a04 100644 --- a/test/libsolidity/SolidityTypes.cpp +++ b/test/libsolidity/SolidityTypes.cpp @@ -129,10 +129,10 @@ BOOST_AUTO_TEST_CASE(type_identifiers) BOOST_CHECK_EQUAL(t.identifier(), "t_tuple$_t_type$_t_enum$_Enum_$4_$_$_t_type$_t_struct$_Struct_$3_storage_ptr_$_$_t_array$_t_string_storage_$20_storage_ptr_$__$"); TypePointer sha3fun = make_shared<FunctionType>(strings{}, strings{}, FunctionType::Kind::SHA3); - BOOST_CHECK_EQUAL(sha3fun->identifier(), "t_function_sha3$__$returns$__$"); + BOOST_CHECK_EQUAL(sha3fun->identifier(), "t_function_sha3_nonpayable$__$returns$__$"); FunctionType metaFun(TypePointers{sha3fun}, TypePointers{s.type()}); - BOOST_CHECK_EQUAL(metaFun.identifier(), "t_function_internal$_t_function_sha3$__$returns$__$_$returns$_t_type$_t_struct$_Struct_$3_storage_ptr_$_$"); + BOOST_CHECK_EQUAL(metaFun.identifier(), "t_function_internal_nonpayable$_t_function_sha3_nonpayable$__$returns$__$_$returns$_t_type$_t_struct$_Struct_$3_storage_ptr_$_$"); TypePointer m = make_shared<MappingType>(Type::fromElementaryTypeName("bytes32"), s.type()); MappingType m2(Type::fromElementaryTypeName("uint64"), m); |