Cleanup: test tidying.
[dcpomatic.git] / test / frame_rate_test.cc
index 292dff8dbb05b2b290cb152e326023d9f9120b89..d54868b3fbde8ca6ee4ec921cd6fdd6c25b12d17 100644 (file)
 
 */
 
+
 /** @file  test/frame_rate_test.cc
  *  @brief Tests for FrameRateChange and the computation of the best
  *  frame rate for the DCP.
- *  @ingroup specific
+ *  @ingroup feature
  */
 
-#include <boost/test/unit_test.hpp>
-#include "lib/film.h"
+
+#include "lib/audio_content.h"
 #include "lib/config.h"
-#include "lib/ffmpeg_content.h"
-#include "lib/playlist.h"
 #include "lib/ffmpeg_audio_stream.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/film.h"
 #include "lib/frame_rate_change.h"
+#include "lib/playlist.h"
 #include "lib/video_content.h"
-#include "lib/audio_content.h"
 #include "test.h"
+#include <boost/test/unit_test.hpp>
+
 
-using boost::shared_ptr;
 
 /* Test Playlist::best_dcp_frame_rate and FrameRateChange
    with a single piece of content.
 */
 BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
 {
-       shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_single");
+       auto film = new_test_film("best_dcp_frame_rate_test_single");
        /* Get any piece of content, it doesn't matter what */
-       shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/test.mp4"));
+       auto content = std::make_shared<FFmpegContent>("test/data/test.mp4");
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
 
@@ -58,7 +60,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
 
        content->_video_frame_rate = 60;
        int best = film->best_video_frame_rate ();
-       FrameRateChange frc = FrameRateChange (60, best);
+       auto frc = FrameRateChange(60, best);
        BOOST_CHECK_EQUAL (best, 30);
        BOOST_CHECK_EQUAL (frc.skip, true);
        BOOST_CHECK_EQUAL (frc.repeat, 1);
@@ -220,11 +222,11 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
 */
 BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_double)
 {
-       shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_double");
+       auto film = new_test_film("best_dcp_frame_rate_test_double");
        /* Get any old content, it doesn't matter what */
-       shared_ptr<FFmpegContent> A (new FFmpegContent("test/data/test.mp4"));
+       auto A = std::make_shared<FFmpegContent>("test/data/test.mp4");
        film->examine_and_add_content (A);
-       shared_ptr<FFmpegContent> B (new FFmpegContent("test/data/test.mp4"));
+       auto B = std::make_shared<FFmpegContent>("test/data/test.mp4");
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs());
 
@@ -251,9 +253,9 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_double)
 
 BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
 {
-       shared_ptr<Film> film = new_test_film ("audio_sampling_rate_test");
+       auto film = new_test_film("audio_sampling_rate_test");
        /* Get any piece of content, it doesn't matter what */
-       shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/test.mp4"));
+       auto content = std::make_shared<FFmpegContent>("test/data/test.mp4");
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
 
@@ -263,7 +265,7 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
        afr.push_back (30);
        Config::instance()->set_allowed_dcp_frame_rates (afr);
 
-       shared_ptr<FFmpegAudioStream> stream (new FFmpegAudioStream ("foo", 0, 0, 0, 0));
+       auto stream = std::make_shared<FFmpegAudioStream>("foo", 0, 0, 0, 0, 0);
        content->audio.reset (new AudioContent (content.get()));
        content->audio->add_stream (stream);
        content->_video_frame_rate = 24;