summaryrefslogtreecommitdiffstats
path: root/cpp/sca/modules/atom/atom-test.cpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-11-01 05:25:14 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-11-01 05:25:14 +0000
commit6b94d489977c1cb2eeddded3ee329fe6b9605d5c (patch)
treef51d8b2373102cb6c8ac9fc0e051b6f1227a414c /cpp/sca/modules/atom/atom-test.cpp
parent9f187b46ae761e8275362d6c1533e9fe79028c7b (diff)
Minor refactoring of read/write functions and primitive procs. Added functions to help store data in memcached. Fixes to HTTP support and more tests.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@831640 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--cpp/sca/modules/atom/atom-test.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/cpp/sca/modules/atom/atom-test.cpp b/cpp/sca/modules/atom/atom-test.cpp
index 618f534001..7c14b954a0 100644
--- a/cpp/sca/modules/atom/atom-test.cpp
+++ b/cpp/sca/modules/atom/atom-test.cpp
@@ -33,7 +33,7 @@
namespace tuscany {
namespace atom {
-std::ostringstream* writer(std::ostringstream* os, const std::string& s) {
+std::ostringstream* writer(const std::string& s, std::ostringstream* os) {
(*os) << s;
return os;
}
@@ -78,19 +78,19 @@ bool testEntry() {
<< (list<value>() << element << "price" << std::string("$2.99"));
const list<value> a = mklist<value>(std::string("item"), std::string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
std::ostringstream os;
- writeEntry<std::ostringstream*>(writer, &os, a);
+ writeATOMEntry<std::ostringstream*>(writer, &os, a);
assert(os.str() == itemEntry);
}
{
const list<value> a = readEntry(mklist(itemEntry));
std::ostringstream os;
- writeEntry<std::ostringstream*>(writer, &os, a);
+ writeATOMEntry<std::ostringstream*>(writer, &os, a);
assert(os.str() == itemEntry);
}
{
const list<value> a = readEntry(mklist(incompleteEntry));
std::ostringstream os;
- writeEntry<std::ostringstream*>(writer, &os, a);
+ writeATOMEntry<std::ostringstream*>(writer, &os, a);
assert(os.str() == completedEntry);
}
return true;
@@ -131,13 +131,13 @@ std::string itemFeed("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
bool testFeed() {
{
std::ostringstream os;
- writeFeed<std::ostringstream*>(writer, &os, mklist<value>("Feed", "1234"));
+ writeATOMFeed<std::ostringstream*>(writer, &os, mklist<value>("Feed", "1234"));
assert(os.str() == emptyFeed);
}
{
const list<value> a = readFeed(mklist(emptyFeed));
std::ostringstream os;
- writeFeed<std::ostringstream*>(writer, &os, a);
+ writeATOMFeed<std::ostringstream*>(writer, &os, a);
assert(os.str() == emptyFeed);
}
{
@@ -152,7 +152,7 @@ bool testFeed() {
<< (list<value>() << element << "price" << "$3.55")));
const list<value> a = cons<value>("Feed", cons<value>("1234", i));
std::ostringstream os;
- writeFeed<std::ostringstream*>(writer, &os, a);
+ writeATOMFeed<std::ostringstream*>(writer, &os, a);
assert(os.str() == itemFeed);
}
{
@@ -167,13 +167,13 @@ bool testFeed() {
<< (list<value>() << "price" << "$3.55")));
const list<value> a = cons<value>("Feed", cons<value>("1234", i));
std::ostringstream os;
- writeFeed<std::ostringstream*>(writer, &os, a);
+ writeATOMFeed<std::ostringstream*>(writer, &os, a);
assert(os.str() == itemFeed);
}
{
const list<value> a = readFeed(mklist(itemFeed));
std::ostringstream os;
- writeFeed<std::ostringstream*>(writer, &os, a);
+ writeATOMFeed<std::ostringstream*>(writer, &os, a);
assert(os.str() == itemFeed);
}
return true;