From 4ab586b9b2b009cf01d74029066e2a5cd1652781 Mon Sep 17 00:00:00 2001 From: randomdan Date: Thu, 13 Nov 2014 23:39:54 +0000 Subject: Scattering of fixes to remove hacks around paths and fix running the build from folders other than the project root --- libtmdb/Jamfile.jam | 3 +++ libtmdb/testModels.cpp | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'libtmdb') 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 : pthread ; +path-constant me : . ; + unit-test testModels : [ glob testModels.cpp ] : + ROOT=\"$(me)\" BOOST_TEST_DYN_LINK boost_utf 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("samples/searchMulti_breakingBad.json"); + auto results = Slicer::Deserialize((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("samples/movie_550.json"); + auto movie = Slicer::Deserialize((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("samples/tv_1396.json"); + auto tvSeries = Slicer::Deserialize((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); -- cgit v1.2.3