diff options
Diffstat (limited to '')
-rw-r--r-- | sca-cpp/trunk/modules/atom/atom-test.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sca-cpp/trunk/modules/atom/atom-test.cpp b/sca-cpp/trunk/modules/atom/atom-test.cpp index 4acc720816..762331d528 100644 --- a/sca-cpp/trunk/modules/atom/atom-test.cpp +++ b/sca-cpp/trunk/modules/atom/atom-test.cpp @@ -56,6 +56,13 @@ string itemTextEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" "<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>" "</entry>\n"); +string itemNoContentEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<entry xmlns=\"http://www.w3.org/2005/Atom\">" + "<title type=\"text\">item</title>" + "<id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>" + "<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>" + "</entry>\n"); + string incompleteEntry("<entry xmlns=\"http://www.w3.org/2005/Atom\">" "<title>item</title><content type=\"text/xml\">" "<Item xmlns=\"http://services/\">" @@ -94,6 +101,12 @@ bool testEntry() { assert(str(os) == itemTextEntry); } { + const list<value> a = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), list<value>()); + ostringstream os; + writeATOMEntry<ostream*>(writer, &os, a); + assert(str(os) == itemNoContentEntry); + } + { const list<value> a = content(readATOMEntry(mklist(itemEntry))); ostringstream os; writeATOMEntry<ostream*>(writer, &os, a); @@ -106,6 +119,12 @@ bool testEntry() { assert(str(os) == itemTextEntry); } { + const list<value> a = content(readATOMEntry(mklist(itemNoContentEntry))); + ostringstream os; + writeATOMEntry<ostream*>(writer, &os, a); + assert(str(os) == itemNoContentEntry); + } + { const list<value> a = content(readATOMEntry(mklist(incompleteEntry))); ostringstream os; writeATOMEntry<ostream*>(writer, &os, a); |