summaryrefslogtreecommitdiff
path: root/p2pvr/daemon
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-11-13 23:39:54 +0000
committerrandomdan <randomdan@localhost>2014-11-13 23:39:54 +0000
commit4ab586b9b2b009cf01d74029066e2a5cd1652781 (patch)
tree23888c87144aba426b8806a3e1f99060cf489102 /p2pvr/daemon
parentFix quirk (from glibc update?) around fields in struct tm and the _BSD_SOURCE... (diff)
downloadp2pvr-4ab586b9b2b009cf01d74029066e2a5cd1652781.tar.bz2
p2pvr-4ab586b9b2b009cf01d74029066e2a5cd1652781.tar.xz
p2pvr-4ab586b9b2b009cf01d74029066e2a5cd1652781.zip
Scattering of fixes to remove hacks around paths and fix running the build from folders other than the project root
Diffstat (limited to 'p2pvr/daemon')
-rw-r--r--p2pvr/daemon/Jamfile.jam16
-rw-r--r--p2pvr/daemon/recordings.cpp10
-rw-r--r--p2pvr/daemon/schedules.cpp16
-rw-r--r--p2pvr/daemon/si.cpp18
-rw-r--r--p2pvr/daemon/test/dummySelect.sql1
-rw-r--r--p2pvr/daemon/testEmbedding.cpp14
6 files changed, 52 insertions, 23 deletions
diff --git a/p2pvr/daemon/Jamfile.jam b/p2pvr/daemon/Jamfile.jam
index 96f60cb..38e14f4 100644
--- a/p2pvr/daemon/Jamfile.jam
+++ b/p2pvr/daemon/Jamfile.jam
@@ -1,3 +1,5 @@
+import testing ;
+
cpp-pch pch : pch.hpp :
<library>../ice//p2pvrice
<library>../lib//p2pvrlib
@@ -7,9 +9,11 @@ cpp-pch pch : pch.hpp :
<library>../daemonbase//p2pvrdaemonbase
;
+lib boost_utf : : <name>boost_unit_test_framework ;
+
lib p2pvrdaemon :
pch
- [ glob-tree *.cpp *.sql ]
+ [ glob-tree *.cpp *.sql : dummy* test*.cpp ]
:
<library>../ice//p2pvrice
<library>../lib//p2pvrlib
@@ -20,3 +24,13 @@ lib p2pvrdaemon :
<library>../daemonbase//p2pvrdaemonbase
<implicit-dependency>../../libtmdb//tmdb
;
+
+unit-test testEmbedding :
+ testEmbedding.cpp
+ test/dummySelect.sql
+ :
+ <define>BOOST_TEST_DYN_LINK
+ <library>boost_utf
+ <library>../lib//p2pvrlib
+ ;
+
diff --git a/p2pvr/daemon/recordings.cpp b/p2pvr/daemon/recordings.cpp
index bad8032..73cf77d 100644
--- a/p2pvr/daemon/recordings.cpp
+++ b/p2pvr/daemon/recordings.cpp
@@ -5,11 +5,11 @@
#include <logger.h>
#include "sqlContainerCreator.h"
-ResourceString(Recording_Insert, daemon_sql_Recordings_insert_sql);
-ResourceString(Recording_InsertNewId, daemon_sql_Recordings_insertNewId_sql);
-ResourceString(Recording_Delete, daemon_sql_Recordings_delete_sql);
-ResourceString(Recording_GetStorage, daemon_sql_Recordings_getStorage_sql);
-ResourceString(Recording_GetAll, daemon_sql_Recordings_getAll_sql);
+ResourceString(Recording_Insert, sql_Recordings_insert);
+ResourceString(Recording_InsertNewId, sql_Recordings_insertNewId);
+ResourceString(Recording_Delete, sql_Recordings_delete);
+ResourceString(Recording_GetStorage, sql_Recordings_getStorage);
+ResourceString(Recording_GetAll, sql_Recordings_getAll);
template<>
void
diff --git a/p2pvr/daemon/schedules.cpp b/p2pvr/daemon/schedules.cpp
index 90df59c..dab3917 100644
--- a/p2pvr/daemon/schedules.cpp
+++ b/p2pvr/daemon/schedules.cpp
@@ -12,14 +12,14 @@
#include <boost/date_time/posix_time/posix_time.hpp>
#include <instanceStore.impl.h>
-ResourceString(Schedules_GetCandidates, daemon_sql_Schedules_GetCandidates_sql);
-ResourceString(Schedules_insert, daemon_sql_Schedules_insert_sql);
-ResourceString(Schedules_insertNewId, daemon_sql_Schedules_insertNewId_sql);
-ResourceString(Schedules_update, daemon_sql_Schedules_update_sql);
-ResourceString(Schedules_delete, daemon_sql_Schedules_delete_sql);
-ResourceString(Schedules_selectAll, daemon_sql_Schedules_selectAll_sql);
-ResourceString(Schedules_selectById, daemon_sql_Schedules_selectById_sql);
-ResourceString(Schedules_scheduledToRecord, daemon_sql_Schedules_scheduledToRecord_sql);
+ResourceString(Schedules_GetCandidates, sql_Schedules_GetCandidates);
+ResourceString(Schedules_insert, sql_Schedules_insert);
+ResourceString(Schedules_insertNewId, sql_Schedules_insertNewId);
+ResourceString(Schedules_update, sql_Schedules_update);
+ResourceString(Schedules_delete, sql_Schedules_delete);
+ResourceString(Schedules_selectAll, sql_Schedules_selectAll);
+ResourceString(Schedules_selectById, sql_Schedules_selectById);
+ResourceString(Schedules_scheduledToRecord, sql_Schedules_scheduledToRecord);
std::string Schedules::SchedulerAlgorithm;
diff --git a/p2pvr/daemon/si.cpp b/p2pvr/daemon/si.cpp
index 9bda6c4..3259888 100644
--- a/p2pvr/daemon/si.cpp
+++ b/p2pvr/daemon/si.cpp
@@ -6,15 +6,15 @@
#include <linux/dvb/frontend.h>
#include <logger.h>
-ResourceString(SI_serviceNextUsed, daemon_sql_SI_serviceNextUsed_sql);
-ResourceString(SI_servicesSelectAll, daemon_sql_SI_servicesSelectAll_sql);
-ResourceString(SI_servicesSelectById, daemon_sql_SI_servicesSelectById_sql);
-ResourceString(SI_eventById, daemon_sql_SI_eventById_sql);
-ResourceString(SI_eventsOnNow, daemon_sql_SI_eventsOnNow_sql);
-ResourceString(SI_eventsInSchedule, daemon_sql_SI_eventsInSchedule_sql);
-ResourceString(SI_eventsInSchedules, daemon_sql_SI_eventsInSchedules_sql);
-ResourceString(SI_eventsInRange, daemon_sql_SI_eventsInRange_sql);
-ResourceString(SI_eventSearch, daemon_sql_SI_eventSearch_sql);
+ResourceString(SI_serviceNextUsed, sql_SI_serviceNextUsed);
+ResourceString(SI_servicesSelectAll, sql_SI_servicesSelectAll);
+ResourceString(SI_servicesSelectById, sql_SI_servicesSelectById);
+ResourceString(SI_eventById, sql_SI_eventById);
+ResourceString(SI_eventsOnNow, sql_SI_eventsOnNow);
+ResourceString(SI_eventsInSchedule, sql_SI_eventsInSchedule);
+ResourceString(SI_eventsInSchedules, sql_SI_eventsInSchedules);
+ResourceString(SI_eventsInRange, sql_SI_eventsInRange);
+ResourceString(SI_eventSearch, sql_SI_eventSearch);
P2PVR::Deliveries
SI::GetAllDeliveries(short type, const Ice::Current &)
diff --git a/p2pvr/daemon/test/dummySelect.sql b/p2pvr/daemon/test/dummySelect.sql
new file mode 100644
index 0000000..3f9397b
--- /dev/null
+++ b/p2pvr/daemon/test/dummySelect.sql
@@ -0,0 +1 @@
+SELECT stuff FROM things
diff --git a/p2pvr/daemon/testEmbedding.cpp b/p2pvr/daemon/testEmbedding.cpp
new file mode 100644
index 0000000..b0e01f1
--- /dev/null
+++ b/p2pvr/daemon/testEmbedding.cpp
@@ -0,0 +1,14 @@
+#define BOOST_TEST_MODULE embedding
+#include <boost/test/unit_test.hpp>
+
+#include "resources.h"
+
+ResourceString(DummySql, sql_dummySelect);
+
+BOOST_AUTO_TEST_CASE( embed )
+{
+ BOOST_REQUIRE_EQUAL(25, DummySql.length());
+ BOOST_REQUIRE_EQUAL(sql_dummySelect_len, DummySql.length());
+ BOOST_REQUIRE_EQUAL("SELECT stuff FROM things\n", DummySql);
+}
+