diff options
author | djudjuu <julfaber@gmail.com> | 2017-05-18 00:22:39 +0800 |
---|---|---|
committer | djudjuu <julfaber@gmail.com> | 2017-05-19 15:51:23 +0800 |
commit | 6316a76ab915e03e02825ce391d3812098c6b682 (patch) | |
tree | fd7cba75d74ecfa137494247b45ec3a36be09ec7 | |
parent | e3583d04f79c5e9ada9914f43711d3b90242dfdc (diff) | |
download | dexon-solidity-6316a76ab915e03e02825ce391d3812098c6b682.tar.gz dexon-solidity-6316a76ab915e03e02825ce391d3812098c6b682.tar.zst dexon-solidity-6316a76ab915e03e02825ce391d3812098c6b682.zip |
testsuite adjustment
-rw-r--r-- | libsolidity/ast/ASTJsonConverter.h | 8 | ||||
-rw-r--r-- | test/libsolidity/JSONCompiler.cpp | 8 | ||||
-rw-r--r-- | test/libsolidity/StandardCompiler.cpp | 4 |
3 files changed, 11 insertions, 9 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.h b/libsolidity/ast/ASTJsonConverter.h index cf62e5f5..3d6035a4 100644 --- a/libsolidity/ast/ASTJsonConverter.h +++ b/libsolidity/ast/ASTJsonConverter.h @@ -139,13 +139,13 @@ private: return _node.id(); } template<class Container> - Json::Value getContainerIds(Container container) + Json::Value getContainerIds(Container const& container) { Json::Value tmp(Json::arrayValue); - for (auto it = container.begin(); it != container.end(); ++it) + for (auto const& element: container) { - solAssert(*it, ""); - tmp.append(nodeId(**it)); + solAssert(element, ""); + tmp.append(nodeId(*element)); } return tmp; } diff --git a/test/libsolidity/JSONCompiler.cpp b/test/libsolidity/JSONCompiler.cpp index 46c718d7..6aec59ab 100644 --- a/test/libsolidity/JSONCompiler.cpp +++ b/test/libsolidity/JSONCompiler.cpp @@ -90,10 +90,12 @@ BOOST_AUTO_TEST_CASE(basic_compilation) BOOST_CHECK(result["sources"]["fileA"].isObject()); BOOST_CHECK(result["sources"]["fileA"]["AST"].isObject()); BOOST_CHECK(dev::jsonCompactPrint(result["sources"]["fileA"]["AST"]) == - "{\"children\":[{\"attributes\":{\"fullyImplemented\":true,\"isLibrary\":false,\"linearizedBaseContracts\":[1]," - "\"name\":\"A\"},\"children\":[],\"id\":1,\"name\":\"ContractDefinition\",\"src\":\"0:14:0\"}],\"name\":\"SourceUnit\"}"); + "{\"attributes\":{\"absolutePath\":\"fileA\",\"exportedSymbols\":{\"A\":[1]}}," + "\"children\":[{\"attributes\":{\"baseContracts\":[null],\"contractDependencies\":[null]," + "\"contractKind\":\"contract\",\"fullyImplemented\":true,\"linearizedBaseContracts\":[1]," + "\"name\":\"A\",\"nodes\":[null],\"scope\":2},\"id\":1,\"name\":\"ContractDefinition\"," + "\"src\":\"0:14:0\"}],\"id\":2,\"name\":\"SourceUnit\",\"src\":\"0:14:0\"}"); } - BOOST_AUTO_TEST_SUITE_END() } diff --git a/test/libsolidity/StandardCompiler.cpp b/test/libsolidity/StandardCompiler.cpp index f4d277bd..050ca500 100644 --- a/test/libsolidity/StandardCompiler.cpp +++ b/test/libsolidity/StandardCompiler.cpp @@ -216,8 +216,8 @@ BOOST_AUTO_TEST_CASE(basic_compilation) BOOST_CHECK(result["sources"]["fileA"]["legacyAST"].isObject()); BOOST_CHECK(dev::jsonCompactPrint(result["sources"]["fileA"]["legacyAST"]) == "{\"attributes\":{\"absolutePath\":\"fileA\",\"exportedSymbols\":{\"A\":[1]}},\"children\":" - "[{\"attributes\":{\"baseContracts\":[null],\"contractDependencies\":[null],\"fullyImplemented\":true," - "\"isLibrary\":false,\"linearizedBaseContracts\":[1],\"name\":\"A\",\"nodes\":[null],\"scope\":2}," + "[{\"attributes\":{\"baseContracts\":[null],\"contractDependencies\":[null],\"contractKind\":\"contract\"," + "\"fullyImplemented\":true,\"linearizedBaseContracts\":[1],\"name\":\"A\",\"nodes\":[null],\"scope\":2}," "\"id\":1,\"name\":\"ContractDefinition\",\"src\":\"0:14:0\"}],\"id\":2,\"name\":\"SourceUnit\",\"src\":\"0:14:0\"}"); } |