diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-12-11 06:13:02 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-12-11 06:13:02 +0000 |
commit | 36adc76235fb0a38e7042bc751f988b71627e2a0 (patch) | |
tree | fc83b3f4e0afeb3932c8d200f5493f0a8d6c4619 /sca-cpp/trunk/components/chat/xmpp-test.cpp | |
parent | 86b1de85536e93c59a25702a5a2d3e384202ffd2 (diff) |
Changes to get successful C++11 based build. Code cleanup, dependency upgrades, and const + inline optimizations in components, samples, and app hosting server.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1420007 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-cpp/trunk/components/chat/xmpp-test.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/sca-cpp/trunk/components/chat/xmpp-test.cpp b/sca-cpp/trunk/components/chat/xmpp-test.cpp index 6b7fa3439f..853029a836 100644 --- a/sca-cpp/trunk/components/chat/xmpp-test.cpp +++ b/sca-cpp/trunk/components/chat/xmpp-test.cpp @@ -52,28 +52,21 @@ const failable<bool> listener(const value& from, const value& val, unused XMPPCl return false; } -struct subscribe { - XMPPClient& xc; - subscribe(XMPPClient& xc) : xc(xc) { - } - const failable<bool> operator()() const { - const lambda<failable<bool>(const value&, const value&, XMPPClient&)> l(listener); - listen(l, xc); - return true; - } -}; - -bool testListen() { +const bool testListen() { received = false; XMPPClient& xc = *(new (gc_new<XMPPClient>()) XMPPClient(jid2, pass2)); const failable<bool> c = connect(xc); assert(hasContent(c)); - const lambda<failable<bool>()> subs = subscribe(xc); + const lambda<const failable<bool>()> subs = [&xc]() -> const failable<bool> { + const lambda<const failable<bool>(const value&, const value&, XMPPClient&)> l(listener); + listen(l, xc); + return true; + }; submit(w, subs); return true; } -bool testPost() { +const bool testPost() { XMPPClient xc(jid1, pass1); const failable<bool> c = connect(xc); assert(hasContent(c)); @@ -82,7 +75,7 @@ bool testPost() { return true; } -bool testReceived() { +const bool testReceived() { shutdown(w); assert(received == true); return true; |