diff options
author | Kim van der Riet <kpvdr@apache.org> | 2008-09-18 17:28:44 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2008-09-18 17:28:44 +0000 |
commit | da5c9c7071143bb30c2166bae2b2bf2ba43d93f3 (patch) | |
tree | 682a52fe877b99644a28f49452fece430759017b | |
parent | 4ac9fe566333f24c9a3f880eef8ec6acf6de234e (diff) | |
download | qpid-python-da5c9c7071143bb30c2166bae2b2bf2ba43d93f3.tar.gz |
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
-rw-r--r-- | cpp/src/tests/txtest.cpp | 10 |
1 files 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; } |