diff options
Diffstat (limited to 'p2pvr/daemon/unittests/testSi.cpp')
-rw-r--r-- | p2pvr/daemon/unittests/testSi.cpp | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/p2pvr/daemon/unittests/testSi.cpp b/p2pvr/daemon/unittests/testSi.cpp index 73f92f3..a894155 100644 --- a/p2pvr/daemon/unittests/testSi.cpp +++ b/p2pvr/daemon/unittests/testSi.cpp @@ -13,9 +13,11 @@ #include <boost/uuid/uuid_io.hpp> #include <boost/lexical_cast.hpp> #include "mockDefs.h" +#include "icetraySupport.h" using namespace P2PVR; using namespace P2PVR::Testing; +using namespace std::literals; BOOST_GLOBAL_FIXTURE( StandardMockDatabase ); @@ -68,19 +70,19 @@ BOOST_AUTO_TEST_CASE( si_getEventsInScheds ) BOOST_AUTO_TEST_CASE( si_getEventsInRange ) { - si->EventsInRange(Common::DateTime {2014, 12, 19, 3, 0}, Common::DateTime {2014, 12, 20, 3, 0}); + si->EventsInRange(Chrono::DateTime {2014, 12, 19, 3, 0}, Chrono::DateTime {2014, 12, 20, 3, 0}); } BOOST_AUTO_TEST_CASE( si_getEventSearch ) { - si->EventSearch("Top Gear", IceUtil::Optional< ::Ice::Int >(), - IceUtil::Optional<Common::DateTime>(), IceUtil::Optional<Common::DateTime>()); - si->EventSearch("Top Gear", 22272, - IceUtil::Optional<Common::DateTime>(), IceUtil::Optional<Common::DateTime>()); - si->EventSearch("Top Gear", 22272, - Common::DateTime {2014, 12, 19, 3, 0}, IceUtil::Optional<Common::DateTime>()); - si->EventSearch("Top Gear", 22272, - Common::DateTime {2014, 12, 19, 3, 0}, Common::DateTime {2014, 12, 20, 3, 0}); + si->EventSearch("Top Gear"s, Ice::optional< ::Ice::Int >(), + Ice::optional<Chrono::DateTime>(), Ice::optional<Chrono::DateTime>()); + si->EventSearch("Top Gear"s, 22272, + Ice::optional<Chrono::DateTime>(), Ice::optional<Chrono::DateTime>()); + si->EventSearch("Top Gear"s, 22272, + Chrono::DateTime {2014, 12, 19, 3, 0}, Ice::optional<Chrono::DateTime>()); + si->EventSearch("Top Gear"s, 22272, + Chrono::DateTime {2014, 12, 19, 3, 0}, Chrono::DateTime {2014, 12, 20, 3, 0}); } BOOST_AUTO_TEST_CASE( si_getAllDeliveries ) @@ -93,7 +95,7 @@ BOOST_AUTO_TEST_CASE( si_getDeliveryForTransport ) { auto del = si->GetDeliveryForTransport(4170); BOOST_REQUIRE(del); - auto dvbt = DVBSI::TerrestrialDeliveryPtr::dynamicCast(del); + auto dvbt = std::dynamic_pointer_cast<DVBSI::TerrestrialDelivery>(del); BOOST_REQUIRE(dvbt); BOOST_REQUIRE_EQUAL(dvbt->TransportStreamId, 4170); } @@ -102,7 +104,7 @@ BOOST_AUTO_TEST_CASE( si_getDeliveryForSI ) { auto del = si->GetDeliveryForSi(); BOOST_REQUIRE(del); - auto dvbt = DVBSI::TerrestrialDeliveryPtr::dynamicCast(del); + auto dvbt = std::dynamic_pointer_cast<DVBSI::TerrestrialDelivery>(del); BOOST_REQUIRE(dvbt); } @@ -110,7 +112,7 @@ BOOST_AUTO_TEST_CASE( si_getDeliveryForService ) { auto del = si->GetDeliveryForService(4170); BOOST_REQUIRE(del); - auto dvbt = DVBSI::TerrestrialDeliveryPtr::dynamicCast(del); + auto dvbt = std::dynamic_pointer_cast<DVBSI::TerrestrialDelivery>(del); BOOST_REQUIRE(dvbt); BOOST_REQUIRE_EQUAL(dvbt->TransportStreamId, 4170); } @@ -119,8 +121,10 @@ BOOST_AUTO_TEST_CASE( si_getServices ) { auto services = si->GetServices(); BOOST_REQUIRE_EQUAL(services.size(), 145); - BOOST_REQUIRE_EQUAL(services[0]->Name, "BBC ONE Yorks"); - BOOST_REQUIRE_EQUAL(services[0]->DefaultAuthority, "fp.bbc.co.uk"); + BOOST_REQUIRE(services[0]->Name); + BOOST_REQUIRE_EQUAL(*services[0]->Name, "BBC ONE Yorks"); + BOOST_REQUIRE(services[0]->DefaultAuthority); + BOOST_REQUIRE_EQUAL(*services[0]->DefaultAuthority, "fp.bbc.co.uk"); BOOST_REQUIRE_EQUAL(services[0]->EitSchedule, true); BOOST_REQUIRE_EQUAL(services[0]->EitPresentFollowing, true); } @@ -128,8 +132,10 @@ BOOST_AUTO_TEST_CASE( si_getServices ) BOOST_AUTO_TEST_CASE( si_getService ) { auto service = si->GetService(4170); - BOOST_REQUIRE_EQUAL(service->Name, "BBC ONE Yorks"); - BOOST_REQUIRE_EQUAL(service->DefaultAuthority, "fp.bbc.co.uk"); + BOOST_REQUIRE(service->Name); + BOOST_REQUIRE_EQUAL(*service->Name, "BBC ONE Yorks"); + BOOST_REQUIRE(service->DefaultAuthority); + BOOST_REQUIRE_EQUAL(*service->DefaultAuthority, "fp.bbc.co.uk"); BOOST_REQUIRE_EQUAL(service->EitSchedule, true); BOOST_REQUIRE_EQUAL(service->EitPresentFollowing, true); } |