diff options
author | methodus <methodus@web.de> | 2012-09-16 14:23:23 +0200 |
---|---|---|
committer | methodus <methodus@web.de> | 2012-09-16 14:23:23 +0200 |
commit | dcdefcf8bd955a92a312dc2c40eb48210a48011a (patch) | |
tree | 87a845b341b6f1b91e51c0c1b906b5135581bea0 /tests/test_parser.cpp | |
parent | 17468ec33af5487448db193bfd88ad56b31e7c7a (diff) | |
download | vdr-plugin-upnp-dcdefcf8bd955a92a312dc2c40eb48210a48011a.tar.gz vdr-plugin-upnp-dcdefcf8bd955a92a312dc2c40eb48210a48011a.tar.bz2 |
Fixed some bugs in the SortCriteria parser.
Diffstat (limited to 'tests/test_parser.cpp')
-rw-r--r-- | tests/test_parser.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_parser.cpp b/tests/test_parser.cpp index 8e3053a..ec455bc 100644 --- a/tests/test_parser.cpp +++ b/tests/test_parser.cpp @@ -8,6 +8,18 @@ #include "../include/parser.h" #include <iostream> +void checkSort(string s){ + + upnp::cSortCriteria::SortCriteriaList list = upnp::cSortCriteria::parse(s); + + cout << "Sort: \"" << s << "\"" << endl; + for(upnp::cSortCriteria::SortCriteriaList::iterator it = list.begin(); it != list.end(); ++it){ + cout << " " << (*it).property << " " <<((*it).sortDescending ? "DESC" : "ASC") << endl; + } + cout << endl; + +} + void checkSearch(string t, string e) { string r = upnp::cSearch::parse(t); @@ -50,5 +62,15 @@ int main(){ checkFilter("@id,dc:title,upnp:longDescription,res"); + checkSort(""); + + checkSort("+dc:title,-dc:creator"); + + checkSort("dc:title"); + + checkSort("+upnp:class"); + + checkSort("+@id"); + return 0; } |