From adce9ca812bd0c8a79e1bc924ad70773bb9006b1 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 16 May 2018 15:52:24 +0200 Subject: Tidy up tests to always have closing braces on the proper line --- test/libsolidity/SolidityOptimizer.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 5326feaf..afce1823 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -139,7 +139,8 @@ BOOST_AUTO_TEST_CASE(smoke_test) function f(uint a) returns (uint b) { return a; } - })"; + } + )"; compileBothVersions(sourceCode); compareVersions("f(uint256)", u256(7)); } @@ -151,7 +152,8 @@ BOOST_AUTO_TEST_CASE(identities) function f(int a) returns (int b) { return int(0) | (int(1) * (int(0) ^ (0 + a))); } - })"; + } + )"; compileBothVersions(sourceCode); compareVersions("f(int256)", u256(0x12334664)); } @@ -165,7 +167,8 @@ BOOST_AUTO_TEST_CASE(unused_expressions) 10 + 20; data; } - })"; + } + )"; compileBothVersions(sourceCode); compareVersions("f()"); } @@ -180,7 +183,8 @@ BOOST_AUTO_TEST_CASE(constant_folding_both_sides) function f(uint x) returns (uint y) { return 98 ^ (7 * ((1 | (x | 1000)) * 40) ^ 102); } - })"; + } + )"; compileBothVersions(sourceCode); compareVersions("f(uint256)", 7); } -- cgit v1.2.3 From f5a49f679a1ec2b8aef466f41d85bbfa99b9a74a Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Fri, 11 May 2018 14:06:31 +0200 Subject: Adjust tests. --- test/libsolidity/SolidityOptimizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 5326feaf..184b7a8d 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -212,7 +212,7 @@ BOOST_AUTO_TEST_CASE(array_copy) data1[i] = msg.data[i]; data2 = data1; l = data2.length; - y = uint(data2[x]); + y = uint(uint40(data2[x])); } } )"; -- cgit v1.2.3 From 86a720b96a45ce1b59ab1038e7bb465f9a566189 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 23 May 2018 15:39:26 +0200 Subject: Adjust tests. --- test/libsolidity/SolidityOptimizer.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 3a8585f7..4ea307c0 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -265,18 +265,18 @@ BOOST_AUTO_TEST_CASE(storage_write_in_loops) // Information in joining branches is not retained anymore. BOOST_AUTO_TEST_CASE(retain_information_in_branches) { - // This tests that the optimizer knows that we already have "z == keccak256(y)" inside both branches. + // This tests that the optimizer knows that we already have "z == keccak256(abi.encodePacked(y))" inside both branches. char const* sourceCode = R"( contract c { bytes32 d; uint a; function f(uint x, bytes32 y) returns (uint r_a, bytes32 r_d) { - bytes32 z = keccak256(y); + bytes32 z = keccak256(abi.encodePacked(y)); if (x > 8) { - z = keccak256(y); + z = keccak256(abi.encodePacked(y)); a = x; } else { - z = keccak256(y); + z = keccak256(abi.encodePacked(y)); a = x; } r_a = a; @@ -313,19 +313,19 @@ BOOST_AUTO_TEST_CASE(store_tags_as_unions) contract test { bytes32 data; function f(uint x, bytes32 y) external returns (uint r_a, bytes32 r_d) { - r_d = keccak256(y); + r_d = keccak256(abi.encodePacked(y)); shared(y); - r_d = keccak256(y); + r_d = keccak256(abi.encodePacked(y)); r_a = 5; } function g(uint x, bytes32 y) external returns (uint r_a, bytes32 r_d) { - r_d = keccak256(y); + r_d = keccak256(abi.encodePacked(y)); shared(y); - r_d = bytes32(uint(keccak256(y)) + 2); + r_d = bytes32(uint(keccak256(abi.encodePacked(y))) + 2); r_a = 7; } function shared(bytes32 y) internal { - data = keccak256(y); + data = keccak256(abi.encodePacked(y)); } } )"; @@ -370,7 +370,7 @@ BOOST_AUTO_TEST_CASE(sequence_number_for_calls) // to storage), so the sequence number should be incremented. char const* sourceCode = R"( contract test { - function f(string a, string b) returns (bool) { return sha256(a) == sha256(b); } + function f(string a, string b) returns (bool) { return sha256(bytes(a)) == sha256(bytes(b)); } } )"; compileBothVersions(sourceCode); -- cgit v1.2.3 From 12c4eb769762d55a71ba05cf1b74b99797026f51 Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Wed, 27 Jun 2018 13:22:33 +0200 Subject: Updates compiled unit tests to new constructor syntax. --- test/libsolidity/SolidityOptimizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 4ea307c0..805c8602 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -385,7 +385,7 @@ BOOST_AUTO_TEST_CASE(computing_constants) uint m_b; uint m_c; uint m_d; - function C() { + constructor() { set(); } function set() returns (uint) { @@ -561,7 +561,7 @@ BOOST_AUTO_TEST_CASE(dead_code_elimination_across_assemblies) char const* sourceCode = R"( contract DCE { function () internal returns (uint) stored; - function DCE() { + constructor() { stored = f; } function f() internal returns (uint) { return 7; } -- cgit v1.2.3 From e251cdcf47667ad3e7c88446d8b26cb3ae1bd0f2 Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Thu, 28 Jun 2018 15:19:53 +0200 Subject: test: ensure compiled tests do not use var-keyword in preparation of var-keyword removal --- test/libsolidity/SolidityOptimizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 805c8602..04d9ee16 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -246,7 +246,7 @@ BOOST_AUTO_TEST_CASE(storage_write_in_loops) contract test { uint d; function f(uint a) returns (uint r) { - var x = d; + uint x = d; for (uint i = 1; i < a * a; i++) { r = d; d = i; -- cgit v1.2.3 From fc2b006fe1266339776820ee0dd2c756bc9766d5 Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Fri, 29 Jun 2018 16:52:41 +0200 Subject: Updates unit test to specify visibility. --- test/libsolidity/SolidityOptimizer.cpp | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 04d9ee16..d375beff 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(smoke_test) { char const* sourceCode = R"( contract test { - function f(uint a) returns (uint b) { + function f(uint a) public returns (uint b) { return a; } } @@ -149,7 +149,7 @@ BOOST_AUTO_TEST_CASE(identities) { char const* sourceCode = R"( contract test { - function f(int a) returns (int b) { + function f(int a) public returns (int b) { return int(0) | (int(1) * (int(0) ^ (0 + a))); } } @@ -163,7 +163,7 @@ BOOST_AUTO_TEST_CASE(unused_expressions) char const* sourceCode = R"( contract test { uint data; - function f() returns (uint a, uint b) { + function f() public returns (uint a, uint b) { 10 + 20; data; } @@ -180,7 +180,7 @@ BOOST_AUTO_TEST_CASE(constant_folding_both_sides) // literals as late as possible char const* sourceCode = R"( contract test { - function f(uint x) returns (uint y) { + function f(uint x) public returns (uint y) { return 98 ^ (7 * ((1 | (x | 1000)) * 40) ^ 102); } } @@ -194,7 +194,7 @@ BOOST_AUTO_TEST_CASE(storage_access) char const* sourceCode = R"( contract test { uint8[40] data; - function f(uint x) returns (uint y) { + function f(uint x) public returns (uint y) { data[2] = data[7] = uint8(x); data[4] = data[2] * 10 + data[3]; } @@ -210,7 +210,7 @@ BOOST_AUTO_TEST_CASE(array_copy) contract test { bytes2[] data1; bytes5[] data2; - function f(uint x) returns (uint l, uint y) { + function f(uint x) public returns (uint l, uint y) { data1.length = msg.data.length; for (uint i = 0; i < msg.data.length; ++i) data1[i] = msg.data[i]; @@ -230,8 +230,8 @@ BOOST_AUTO_TEST_CASE(function_calls) { char const* sourceCode = R"( contract test { - function f1(uint x) returns (uint) { return x*x; } - function f(uint x) returns (uint) { return f1(7+x) - this.f1(x**9); } + function f1(uint x) public returns (uint) { return x*x; } + function f(uint x) public returns (uint) { return f1(7+x) - this.f1(x**9); } } )"; compileBothVersions(sourceCode); @@ -245,7 +245,7 @@ BOOST_AUTO_TEST_CASE(storage_write_in_loops) char const* sourceCode = R"( contract test { uint d; - function f(uint a) returns (uint r) { + function f(uint a) public returns (uint r) { uint x = d; for (uint i = 1; i < a * a; i++) { r = d; @@ -270,7 +270,7 @@ BOOST_AUTO_TEST_CASE(retain_information_in_branches) contract c { bytes32 d; uint a; - function f(uint x, bytes32 y) returns (uint r_a, bytes32 r_d) { + function f(uint x, bytes32 y) public returns (uint r_a, bytes32 r_d) { bytes32 z = keccak256(abi.encodePacked(y)); if (x > 8) { z = keccak256(abi.encodePacked(y)); @@ -351,7 +351,7 @@ BOOST_AUTO_TEST_CASE(incorrect_storage_access_bug) contract C { mapping(uint => uint) data; - function f() returns (uint) + function f() public returns (uint) { if(data[now] == 0) data[uint(-7)] = 5; @@ -370,7 +370,7 @@ BOOST_AUTO_TEST_CASE(sequence_number_for_calls) // to storage), so the sequence number should be incremented. char const* sourceCode = R"( contract test { - function f(string a, string b) returns (bool) { return sha256(bytes(a)) == sha256(bytes(b)); } + function f(string a, string b) public returns (bool) { return sha256(bytes(a)) == sha256(bytes(b)); } } )"; compileBothVersions(sourceCode); @@ -385,10 +385,10 @@ BOOST_AUTO_TEST_CASE(computing_constants) uint m_b; uint m_c; uint m_d; - constructor() { + constructor() public { set(); } - function set() returns (uint) { + function set() public returns (uint) { m_a = 0x77abc0000000000000000000000000000000000000000000000000000000001; m_b = 0x817416927846239487123469187231298734162934871263941234127518276; g(); @@ -402,7 +402,7 @@ BOOST_AUTO_TEST_CASE(computing_constants) function h() { m_d = 0xff05694900000000000000000000000000000000000000000000000000000000; } - function get() returns (uint ra, uint rb, uint rc, uint rd) { + function get() public returns (uint ra, uint rb, uint rc, uint rd) { ra = m_a; rb = m_b; rc = m_c; @@ -444,7 +444,7 @@ BOOST_AUTO_TEST_CASE(constant_optimization_early_exit) pragma solidity ^0.4.0; contract HexEncoding { - function hexEncodeTest(address addr) returns (bytes32 ret) { + function hexEncodeTest(address addr) public returns (bytes32 ret) { uint x = uint(addr) / 2**32; // Nibble interleave @@ -561,11 +561,11 @@ BOOST_AUTO_TEST_CASE(dead_code_elimination_across_assemblies) char const* sourceCode = R"( contract DCE { function () internal returns (uint) stored; - constructor() { + constructor() public { stored = f; } function f() internal returns (uint) { return 7; } - function test() returns (uint) { return stored(); } + function test() public returns (uint) { return stored(); } } )"; compileBothVersions(sourceCode); @@ -577,12 +577,12 @@ BOOST_AUTO_TEST_CASE(invalid_state_at_control_flow_join) char const* sourceCode = R"( contract Test { uint256 public totalSupply = 100; - function f() returns (uint r) { + function f() public returns (uint r) { if (false) r = totalSupply; totalSupply -= 10; } - function test() returns (uint) { + function test() public returns (uint) { f(); return this.totalSupply(); } -- cgit v1.2.3 From 4116704442aff035acb5b707c6b211ac1f5524fe Mon Sep 17 00:00:00 2001 From: Cryptomental Date: Tue, 10 Jul 2018 09:18:19 +0200 Subject: test: Fix typos. Fix typos using codespell. Refs: #4442 --- test/libsolidity/SolidityOptimizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index d375beff..a144068d 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -104,7 +104,7 @@ public: "\nOptimized: " + toHex(optimizedOutput)); } - /// @returns the number of intructions in the given bytecode, not taking the metadata hash + /// @returns the number of instructions in the given bytecode, not taking the metadata hash /// into account. size_t numInstructions(bytes const& _bytecode, boost::optional _which = boost::optional{}) { -- cgit v1.2.3 From 8b4b8bdbae2f67445178ebe3b12d23bb4f46f9d2 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Wed, 11 Jul 2018 13:23:33 +0200 Subject: Update test wrt requiring storage locations. --- test/libsolidity/SolidityOptimizer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index a144068d..764550eb 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -518,8 +518,8 @@ BOOST_AUTO_TEST_CASE(inconsistency) // Called with params: containerIndex=0, valueIndex=0 function levelIII(uint containerIndex, uint valueIndex) private { - Container container = containers[containerIndex]; - Value value = container.values[valueIndex]; + Container storage container = containers[containerIndex]; + Value storage value = container.values[valueIndex]; debug = container.valueIndices[value.number]; } function levelII() private { @@ -530,7 +530,7 @@ BOOST_AUTO_TEST_CASE(inconsistency) function trigger() public returns (uint) { containers.length++; - Container container = containers[0]; + Container storage container = containers[0]; container.values.push(Value({ badnum: 9000, -- cgit v1.2.3 From f48d01d0660747b0071e9d82a0261ce15bcc4c35 Mon Sep 17 00:00:00 2001 From: Chase McDermott Date: Wed, 11 Jul 2018 23:18:50 -0500 Subject: Added default data locations to parameters for end to end tests. --- test/libsolidity/SolidityOptimizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 764550eb..43ae5f73 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -370,7 +370,7 @@ BOOST_AUTO_TEST_CASE(sequence_number_for_calls) // to storage), so the sequence number should be incremented. char const* sourceCode = R"( contract test { - function f(string a, string b) public returns (bool) { return sha256(bytes(a)) == sha256(bytes(b)); } + function f(string memory a, string memory b) public returns (bool) { return sha256(bytes(a)) == sha256(bytes(b)); } } )"; compileBothVersions(sourceCode); @@ -619,7 +619,7 @@ BOOST_AUTO_TEST_CASE(optimise_multi_stores) struct S { uint16 a; uint16 b; uint16[3] c; uint[] dyn; } uint padding; S[] s; - function f() public returns (uint16, uint16, uint16[3], uint) { + function f() public returns (uint16, uint16, uint16[3] memory, uint) { uint16[3] memory c; c[0] = 7; c[1] = 8; -- cgit v1.2.3 From 893f4cf092c98d13116741d1ebc19846f6873536 Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Wed, 11 Jul 2018 15:57:07 +0200 Subject: Specifies visibility in unit tests. --- test/libsolidity/SolidityOptimizer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 43ae5f73..70cbb0fc 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -104,7 +104,7 @@ public: "\nOptimized: " + toHex(optimizedOutput)); } - /// @returns the number of instructions in the given bytecode, not taking the metadata hash + /// @returns the number of intructions in the given bytecode, not taking the metadata hash /// into account. size_t numInstructions(bytes const& _bytecode, boost::optional _which = boost::optional{}) { @@ -394,12 +394,12 @@ BOOST_AUTO_TEST_CASE(computing_constants) g(); return 1; } - function g() { + function g() public { m_b = 0x817416927846239487123469187231298734162934871263941234127518276; m_c = 0x817416927846239487123469187231298734162934871263941234127518276; h(); } - function h() { + function h() public { m_d = 0xff05694900000000000000000000000000000000000000000000000000000000; } function get() public returns (uint ra, uint rb, uint rc, uint rd) { @@ -600,7 +600,7 @@ BOOST_AUTO_TEST_CASE(init_empty_dynamic_arrays) // not use any memory. char const* sourceCode = R"( contract Test { - function f() pure returns (uint r) { + function f() public pure returns (uint r) { uint[][] memory x = new uint[][](20000); return x.length; } -- cgit v1.2.3 From ed2aa3b8694f253edff8c0a4acefd4ba74bbd859 Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Mon, 16 Jul 2018 12:23:06 +0200 Subject: Fixes end-to-end tests. --- test/libsolidity/SolidityOptimizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 70cbb0fc..3e2dce26 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -104,7 +104,7 @@ public: "\nOptimized: " + toHex(optimizedOutput)); } - /// @returns the number of intructions in the given bytecode, not taking the metadata hash + /// @returns the number of instructions in the given bytecode, not taking the metadata hash /// into account. size_t numInstructions(bytes const& _bytecode, boost::optional _which = boost::optional{}) { -- cgit v1.2.3 From 7fa2d0c84ed3d0fc6462fdd8f94d9834c1031114 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sat, 28 Jul 2018 12:55:50 +0100 Subject: Replace stray solidity pragma with progamatically inserting it in SolidityOptimizer test --- test/libsolidity/SolidityOptimizer.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 3e2dce26..119f80d1 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -74,9 +74,9 @@ public: unsigned const _optimizeRuns = 200 ) { - m_nonOptimizedBytecode = compileAndRunWithOptimizer(_sourceCode, _value, _contractName, false, _optimizeRuns); + m_nonOptimizedBytecode = compileAndRunWithOptimizer("pragma solidity >=0.0;\n" + _sourceCode, _value, _contractName, false, _optimizeRuns); m_nonOptimizedContract = m_contractAddress; - m_optimizedBytecode = compileAndRunWithOptimizer(_sourceCode, _value, _contractName, true, _optimizeRuns); + m_optimizedBytecode = compileAndRunWithOptimizer("pragma solidity >=0.0;\n" + _sourceCode, _value, _contractName, true, _optimizeRuns); size_t nonOptimizedSize = numInstructions(m_nonOptimizedBytecode); size_t optimizedSize = numInstructions(m_optimizedBytecode); BOOST_CHECK_MESSAGE( @@ -441,8 +441,6 @@ BOOST_AUTO_TEST_CASE(constant_optimization_early_exit) // This tests that the constant optimizer does not try to find the best representation // indefinitely but instead stops after some number of iterations. char const* sourceCode = R"( - pragma solidity ^0.4.0; - contract HexEncoding { function hexEncodeTest(address addr) public returns (bytes32 ret) { uint x = uint(addr) / 2**32; -- cgit v1.2.3 From e902ce1aa02dc5d19cc9dd231fa538646884826d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Aereal=20Ae=C3=B3n?= Date: Wed, 8 Aug 2018 11:26:30 -0300 Subject: Removing std:: from std::to_string and include for boost/lexical_cast --- test/libsolidity/SolidityOptimizer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 119f80d1..1c80e82e 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -82,8 +81,8 @@ public: BOOST_CHECK_MESSAGE( _optimizeRuns < 50 || optimizedSize < nonOptimizedSize, string("Optimizer did not reduce bytecode size. Non-optimized size: ") + - std::to_string(nonOptimizedSize) + " - optimized size: " + - std::to_string(optimizedSize) + to_string(nonOptimizedSize) + " - optimized size: " + + to_string(optimizedSize) ); m_optimizedContract = m_contractAddress; } -- cgit v1.2.3 From 808c3f3df58d32c5d6056ece7da23db41d617c2b Mon Sep 17 00:00:00 2001 From: liangdzou Date: Mon, 17 Sep 2018 22:13:21 +0800 Subject: fix some format typos --- test/libsolidity/SolidityOptimizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/libsolidity/SolidityOptimizer.cpp') diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 1c80e82e..f925d36e 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -352,7 +352,7 @@ BOOST_AUTO_TEST_CASE(incorrect_storage_access_bug) mapping(uint => uint) data; function f() public returns (uint) { - if(data[now] == 0) + if (data[now] == 0) data[uint(-7)] = 5; return data[now]; } -- cgit v1.2.3