From 36adc76235fb0a38e7042bc751f988b71627e2a0 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Tue, 11 Dec 2012 06:13:02 +0000 Subject: 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 --- .../trunk/components/sqldb/pgsql-standby-test.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp') diff --git a/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp b/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp index 2cd25f874a..5d73b0d877 100644 --- a/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp +++ b/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp @@ -32,7 +32,7 @@ namespace tuscany { namespace pgsql { -bool testPGSql() { +const bool testPGSql() { PGSql wpg("host=localhost port=6432 dbname=db", "test"); PGSql rpg("host=localhost port=6433 dbname=db", "test"); const value k = mklist("a"); @@ -50,25 +50,17 @@ bool testPGSql() { return true; } -struct getLoop { - const value k; - PGSql& pg; - getLoop(const value& k, PGSql& pg) : k(k), pg(pg) { - } - const bool operator()() const { - assert((get(k, pg)) == value(string("CCC"))); - return true; - } -}; - -bool testGetPerf() { +const bool testGetPerf() { const value k = mklist("c"); PGSql wpg("host=localhost port=6432 dbname=db", "test"); PGSql rpg("host=localhost port=6433 dbname=db", "test"); assert(hasContent(post(k, string("CCC"), wpg))); sleep(1); - const lambda gl = getLoop(k, rpg); + const blambda gl = [k, rpg]() -> const bool { + assert((get(k, rpg)) == value(string("CCC"))); + return true; + }; cout << "PGSql get test " << time(gl, 5, 200) << " ms" << endl; return true; } -- cgit v1.2.3