diff options
author | stone4774 <25053818+stone4774@users.noreply.github.com> | 2018-03-22 11:16:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 11:16:34 +0800 |
commit | c99f5278eb8dad6f42def88ce8b5a3453f6df4a8 (patch) | |
tree | c3cd284ec9d2981f61da266d040935b73275b5c4 /conformance | |
parent | d053271deebe0efcd41729991b1f3d618b638ad5 (diff) | |
parent | ed4321d1cb33199984118d801956822842771e7e (diff) | |
download | protobuf-c99f5278eb8dad6f42def88ce8b5a3453f6df4a8.tar.gz protobuf-c99f5278eb8dad6f42def88ce8b5a3453f6df4a8.tar.bz2 protobuf-c99f5278eb8dad6f42def88ce8b5a3453f6df4a8.zip |
Merge branch 'master' into fixbug_enum2json2
Diffstat (limited to 'conformance')
-rw-r--r-- | conformance/conformance_cpp.cc | 1 | ||||
-rw-r--r-- | conformance/conformance_test.cc | 22 | ||||
-rw-r--r-- | conformance/conformance_test.h | 3 | ||||
-rw-r--r-- | conformance/conformance_test_runner.cc | 3 |
4 files changed, 24 insertions, 5 deletions
diff --git a/conformance/conformance_cpp.cc b/conformance/conformance_cpp.cc index 9540b50e..97ae1a7a 100644 --- a/conformance/conformance_cpp.cc +++ b/conformance/conformance_cpp.cc @@ -45,7 +45,6 @@ using google::protobuf::Descriptor; using google::protobuf::DescriptorPool; using google::protobuf::Message; using google::protobuf::MessageFactory; -using google::protobuf::internal::scoped_ptr; using google::protobuf::util::BinaryToJsonString; using google::protobuf::util::JsonToBinaryString; using google::protobuf::util::NewTypeResolverForDescriptorPool; diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc index e4b046dc..22bbbfb3 100644 --- a/conformance/conformance_test.cc +++ b/conformance/conformance_test.cc @@ -1910,6 +1910,10 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, { TestAllTypesProto3 messageProto3; TestAllTypesProto2 messageProto2; + //TODO(yilunchong): update this behavior when unknown field's behavior + // changed in open source. Also delete + // Required.Proto3.ProtobufInput.UnknownVarint.ProtobufOutput + // from failure list of python_cpp python java TestUnknownMessage(messageProto3, true); TestUnknownMessage(messageProto2, false); } @@ -2321,6 +2325,24 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, } )"); RunValidJsonTest( + "ValueAcceptListWithNull", REQUIRED, + R"({"optionalValue": ["x", null, "y"]})", + R"( + optional_value: { + list_value: { + values: { + string_value: "x" + } + values: { + null_value: NULL_VALUE + } + values: { + string_value: "y" + } + } + } + )"); + RunValidJsonTest( "ValueAcceptObject", REQUIRED, R"({"optionalValue": {"value": 1}})", R"( diff --git a/conformance/conformance_test.h b/conformance/conformance_test.h index 4882412c..2649f8b2 100644 --- a/conformance/conformance_test.h +++ b/conformance/conformance_test.h @@ -256,8 +256,7 @@ class ConformanceTestSuite { // The set of tests that the testee opted out of; std::set<std::string> skipped_; - google::protobuf::internal::scoped_ptr<google::protobuf::util::TypeResolver> - type_resolver_; + std::unique_ptr<google::protobuf::util::TypeResolver> type_resolver_; std::string type_url_; }; diff --git a/conformance/conformance_test_runner.cc b/conformance/conformance_test_runner.cc index 09631f0c..b0357b87 100644 --- a/conformance/conformance_test_runner.cc +++ b/conformance/conformance_test_runner.cc @@ -68,7 +68,6 @@ using conformance::ConformanceRequest; using conformance::ConformanceResponse; -using google::protobuf::internal::scoped_array; using google::protobuf::StringAppendF; using std::string; using std::vector; @@ -183,7 +182,7 @@ class ForkPipeRunner : public google::protobuf::ConformanceTestRunner { CHECK_SYSCALL(close(toproc_pipe_fd[1])); CHECK_SYSCALL(close(fromproc_pipe_fd[0])); - scoped_array<char> executable(new char[executable_.size() + 1]); + std::unique_ptr<char[]> executable(new char[executable_.size() + 1]); memcpy(executable.get(), executable_.c_str(), executable_.size()); executable[executable_.size()] = '\0'; |