summaryrefslogtreecommitdiff
path: root/p2pvr/daemon/unittests/testp2ice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'p2pvr/daemon/unittests/testp2ice.cpp')
-rw-r--r--p2pvr/daemon/unittests/testp2ice.cpp40
1 files changed, 32 insertions, 8 deletions
diff --git a/p2pvr/daemon/unittests/testp2ice.cpp b/p2pvr/daemon/unittests/testp2ice.cpp
index 9f9e9a8..4d29cc9 100644
--- a/p2pvr/daemon/unittests/testp2ice.cpp
+++ b/p2pvr/daemon/unittests/testp2ice.cpp
@@ -2,18 +2,40 @@
#include <boost/test/unit_test.hpp>
#include <boost/filesystem/operations.hpp>
#include <testOptionsSource.h>
+#include <definedDirs.h>
+#include <sourceObject.h>
+#include <testAppInstance.h>
-#define XSTR(s) STR(s)
-#define STR(s) #s
-const auto bindir = boost::filesystem::canonical("/proc/self/exe").parent_path();
-const boost::filesystem::path variant = bindir.leaf();
-const boost::filesystem::path compiler = bindir.parent_path().leaf();
-const boost::filesystem::path root = boost::filesystem::path(XSTR(ROOT)).parent_path().parent_path();
+const boost::filesystem::path variant = BinDir.leaf();
+const boost::filesystem::path compiler = BinDir.parent_path().leaf();
+const boost::filesystem::path root = RootDir.parent_path().parent_path();
const boost::filesystem::path iceroot = root / "ice";
+static
+void
+commonTests()
+{
+ BOOST_REQUIRE(ElementLoader::getFor("p2pvrrecordingstream"));
+ BOOST_REQUIRE(ElementLoader::getFor("p2pvrservicestream"));
+ BOOST_REQUIRE(ElementLoader::getFor("P2PVR-SI-GetEvent"));
+}
+
+static
+void
+unloadTests()
+{
+ BOOST_REQUIRE_THROW(ElementLoader::getFor("P2PVR-SI-GetEvent"), NotSupported);
+ // Known issue, these *should* unload, but for some reason, don't.
+ BOOST_WARN_THROW(ElementLoader::getFor("p2pvrrecordingstream"), NotSupported);
+ BOOST_WARN_THROW(ElementLoader::getFor("p2pvrservicestream"), NotSupported);
+}
+
+BOOST_GLOBAL_FIXTURE( TestAppInstance );
BOOST_AUTO_TEST_CASE( compile_client_clientOnly )
{
+ TestOptionsSource::LoadTestOptions({ });
+
const std::string tmpdir = "/tmp/ut/p2pvr.slice";
BOOST_TEST_CHECKPOINT("Clean up");
boost::filesystem::remove_all(tmpdir);
@@ -23,13 +45,15 @@ BOOST_AUTO_TEST_CASE( compile_client_clientOnly )
{ "ice.compile.tmpdir", tmpdir },
{ "ice.client.slicerclient", (iceroot / "common.ice").string() },
{ "library", (root / "ice" / "bin" / compiler / variant / "slicer-yes" / "libp2pvrice.so").string() },
+ { "library", (root / "dvb" / "bin" / compiler / variant / "libp2pvrdvb.so").string() },
+ { "library", (root / "lib" / "bin" / compiler / variant / "libp2pvrlib.so").string() },
{ "library", (root / "p2comp" / "bin" / compiler / variant / "libp2pvrp2comp.so").string() },
{ "ice.client.slicerclient", (iceroot / "dvbsi.ice").string() },
{ "ice.client.slicerclient", (iceroot / "dvb.ice").string() },
{ "ice.client.slicerclient", (iceroot / "p2pvr.ice").string() },
});
- //commonTests();
+ commonTests();
TestOptionsSource::LoadTestOptions({ });
- //unloadTests();
+ unloadTests();
}