summaryrefslogtreecommitdiff
path: root/libtmdb
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 /libtmdb
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 'libtmdb')
-rw-r--r--libtmdb/Jamfile.jam3
-rw-r--r--libtmdb/testModels.cpp10
2 files changed, 10 insertions, 3 deletions
diff --git a/libtmdb/Jamfile.jam b/libtmdb/Jamfile.jam
index 8b6d246..bbdb3b6 100644
--- a/libtmdb/Jamfile.jam
+++ b/libtmdb/Jamfile.jam
@@ -34,9 +34,12 @@ lib tmdb :
<library>pthread
;
+path-constant me : . ;
+
unit-test testModels :
[ glob testModels.cpp ]
:
+ <define>ROOT=\"$(me)\"
<define>BOOST_TEST_DYN_LINK
<library>boost_utf
<library>tmdb
diff --git a/libtmdb/testModels.cpp b/libtmdb/testModels.cpp
index fe2dbab..fac4e65 100644
--- a/libtmdb/testModels.cpp
+++ b/libtmdb/testModels.cpp
@@ -14,9 +14,13 @@ namespace std {
}
};
+#define XSTR(s) STR(s)
+#define STR(s) #s
+const boost::filesystem::path root(XSTR(ROOT));
+
BOOST_AUTO_TEST_CASE( deserialize_searchmulti_json )
{
- auto results = Slicer::Deserialize<Slicer::JsonFileDeserializer, TMDb::SearchMultiResults>("samples/searchMulti_breakingBad.json");
+ auto results = Slicer::Deserialize<Slicer::JsonFileDeserializer, TMDb::SearchMultiResults>((root / "samples" / "searchMulti_breakingBad.json").string());
BOOST_REQUIRE_EQUAL(1, results->Page);
BOOST_REQUIRE_EQUAL(1, results->TotalPages);
BOOST_REQUIRE_EQUAL(3, results->TotalResults);
@@ -41,7 +45,7 @@ BOOST_AUTO_TEST_CASE( deserialize_searchmulti_json )
BOOST_AUTO_TEST_CASE( deserialize_movie_json )
{
- auto movie = Slicer::Deserialize<Slicer::JsonFileDeserializer, TMDb::Movie>("samples/movie_550.json");
+ auto movie = Slicer::Deserialize<Slicer::JsonFileDeserializer, TMDb::Movie>((root / "samples" / "movie_550.json").string());
BOOST_REQUIRE_EQUAL(550, movie->Id);
BOOST_REQUIRE_EQUAL(false, movie->Adult);
BOOST_REQUIRE_EQUAL("/8uO0gUM8aNqYLs1OsTBQiXu0fEv.jpg", movie->BackdropPath);
@@ -76,7 +80,7 @@ BOOST_AUTO_TEST_CASE( deserialize_movie_json )
BOOST_AUTO_TEST_CASE( deserialize_tvseries_json )
{
- auto tvSeries = Slicer::Deserialize<Slicer::JsonFileDeserializer, TMDb::TvSeries>("samples/tv_1396.json");
+ auto tvSeries = Slicer::Deserialize<Slicer::JsonFileDeserializer, TMDb::TvSeries>((root / "samples" / "tv_1396.json").string());
BOOST_REQUIRE_EQUAL("/sIJyCJedGlZf1TId41gCtkblBGo.jpg", tvSeries->BackdropPath);
BOOST_REQUIRE_EQUAL(1, tvSeries->CreatedBy.size());
BOOST_REQUIRE_EQUAL(66633, tvSeries->CreatedBy.front().Id);