summaryrefslogtreecommitdiff
path: root/libtmdb/testModels.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libtmdb/testModels.cpp')
-rw-r--r--libtmdb/testModels.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/libtmdb/testModels.cpp b/libtmdb/testModels.cpp
index 3b1b289..2b61644 100644
--- a/libtmdb/testModels.cpp
+++ b/libtmdb/testModels.cpp
@@ -8,6 +8,14 @@
namespace std {
std::ostream &
+ operator<<(std::ostream & o, const Ice::optional<TMDb::Date> & d)
+ {
+ if (d) {
+ o << *d;
+ }
+ return o;
+ }
+ std::ostream &
operator<<(std::ostream & o, const TMDb::Date & d)
{
o << d.Year << '-' << d.Month << '-' << d.Day;
@@ -23,13 +31,13 @@ BOOST_AUTO_TEST_CASE( deserialize_searchmulti_json_breakingbad )
BOOST_REQUIRE_EQUAL(3, results->TotalResults);
BOOST_REQUIRE_EQUAL("::TMDb::SearchMatchTv", results->Results[0]->ice_id());
- auto tv = TMDb::SearchMatchTvPtr::dynamicCast(results->Results[0]);
+ auto tv = std::dynamic_pointer_cast<TMDb::SearchMatchTv>(results->Results[0]);
BOOST_REQUIRE_EQUAL("Breaking Bad", tv->Name);
BOOST_REQUIRE_EQUAL("/1yeVJox3rjo2jBKrrihIMj7uoS9.jpg", tv->PosterPath);
BOOST_REQUIRE_EQUAL(1396, tv->Id);
BOOST_REQUIRE_EQUAL("::TMDb::SearchMatchMovie", results->Results[1]->ice_id());
- auto movie = TMDb::SearchMatchMoviePtr::dynamicCast(results->Results[1]);
+ auto movie = std::dynamic_pointer_cast<TMDb::SearchMatchMovie>(results->Results[1]);
BOOST_REQUIRE_EQUAL("No Half Measures: Creating the Final Season of Breaking Bad", movie->Title);
BOOST_REQUIRE_EQUAL("/8OixSR45U5dbqv8F0tlspmTbXxN.jpg", movie->PosterPath);
BOOST_REQUIRE_EQUAL(239459, movie->Id);
@@ -43,7 +51,7 @@ BOOST_AUTO_TEST_CASE( deserialize_searchmulti_json_bradpitt )
BOOST_REQUIRE_EQUAL(1, results->TotalResults);
BOOST_REQUIRE_EQUAL("::TMDb::SearchMatchPerson", results->Results[0]->ice_id());
- auto person = TMDb::SearchMatchPersonPtr::dynamicCast(results->Results[0]);
+ auto person = std::dynamic_pointer_cast<TMDb::SearchMatchPerson>(results->Results[0]);
BOOST_REQUIRE_EQUAL("Brad Pitt", person->Name);
BOOST_REQUIRE_EQUAL(287, person->Id);
}