aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-10-20 01:51:12 +0800
committerYoichi Hirai <i@yoichihirai.com>2017-01-23 22:25:13 +0800
commit133d1c05e1ea1ae505e84df4c0660942f614bb3a (patch)
tree70e1e040c9de50e09aa8140fde31b6c51d86efa3 /test
parent4fd3641ce5f80b54463a5f5c8aade6c5112070a3 (diff)
downloaddexon-solidity-133d1c05e1ea1ae505e84df4c0660942f614bb3a.tar
dexon-solidity-133d1c05e1ea1ae505e84df4c0660942f614bb3a.tar.gz
dexon-solidity-133d1c05e1ea1ae505e84df4c0660942f614bb3a.tar.bz2
dexon-solidity-133d1c05e1ea1ae505e84df4c0660942f614bb3a.tar.lz
dexon-solidity-133d1c05e1ea1ae505e84df4c0660942f614bb3a.tar.xz
dexon-solidity-133d1c05e1ea1ae505e84df4c0660942f614bb3a.tar.zst
dexon-solidity-133d1c05e1ea1ae505e84df4c0660942f614bb3a.zip
test: fixing inconsistent usage of end-to-end test framework
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 2411e7ff..6163790b 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -2761,6 +2761,7 @@ BOOST_AUTO_TEST_CASE(event_no_arguments)
}
}
)";
+
compileAndRun(sourceCode);
callContractFunction("deposit()");
BOOST_REQUIRE_EQUAL(m_logs.size(), 1);
@@ -2810,6 +2811,8 @@ BOOST_AUTO_TEST_CASE(events_with_same_name)
}
}
)";
+ u160 const c_loggedAddress = m_contractAddress;
+
compileAndRun(sourceCode);
callContractFunction("deposit()");
BOOST_REQUIRE_EQUAL(m_logs.size(), 1);
@@ -2818,17 +2821,17 @@ BOOST_AUTO_TEST_CASE(events_with_same_name)
BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 1);
BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::keccak256(string("Deposit()")));
- callContractFunction("deposit(0xabcdeabcdeabcdeabcde)");
+ callContractFunction("deposit(address)", c_loggedAddress);
BOOST_REQUIRE_EQUAL(m_logs.size(), 2);
BOOST_CHECK_EQUAL(m_logs[1].address, m_contractAddress);
- BOOST_CHECK(m_logs[1].data == encodeArgs(0));
+ BOOST_CHECK(m_logs[1].data == encodeArgs(c_loggedAddress));
BOOST_REQUIRE_EQUAL(m_logs[1].topics.size(), 1);
BOOST_CHECK_EQUAL(m_logs[1].topics[0], dev::keccak256(string("Deposit(address)")));
- callContractFunction("deposit(0xabcdeabcdeabcdeabcde, 100)");
+ callContractFunction("deposit(address, uint256)", c_loggedAddress, u256(100));
BOOST_REQUIRE_EQUAL(m_logs.size(), 3);
BOOST_CHECK_EQUAL(m_logs[2].address, m_contractAddress);
- BOOST_CHECK(m_logs[2].data == encodeArgs(0,100));
+ BOOST_CHECK(m_logs[2].data == encodeArgs(c_loggedAddress, 100));
BOOST_REQUIRE_EQUAL(m_logs[2].topics.size(), 1);
BOOST_CHECK_EQUAL(m_logs[2].topics[0], dev::keccak256(string("Deposit(address,uint256)")));
}