aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/GasMeter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/GasMeter.cpp')
-rw-r--r--test/libsolidity/GasMeter.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp
index fd2017f9..0d66456c 100644
--- a/test/libsolidity/GasMeter.cpp
+++ b/test/libsolidity/GasMeter.cpp
@@ -294,6 +294,19 @@ BOOST_AUTO_TEST_CASE(extcodesize_gas)
testRunTimeGas("f()", vector<bytes>{encodeArgs()});
}
+BOOST_AUTO_TEST_CASE(regular_functions_exclude_fallback)
+{
+ // A bug in the estimator caused the costs for a specific function
+ // to always include the costs for the fallback.
+ char const* sourceCode = R"(
+ contract A {
+ uint public x;
+ function() { x = 2; }
+ }
+ )";
+ testCreationTimeGas(sourceCode);
+ testRunTimeGas("x()", vector<bytes>{encodeArgs()});
+}
BOOST_AUTO_TEST_SUITE_END()
}