aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-12-02 19:03:39 +0800
committerYoichi Hirai <i@yoichihirai.com>2017-01-03 00:58:33 +0800
commit96ca706353f94b60c7e356f11aa7466a15eca33d (patch)
treecc01e31266887a4d7e95f4b82775adef458d6cda
parente079b1c53f3bd2a195e3d2cca1f4de13391835bb (diff)
downloaddexon-solidity-96ca706353f94b60c7e356f11aa7466a15eca33d.tar.gz
dexon-solidity-96ca706353f94b60c7e356f11aa7466a15eca33d.tar.zst
dexon-solidity-96ca706353f94b60c7e356f11aa7466a15eca33d.zip
test: add a test case for #1286
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 94d4fb7f..d8539524 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -2770,6 +2770,28 @@ BOOST_AUTO_TEST_CASE(event_no_arguments)
BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::keccak256(string("Deposit()")));
}
+BOOST_AUTO_TEST_CASE(event_access_through_base_name)
+{
+ char const* sourceCode = R"(
+ contract A {
+ event x();
+ }
+ contract B is A {
+ function f() returns (uint) {
+ A.x();
+ return 1;
+ }
+ }
+ )";
+ compileAndRun(sourceCode);
+ callContractFunction("f()");
+ BOOST_REQUIRE_EQUAL(m_logs.size(), 1);
+ BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress);
+ BOOST_CHECK(m_logs[0].data.empty());
+ BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 1);
+ BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::keccak256(string("x()")));
+}
+
BOOST_AUTO_TEST_CASE(event_anonymous)
{
char const* sourceCode = R"(