Fix subrip test.
authorCarl Hetherington <cth@carlh.net>
Fri, 2 May 2014 08:03:08 +0000 (09:03 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 2 May 2014 08:03:08 +0000 (09:03 +0100)
src/lib/subrip_content.cc
test/subrip_test.cc

index 9524cf96baa8fa4b55f6650681e3d69bdfa939c2..eb9c67d9a1948b709544c9cee4588e7e431545ce 100644 (file)
@@ -50,7 +50,10 @@ SubRipContent::examine (boost::shared_ptr<Job> job)
 {
        Content::examine (job);
        SubRip s (shared_from_this ());
+
        shared_ptr<const Film> film = _film.lock ();
+       assert (film);
+       
        DCPTime len (s.length (), film->active_frame_rate_change (position ()));
 
        boost::mutex::scoped_lock lm (_mutex);
index 48bb265d515a5865b82bcfa5b28b125e589d8a61..3ea68737fdd892c23e1db0d4747d61bf2b2b7450 100644 (file)
@@ -125,7 +125,8 @@ BOOST_AUTO_TEST_CASE (subrip_content_test)
 /** Test parsing of full SubRip file content */
 BOOST_AUTO_TEST_CASE (subrip_parse_test)
 {
-       shared_ptr<SubRipContent> content (new SubRipContent (shared_ptr<Film> (), "test/data/subrip.srt"));
+       shared_ptr<Film> film = new_test_film ("subrip_test");
+       shared_ptr<SubRipContent> content (new SubRipContent (film, "test/data/subrip.srt"));
        content->examine (shared_ptr<Job> ());
        BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds ((3 * 60) + 56.471));