summaryrefslogtreecommitdiff
path: root/p2pvr/daemon/unittests/mockDevices.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'p2pvr/daemon/unittests/mockDevices.cpp')
-rw-r--r--p2pvr/daemon/unittests/mockDevices.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/p2pvr/daemon/unittests/mockDevices.cpp b/p2pvr/daemon/unittests/mockDevices.cpp
new file mode 100644
index 0000000..7c3dc2c
--- /dev/null
+++ b/p2pvr/daemon/unittests/mockDevices.cpp
@@ -0,0 +1,29 @@
+#include "mockDevices.h"
+#include <mockTuner.h>
+#include <Ice/ObjectAdapter.h>
+
+P2PVR::TunerPrx MockDevices::GetTunerSpecific(const DVBSI::DeliveryPtr&, const Ice::Current & ice)
+{
+ return P2PVR::PrivateTunerPrx::checkedCast(ice.adapter->addWithUUID(new MockTuner()));
+}
+
+P2PVR::TunerPrx MockDevices::GetTunerAny(Ice::Short, const DVBSI::DeliveryPtr&, const Ice::Current & ice)
+{
+ return P2PVR::PrivateTunerPrx::checkedCast(ice.adapter->addWithUUID(new MockTuner()));
+}
+
+P2PVR::PrivateTunerPrx MockDevices::GetPrivateTuner(Ice::Short, const Ice::Current & ice)
+{
+ return P2PVR::PrivateTunerPrx::checkedCast(ice.adapter->addWithUUID(new MockTuner()));
+}
+
+void MockDevices::ReleaseTuner(const P2PVR::TunerPrx & tuner, const Ice::Current & ice)
+{
+ ice.adapter->remove(tuner->ice_getIdentity());
+}
+
+Ice::Int MockDevices::TunerCount(const Ice::Current&)
+{
+ return 1;
+}
+