aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-11-22 20:33:11 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-12-12 17:39:26 +0800
commit5226d54ed16bb7247c64ac67fec786301a3210ec (patch)
treebed3f42a8f7e8315db852664b2f33495c173c553 /test
parent45d0992ce8dc3b3eb581e76d2c1fb2fbeabe3cfe (diff)
downloaddexon-solidity-5226d54ed16bb7247c64ac67fec786301a3210ec.tar.gz
dexon-solidity-5226d54ed16bb7247c64ac67fec786301a3210ec.tar.zst
dexon-solidity-5226d54ed16bb7247c64ac67fec786301a3210ec.zip
Improve error message for constant evaluator
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 39dba0de..d141361f 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2109,7 +2109,7 @@ BOOST_AUTO_TEST_CASE(array_with_nonconstant_length)
function f(uint a) public { uint8[a] x; }
}
)";
- CHECK_ERROR(text, TypeError, "Identifier must be declared constant.");
+ CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
}
BOOST_AUTO_TEST_CASE(array_with_negative_length)
@@ -4398,7 +4398,7 @@ BOOST_AUTO_TEST_CASE(invalid_array_declaration_with_signed_fixed_type)
}
}
)";
- CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal.");
+ CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
}
BOOST_AUTO_TEST_CASE(invalid_array_declaration_with_unsigned_fixed_type)
@@ -4410,7 +4410,7 @@ BOOST_AUTO_TEST_CASE(invalid_array_declaration_with_unsigned_fixed_type)
}
}
)";
- CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal.");
+ CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
}
BOOST_AUTO_TEST_CASE(rational_to_bytes_implicit_conversion)
@@ -7254,7 +7254,7 @@ BOOST_AUTO_TEST_CASE(array_length_too_large)
uint[8**90] ids;
}
)";
- CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal.");
+ CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
}
BOOST_AUTO_TEST_CASE(array_length_not_convertible_to_integer)
@@ -7264,7 +7264,7 @@ BOOST_AUTO_TEST_CASE(array_length_not_convertible_to_integer)
uint[true] ids;
}
)";
- CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal.");
+ CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
}
BOOST_AUTO_TEST_CASE(array_length_constant_var)
@@ -7286,7 +7286,7 @@ BOOST_AUTO_TEST_CASE(array_length_non_integer_constant_var)
uint[LEN] ids;
}
)";
- CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal.");
+ CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
}
BOOST_AUTO_TEST_CASE(array_length_cannot_be_function)
@@ -7297,7 +7297,7 @@ BOOST_AUTO_TEST_CASE(array_length_cannot_be_function)
uint[f] ids;
}
)";
- CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal.");
+ CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
}
BOOST_AUTO_TEST_CASE(array_length_can_be_recursive_constant)
@@ -7321,7 +7321,7 @@ BOOST_AUTO_TEST_CASE(array_length_cannot_be_function_call)
uint[LEN] ids;
}
)";
- CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal.");
+ CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
}
BOOST_AUTO_TEST_CASE(array_length_const_cannot_be_fractional)
@@ -7409,7 +7409,7 @@ BOOST_AUTO_TEST_CASE(array_length_with_pure_functions)
uint[LEN] ids;
}
)";
- CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal.");
+ CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
}
BOOST_AUTO_TEST_CASE(array_length_invalid_expression)