From dfdfe26958e8430417c6b529ad28318d327a847b Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 21 Apr 2016 11:38:31 -0700 Subject: Make sure that there is at least one scenario, otherwise indicates malformed input --- test/cpp/qps/qps_json_driver.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/cpp/qps/qps_json_driver.cc') diff --git a/test/cpp/qps/qps_json_driver.cc b/test/cpp/qps/qps_json_driver.cc index b2e2457bdc..a4d9b001f3 100644 --- a/test/cpp/qps/qps_json_driver.cc +++ b/test/cpp/qps/qps_json_driver.cc @@ -104,6 +104,9 @@ static void QpsDriver() { } GPR_ASSERT(scenarios.ParseFromString(binary)); + // Make sure that there is at least some valid scenario here + GPR_ASSERT(scenarios.scenarios_size() > 0); + for (int i = 0; i < scenarios.scenarios_size(); i++) { const Scenario &scenario = scenarios.scenarios(i); std::cerr << "RUNNING SCENARIO: " << scenario.name() << "\n"; -- cgit v1.2.3