Browse Source

Some windows fixes.

cl-refactor
Christian 10 years ago
parent
commit
a88377e5cb
  1. 2
      libsolidity/CompilerContext.cpp
  2. 12
      test/SolidityEndToEndTest.cpp

2
libsolidity/CompilerContext.cpp

@ -76,7 +76,7 @@ bytes const& CompilerContext::getCompiledContract(const ContractDefinition& _con
bool CompilerContext::isLocalVariable(Declaration const* _declaration) const
{
return m_localVariables.count(_declaration);
return !!m_localVariables.count(_declaration);
}
eth::AssemblyItem CompilerContext::getFunctionEntryLabel(Declaration const& _declaration)

12
test/SolidityEndToEndTest.cpp

@ -963,7 +963,7 @@ BOOST_AUTO_TEST_CASE(multiple_elementary_accessors)
compileAndRun(sourceCode);
BOOST_CHECK(callContractFunction("data()") == encodeArgs(8));
BOOST_CHECK(callContractFunction("name()") == encodeArgs("Celina"));
BOOST_CHECK(callContractFunction("a_hash()") == encodeArgs(dev::sha3(bytes({0x7b}))));
BOOST_CHECK(callContractFunction("a_hash()") == encodeArgs(dev::sha3(bytes{0x7b})));
BOOST_CHECK(callContractFunction("an_address()") == encodeArgs(toBigEndian(u160(0x1337))));
BOOST_CHECK(callContractFunction("super_secret_data()") == bytes());
}
@ -2202,8 +2202,8 @@ BOOST_AUTO_TEST_CASE(sha3_multiple_arguments_with_numeric_literals)
BOOST_CHECK(callContractFunction("foo(uint256,uint16)", 10, 12) == encodeArgs(
dev::sha3(
toBigEndian(u256(10)) +
bytes({0x0, 0xc}) +
bytes({0x91}))));
bytes{0x0, 0xc} +
bytes{0x91})));
}
BOOST_AUTO_TEST_CASE(sha3_multiple_arguments_with_string_literals)
@ -2226,9 +2226,9 @@ BOOST_AUTO_TEST_CASE(sha3_multiple_arguments_with_string_literals)
BOOST_CHECK(callContractFunction("bar(uint256,uint16)", 10, 12) == encodeArgs(
dev::sha3(
toBigEndian(u256(10)) +
bytes({0x0, 0xc}) +
bytes({0x91}) +
bytes({0x66, 0x6f, 0x6f}))));
bytes{0x0, 0xc} +
bytes{0x91} +
bytes{0x66, 0x6f, 0x6f})));
}
BOOST_AUTO_TEST_CASE(generic_call)

Loading…
Cancel
Save