diff options
author | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2016-04-21 18:59:06 -0700 |
---|---|---|
committer | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2016-04-21 18:59:06 -0700 |
commit | 241dea56c8f3688c17c01c96edb497ab89fce582 (patch) | |
tree | 3ef5e77e8b593fabfe5114a3df4466561a531e21 /test/cpp/qps/qps_json_driver.cc | |
parent | 626f303eefd1f376357b71f8c811362f5b3f1e68 (diff) | |
parent | 7beea147e506b57a9656976001a1360e755a2e9b (diff) |
Merge pull request #6147 from ctiller/strong-includes
Rollup of changes from latest import
Diffstat (limited to 'test/cpp/qps/qps_json_driver.cc')
-rw-r--r-- | test/cpp/qps/qps_json_driver.cc | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/test/cpp/qps/qps_json_driver.cc b/test/cpp/qps/qps_json_driver.cc index a4d9b001f3..d7642f0e1e 100644 --- a/test/cpp/qps/qps_json_driver.cc +++ b/test/cpp/qps/qps_json_driver.cc @@ -34,13 +34,13 @@ #include <memory> #include <set> -#include <google/protobuf/util/json_util.h> -#include <google/protobuf/util/type_resolver_util.h> +#include <grpc++/support/config_protobuf.h> #include <gflags/gflags.h> #include <grpc/support/log.h> #include "test/cpp/qps/driver.h" +#include "test/cpp/qps/parse_json.h" #include "test/cpp/qps/report.h" #include "test/cpp/util/benchmark_config.h" @@ -87,22 +87,7 @@ static void QpsDriver() { // Parse into an array of scenarios Scenarios scenarios; - std::unique_ptr<google::protobuf::util::TypeResolver> type_resolver( - google::protobuf::util::NewTypeResolverForDescriptorPool( - "type.googleapis.com", - google::protobuf::DescriptorPool::generated_pool())); - grpc::string binary; - auto status = JsonToBinaryString(type_resolver.get(), - "type.googleapis.com/grpc.testing.Scenarios", - json, &binary); - if (!status.ok()) { - grpc::string msg(status.error_message()); - gpr_log(GPR_ERROR, "Failed to convert json to binary: errcode=%d msg=%s", - status.error_code(), msg.c_str()); - gpr_log(GPR_ERROR, "JSON: ", json.c_str()); - abort(); - } - GPR_ASSERT(scenarios.ParseFromString(binary)); + ParseJson(json.c_str(), "grpc.testing.Scenarios", &scenarios); // Make sure that there is at least some valid scenario here GPR_ASSERT(scenarios.scenarios_size() > 0); |