mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Check that functions exist in isoltest.
This commit is contained in:
committed by
Mathias Baumann
parent
f31332533f
commit
9aed40ab19
@@ -114,6 +114,9 @@ string TestFunctionCall::format(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_calledNonExistingFunction)
|
||||
_errorReporter.warning("The function \"" + m_call.signature + "\" is not known to the compiler.");
|
||||
|
||||
bytes output = m_rawBytes;
|
||||
bool const isFailure = m_failure;
|
||||
result = isFailure ?
|
||||
@@ -300,6 +303,7 @@ void TestFunctionCall::reset()
|
||||
{
|
||||
m_rawBytes = bytes{};
|
||||
m_failure = true;
|
||||
m_calledNonExistingFunction = false;
|
||||
}
|
||||
|
||||
bool TestFunctionCall::matchesExpectation() const
|
||||
|
||||
@@ -77,6 +77,7 @@ public:
|
||||
void reset();
|
||||
|
||||
FunctionCall const& call() const { return m_call; }
|
||||
void calledNonExistingFunction() { m_calledNonExistingFunction = true; }
|
||||
void setFailure(const bool _failure) { m_failure = _failure; }
|
||||
void setRawBytes(const bytes _rawBytes) { m_rawBytes = _rawBytes; }
|
||||
void setContractABI(Json::Value _contractABI) { m_contractABI = std::move(_contractABI); }
|
||||
@@ -129,6 +130,8 @@ private:
|
||||
/// JSON object which holds the contract ABI and that is used to set the output formatting
|
||||
/// in the interactive update routine.
|
||||
Json::Value m_contractABI;
|
||||
/// Flags that the test failed because the called function is not known to exist on the contract.
|
||||
bool m_calledNonExistingFunction = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user