From da5c9c7071143bb30c2166bae2b2bf2ba43d93f3 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Thu, 18 Sep 2008 17:28:44 +0000 Subject: Modified return codes for txtest: returns 1 if check fails; 2 if exception is thrown; 0 otherwise. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-10@696728 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/txtest.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cpp/src/tests/txtest.cpp b/cpp/src/tests/txtest.cpp index f0e70e83e9..c285ff9fcc 100644 --- a/cpp/src/tests/txtest.cpp +++ b/cpp/src/tests/txtest.cpp @@ -227,7 +227,7 @@ struct Controller : public Client } } - void check() + int check() { SubscriptionManager subs(session); subs.setFlowControl(SubscriptionManager::UNLIMITED, SubscriptionManager::UNLIMITED, false); @@ -289,7 +289,8 @@ struct Controller : public Client set_difference(drained.begin(), drained.end(), ids.begin(), ids.end(), back_inserter(extra)); if (missing.empty() && extra.empty()) { - std::cout << "All expected messages were retrieved." << std::endl; + std::cout << "All expected messages were retrieved." << std::endl; + return 0; } else { if (!missing.empty()) { std::cout << "The following ids were missing:" << std::endl; @@ -303,6 +304,7 @@ struct Controller : public Client std::cout << " '" << *i << "'" << std::endl; } } + return 1; } } }; @@ -314,10 +316,10 @@ int main(int argc, char** argv) Controller controller; if (opts.init) controller.init(); if (opts.transfer) controller.transfer(); - if (opts.check) controller.check(); + if (opts.check) return controller.check(); return 0; } catch(const std::exception& e) { std::cout << e.what() << std::endl; } - return 1; + return 2; } -- cgit v1.2.1