diff options
-rw-r--r-- | tests/test_parser.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_parser.cpp b/tests/test_parser.cpp index 68b2fb0..8e3053a 100644 --- a/tests/test_parser.cpp +++ b/tests/test_parser.cpp @@ -19,6 +19,18 @@ void checkSearch(string t, string e) { } +void checkFilter(string f){ + + upnp::StringList list = upnp::cFilterCriteria::parse(f); + + cout << "Filter: \"" << f << "\"" << endl; + for(upnp::StringList::iterator it = list.begin(); it != list.end(); ++it){ + cout << " " << (*it) << endl; + } + cout << endl; + +} + int main(){ checkSearch("upnp:class = \"object.item.imageItem\" and ( dc:date >= \"2001-10-01\" and dc:date <= \"2001-10-31\" )", "class == 'object.item.imageItem' AND ( date >= '2001-10-01' AND date <= '2001-10-31' ) "); @@ -32,5 +44,11 @@ int main(){ checkSearch("upnp:class derivedfrom \"object.container.album\"", "class LIKE '%object.container.album%' "); + checkFilter("@id,@parentID,@restricted,dc:title"); + + checkFilter("*"); + + checkFilter("@id,dc:title,upnp:longDescription,res"); + return 0; } |