Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

Commit

Permalink
Increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Minoru committed Jan 26, 2016
1 parent 72d2c1b commit 688d0b4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Empty file added test/data/empty.xml
Empty file.
20 changes: 19 additions & 1 deletion test/test-rss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,29 @@
#include <rsspp_internal.h>

int main(void) {
lemon::test<> lemon(74);
lemon::test<> lemon(76);

rsspp::parser p;

// non-existent file
try {
rsspp::feed f = p.parse_file("data/non-existent.xml");
} catch (rsspp::exception e) {
lemon.is(e.what(), std::string("could not parse file"),
"Exception if file doesn't exist");
}

// test of RSS 0.91

// empty file
try {
rsspp::feed f = p.parse_file("data/empty.xml");
} catch (rsspp::exception e) {
lemon.is(e.what(), std::string("XML root node is NULL"),
"Exception if can't parse");
}

// test data
rsspp::feed f = p.parse_file("data/rss091_1.xml");

lemon.is(f.rss_version, rsspp::RSS_0_91, "RSS type is RSS 0.91");
Expand Down

0 comments on commit 688d0b4

Please sign in to comment.