summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2008-09-18 17:29:01 +0000
committerKim van der Riet <kpvdr@apache.org>2008-09-18 17:29:01 +0000
commitaedf627380016ebf210ea88029be8bd338ffc989 (patch)
treeefade9554c5be789bd946c808e71758f6db37c20 /cpp
parent9e0f79addc7d09962e5273cd36fdc270c5684720 (diff)
downloadqpid-python-aedf627380016ebf210ea88029be8bd338ffc989.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/trunk/qpid@696729 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/tests/txtest.cpp10
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;
}