aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-22 23:39:29 +0800
committerchriseth <chris@ethereum.org>2017-06-22 23:39:29 +0800
commitf36e021ffc4aca746730b88195d492e3c73ceb62 (patch)
treee428dd774184dadd1288c4cdc3089aae971607bd
parent0868a50eb1d0014fc582ab8bfdf6db0bb9d385ab (diff)
downloaddexon-solidity-f36e021ffc4aca746730b88195d492e3c73ceb62.tar
dexon-solidity-f36e021ffc4aca746730b88195d492e3c73ceb62.tar.gz
dexon-solidity-f36e021ffc4aca746730b88195d492e3c73ceb62.tar.bz2
dexon-solidity-f36e021ffc4aca746730b88195d492e3c73ceb62.tar.lz
dexon-solidity-f36e021ffc4aca746730b88195d492e3c73ceb62.tar.xz
dexon-solidity-f36e021ffc4aca746730b88195d492e3c73ceb62.tar.zst
dexon-solidity-f36e021ffc4aca746730b88195d492e3c73ceb62.zip
Test for passing empty string literal as function argument.
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index ba507e0c..823a8eda 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -9469,6 +9469,29 @@ BOOST_AUTO_TEST_CASE(revert)
BOOST_CHECK(callContractFunction("a()") == encodeArgs(u256(42)));
}
+BOOST_AUTO_TEST_CASE(literal_empty_string)
+{
+ char const* sourceCode = R"(
+ contract C {
+ bytes32 public x;
+ uint public a;
+ function f(bytes32 _x, uint _a) {
+ x = _x;
+ a = _a;
+ }
+ function g() {
+ this.f("", 2);
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "C");
+ BOOST_CHECK(callContractFunction("x()") == encodeArgs(u256(0)));
+ BOOST_CHECK(callContractFunction("a()") == encodeArgs(u256(0)));
+ BOOST_CHECK(callContractFunction("g()") == encodeArgs());
+ BOOST_CHECK(callContractFunction("x()") == encodeArgs(u256(0)));
+ BOOST_CHECK(callContractFunction("a()") == encodeArgs(u256(2)));
+}
+
BOOST_AUTO_TEST_CASE(scientific_notation)
{
char const* sourceCode = R"(