From 2c642e73c6f366df103e664db281f28abe61abb3 Mon Sep 17 00:00:00 2001 From: Brad Hubbard Date: Fri, 9 Mar 2018 14:35:36 +1000 Subject: [PATCH] tests: Check for empty output in test_dump_pgstate_history Signed-off-by: Brad Hubbard --- src/test/admin_socket_output_tests.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/admin_socket_output_tests.cc b/src/test/admin_socket_output_tests.cc index 72a573b78092..58bc03654080 100644 --- a/src/test/admin_socket_output_tests.cc +++ b/src/test/admin_socket_output_tests.cc @@ -36,6 +36,11 @@ bool test_dump_pgstate_history(std::string &output) { } JSONObjIter iter = parser.find_first(); + if (iter.end()) { //Empty + std::cerr << "test_dump_pgstate_history: command output empty, failing" + << std::endl; + return false; + } for (; !iter.end(); ++iter) { if ((*iter)->get_name() == "pg") { ret = !(*iter)->get_data().empty(); -- 2.47.3