diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 7ca924ac1..bee191fcb 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -64,47 +64,6 @@ int constexpr roundTo32(int _num) return (_num + 31) / 32 * 32; } -BOOST_AUTO_TEST_CASE(transaction_status) -{ - char const* sourceCode = R"( - contract test { - function f() public { } - function g() public { revert(); } - function h() public { assert(false); } - } - )"; - compileAndRun(sourceCode); - callContractFunction("f()"); - BOOST_CHECK(m_transactionSuccessful); - callContractFunction("g()"); - BOOST_CHECK(!m_transactionSuccessful); - callContractFunction("h()"); - BOOST_CHECK(!m_transactionSuccessful); -} - - -BOOST_AUTO_TEST_CASE(smoke_test) -{ - char const* sourceCode = R"( - contract test { - function f(uint a) public returns(uint d) { return a * 7; } - } - )"; - compileAndRun(sourceCode); - testContractAgainstCppOnRange("f(uint256)", [](u256 const& a) -> u256 { return a * 7; }, 0, 100); -} - -BOOST_AUTO_TEST_CASE(empty_contract) -{ - char const* sourceCode = R"( - contract test { } - )"; - ALSO_VIA_YUL( - compileAndRun(sourceCode); - BOOST_CHECK(callContractFunction("i_am_not_there()", bytes()).empty()); - ) -} - BOOST_AUTO_TEST_CASE(exp_operator) { char const* sourceCode = R"( diff --git a/test/libsolidity/semanticTests/empty_contract.sol b/test/libsolidity/semanticTests/empty_contract.sol new file mode 100644 index 000000000..8950f01d1 --- /dev/null +++ b/test/libsolidity/semanticTests/empty_contract.sol @@ -0,0 +1,6 @@ +contract test { +} +// ==== +// compileViaYul: also +// ---- +// i_am_not_there() -> FAILURE diff --git a/test/libsolidity/semanticTests/functionCall/transaction_status.sol b/test/libsolidity/semanticTests/functionCall/transaction_status.sol new file mode 100644 index 000000000..6651630d5 --- /dev/null +++ b/test/libsolidity/semanticTests/functionCall/transaction_status.sol @@ -0,0 +1,9 @@ +contract test { + function f() public { } + function g() public { revert(); } + function h() public { assert(false); } +} +// ---- +// f() -> +// g() -> FAILURE +// h() -> FAILURE diff --git a/test/libsolidity/semanticTests/smoke_test.sol b/test/libsolidity/semanticTests/smoke_test.sol index 7a87151b3..6e5cd9c6a 100644 --- a/test/libsolidity/semanticTests/smoke_test.sol +++ b/test/libsolidity/semanticTests/smoke_test.sol @@ -33,6 +33,9 @@ contract C { function p() public returns (string memory, uint, string memory) { return ("any", 42, "any"); } + function q(uint a) public returns (uint d) { + return a * 7; + } } // ---- // constructor(): 3 -> @@ -51,3 +54,5 @@ contract C { // n() -> 0x20, 3, "any" // o() -> 0x40, 0x80, 3, "any", 3, "any" // p() -> 0x60, 0x2a, 0xa0, 3, "any", 3, "any" +// q(uint256): 0 -> 0 +// q(uint256): 99 -> 693