diff options
Diffstat (limited to 'p2pvr/daemon/unittests/mockDevices.cpp')
-rw-r--r-- | p2pvr/daemon/unittests/mockDevices.cpp | 90 |
1 files changed, 6 insertions, 84 deletions
diff --git a/p2pvr/daemon/unittests/mockDevices.cpp b/p2pvr/daemon/unittests/mockDevices.cpp index 3e04c85..12203b0 100644 --- a/p2pvr/daemon/unittests/mockDevices.cpp +++ b/p2pvr/daemon/unittests/mockDevices.cpp @@ -4,94 +4,16 @@ namespace P2PVR { namespace Testing { - void MockDevices::ScanAndSendNetworkInformation(const RawDataClientPrx & target, const ::Ice::Current & ice) + MockDevices::MockDevices(Ice::CommunicatorPtr c) : + ic(c) { - MockTuner mt(ice.adapter->getCommunicator()); - mt.ScanAndSendNetworkInformation(target); + devices.push_back("/dev/dvb/dummy"); } - void MockDevices::SendNetworkInformation(const ::DVBSI::DeliveryPtr & del, const RawDataClientPrx & target, const ::Ice::Current & ice) + TunerPtr + MockDevices::openTuner(const boost::filesystem::path &) const { - BOOST_ASSERT(del); - MockTuner mt(ice.adapter->getCommunicator()); - mt.SendNetworkInformation(target); - } - - void MockDevices::SendBouquetAssociations(const ::DVBSI::DeliveryPtr & del, const RawDataClientPrx & target, const ::Ice::Current & ice) - { - BOOST_ASSERT(del); - MockTuner mt(ice.adapter->getCommunicator()); - mt.SendBouquetAssociations(target); - } - - void MockDevices::SendServiceDescriptions(const ::DVBSI::DeliveryPtr & del, const RawDataClientPrx & target, const ::Ice::Current & ice) - { - BOOST_ASSERT(del); - MockTuner mt(ice.adapter->getCommunicator()); - mt.SendServiceDescriptions(target); - } - - void MockDevices::SendProgramAssociationTable(const ::DVBSI::DeliveryPtr & del, const RawDataClientPrx & target, const ::Ice::Current & ice) - { - BOOST_ASSERT(del); - MockTuner mt(ice.adapter->getCommunicator()); - mt.SendProgramAssociationTable(target); - } - - void MockDevices::SendProgramMap(const ::DVBSI::DeliveryPtr & del, ::Ice::Int pid, const RawDataClientPrx & target, const ::Ice::Current & ice) - { - BOOST_ASSERT(del); - MockTuner mt(ice.adapter->getCommunicator()); - mt.SendProgramMap(pid, target); - } - - void MockDevices::SendEventInformation(const ::DVBSI::DeliveryPtr & del, const RawDataClientPrx & target, const ::Ice::Current & ice) - { - BOOST_ASSERT(del); - MockTuner mt(ice.adapter->getCommunicator()); - mt.SendEventInformation(target); - } - - ::Ice::Int MockDevices::StartSendingTS(const ::DVBSI::DeliveryPtr & del, const PacketIds & pids, const RawDataClientPrx & target, const ::Ice::Current & ice) - { - BOOST_ASSERT(del); - TunerPtr tuner = new MockTuner(ice.adapter->getCommunicator()); - return bgOps.insert({ tuner->StartSendingTS(pids, target), tuner }).first->first; - } - - ::Ice::Int MockDevices::StartSendingSection(const ::DVBSI::DeliveryPtr & del, ::Ice::Int sid, const RawDataClientPrx & target, const ::Ice::Current & ice) - { - BOOST_ASSERT(del); - TunerPtr tuner = new MockTuner(ice.adapter->getCommunicator()); - return bgOps.insert({ tuner->StartSendingSection(sid, target), tuner }).first->first; - } - - void MockDevices::StopSending(::Ice::Int handle, const ::Ice::Current &) - { - BOOST_ASSERT(handle); - auto itr = bgOps.find(handle); - BOOST_ASSERT(itr != bgOps.end()); - BOOST_ASSERT(itr->second); - itr->second->StopSending(handle); - bgOps.erase(itr); - } - - - void MockDevices::Scan(const std::string &, const Ice::Current &) - { - } - - void MockDevices::Add(const std::string &, const Ice::Current &) - { - } - - void MockDevices::Remove(const std::string &, const Ice::Current &) - { - } - - ::Ice::Int MockDevices::TunerCount(const Ice::Current &) - { - return 1; + return new MockTuner(ic); } } } |