summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-01-24 17:41:00 +0000
committerCarl Hetherington <cth@carlh.net>2015-01-24 17:41:00 +0000
commit59e769023c392c332331567a1aea94660002c463 (patch)
treee68d918e3c48f470a688b8bb5bf95590fb9c4916 /test
parent5af65f61bf6eba06c24025d63b43aec896a00c9c (diff)
Hand-apply bbfb370d7de28ec1e8f307865cc6253bb5d4366e from master; quicker digest calculation.
Diffstat (limited to 'test')
-rw-r--r--test/4k_test.cc4
-rw-r--r--test/audio_analysis_test.cc2
-rw-r--r--test/audio_delay_test.cc2
-rw-r--r--test/black_fill_test.cc4
-rw-r--r--test/dcp_subtitle_test.cc2
-rw-r--r--test/ffmpeg_audio_test.cc2
-rw-r--r--test/ffmpeg_dcp_test.cc2
-rw-r--r--test/ffmpeg_decoder_seek_test.cc4
-rw-r--r--test/ffmpeg_decoder_sequential_test.cc2
-rw-r--r--test/frame_rate_test.cc2
-rw-r--r--test/import_dcp_test.cc4
-rw-r--r--test/isdcf_name_test.cc2
-rw-r--r--test/play_test.cc4
-rw-r--r--test/player_test.cc8
-rw-r--r--test/recover_test.cc2
-rw-r--r--test/repeat_frame_test.cc2
-rw-r--r--test/scaling_test.cc2
-rw-r--r--test/seek_zero_test.cc2
-rw-r--r--test/silence_padding_test.cc2
-rw-r--r--test/skip_frame_test.cc4
-rw-r--r--test/threed_test.cc4
-rw-r--r--test/upmixer_a_test.cc4
-rw-r--r--test/util_test.cc15
-rw-r--r--test/xml_subtitle_test.cc4
24 files changed, 47 insertions, 38 deletions
diff --git a/test/4k_test.cc b/test/4k_test.cc
index 63c5f5435..de4e5218b 100644
--- a/test/4k_test.cc
+++ b/test/4k_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE (fourk_test)
film->set_resolution (RESOLUTION_4K);
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
film->set_container (Ratio::from_id ("185"));
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
film->make_dcp ();
diff --git a/test/audio_analysis_test.cc b/test/audio_analysis_test.cc
index 2da38f455..279944919 100644
--- a/test/audio_analysis_test.cc
+++ b/test/audio_analysis_test.cc
@@ -84,7 +84,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test)
boost::filesystem::path p = private_data / "betty_L.wav";
shared_ptr<SndfileContent> c (new SndfileContent (film, p));
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
c->analyse_audio (boost::bind (&finished));
diff --git a/test/audio_delay_test.cc b/test/audio_delay_test.cc
index 0127cc644..68e14ff3c 100644
--- a/test/audio_delay_test.cc
+++ b/test/audio_delay_test.cc
@@ -51,7 +51,7 @@ void test_audio_delay (int delay_in_ms)
shared_ptr<SndfileContent> content (new SndfileContent (film, "test/data/staircase.wav"));
content->set_audio_delay (delay_in_ms);
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
film->make_dcp ();
diff --git a/test/black_fill_test.cc b/test/black_fill_test.cc
index 99e0870b1..5981552d1 100644
--- a/test/black_fill_test.cc
+++ b/test/black_fill_test.cc
@@ -40,8 +40,8 @@ BOOST_AUTO_TEST_CASE (black_fill_test)
shared_ptr<ImageContent> contentA (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
shared_ptr<ImageContent> contentB (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
- film->examine_and_add_content (contentA, true);
- film->examine_and_add_content (contentB, true);
+ film->examine_and_add_content (contentA);
+ film->examine_and_add_content (contentB);
wait_for_jobs ();
contentA->set_scale (VideoContentScale (Ratio::from_id ("185")));
diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc
index 08e8a5cc0..314b214f2 100644
--- a/test/dcp_subtitle_test.cc
+++ b/test/dcp_subtitle_test.cc
@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test)
film->set_name ("frobozz");
film->set_burn_subtitles (false);
shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml"));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (2));
diff --git a/test/ffmpeg_audio_test.cc b/test/ffmpeg_audio_test.cc
index 5117cf412..444b0869b 100644
--- a/test/ffmpeg_audio_test.cc
+++ b/test/ffmpeg_audio_test.cc
@@ -44,7 +44,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_audio_test)
shared_ptr<Film> film = new_test_film ("ffmpeg_audio_test");
film->set_name ("ffmpeg_audio_test");
shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/staircase.mov"));
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
diff --git a/test/ffmpeg_dcp_test.cc b/test/ffmpeg_dcp_test.cc
index 8b441db98..559277e51 100644
--- a/test/ffmpeg_dcp_test.cc
+++ b/test/ffmpeg_dcp_test.cc
@@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_dcp_test)
shared_ptr<Film> film = new_test_film ("ffmpeg_dcp_test");
film->set_name ("test_film2");
shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
diff --git a/test/ffmpeg_decoder_seek_test.cc b/test/ffmpeg_decoder_seek_test.cc
index 3274fd8a9..f3504ffc5 100644
--- a/test/ffmpeg_decoder_seek_test.cc
+++ b/test/ffmpeg_decoder_seek_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -60,7 +60,7 @@ test (boost::filesystem::path file, vector<int> frames)
shared_ptr<Film> film = new_test_film ("ffmpeg_decoder_seek_test_" + file.string());
shared_ptr<FFmpegContent> content (new FFmpegContent (film, path));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
shared_ptr<Log> log (new NullLog);
FFmpegDecoder decoder (content, log);
diff --git a/test/ffmpeg_decoder_sequential_test.cc b/test/ffmpeg_decoder_sequential_test.cc
index cf1fb8189..c5f43173e 100644
--- a/test/ffmpeg_decoder_sequential_test.cc
+++ b/test/ffmpeg_decoder_sequential_test.cc
@@ -47,7 +47,7 @@ test (boost::filesystem::path file, float fps, int gaps)
shared_ptr<Film> film = new_test_film ("ffmpeg_decoder_seek_test_" + file.string());
shared_ptr<FFmpegContent> content (new FFmpegContent (film, path));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
shared_ptr<Log> log (new NullLog);
FFmpegDecoder decoder (content, log);
diff --git a/test/frame_rate_test.cc b/test/frame_rate_test.cc
index 0ed5a64a7..e8ebcea3b 100644
--- a/test/frame_rate_test.cc
+++ b/test/frame_rate_test.cc
@@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
shared_ptr<Film> film = new_test_film ("audio_sampling_rate_test");
/* Get any piece of content, it doesn't matter what */
shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/test.mp4"));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
std::list<int> afr;
diff --git a/test/import_dcp_test.cc b/test/import_dcp_test.cc
index b2420b1fe..80cd9c3df 100644
--- a/test/import_dcp_test.cc
+++ b/test/import_dcp_test.cc
@@ -39,7 +39,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test)
A->set_name ("frobozz");
shared_ptr<FFmpegContent> c (new FFmpegContent (A, "test/data/test.mp4"));
- A->examine_and_add_content (c, true);
+ A->examine_and_add_content (c);
A->set_encrypted (true);
wait_for_jobs ();
@@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test)
shared_ptr<DCPContent> d (new DCPContent (B, "build/test/import_dcp_test/" + A->dcp_name()));
d->add_kdm (kdm);
- B->examine_and_add_content (d, true);
+ B->examine_and_add_content (d);
wait_for_jobs ();
B->make_dcp ();
diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc
index b0b83de44..c2ea833bd 100644
--- a/test/isdcf_name_test.cc
+++ b/test/isdcf_name_test.cc
@@ -73,7 +73,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
/* Test interior aspect ratio: shouldn't be shown with trailers */
shared_ptr<ImageContent> content (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
content->set_scale (VideoContentScale (Ratio::from_id ("133")));
film->set_container (Ratio::from_id ("185"));
diff --git a/test/play_test.cc b/test/play_test.cc
index f7aa52d6f..bbf70781a 100644
--- a/test/play_test.cc
+++ b/test/play_test.cc
@@ -87,13 +87,13 @@ BOOST_AUTO_TEST_CASE (play_test)
film->set_name ("play_test");
shared_ptr<FFmpegContent> A (new FFmpegContent (film, "test/data/red_24.mp4"));
- film->examine_and_add_content (A, true);
+ film->examine_and_add_content (A);
wait_for_jobs ();
BOOST_CHECK_EQUAL (A->video_length_after_3d_combine(), 16);
shared_ptr<FFmpegContent> B (new FFmpegContent (film, "test/data/red_30.mp4"));
- film->examine_and_add_content (B, true);
+ film->examine_and_add_content (B);
wait_for_jobs ();
BOOST_CHECK_EQUAL (B->video_length_after_3d_combine(), 16);
diff --git a/test/player_test.cc b/test/player_test.cc
index d7a55b57a..b6f864f82 100644
--- a/test/player_test.cc
+++ b/test/player_test.cc
@@ -44,9 +44,9 @@ BOOST_AUTO_TEST_CASE (player_overlaps_test)
shared_ptr<FFmpegContent> B (new FFmpegContent (film, "test/data/test.mp4"));
shared_ptr<FFmpegContent> C (new FFmpegContent (film, "test/data/test.mp4"));
- film->examine_and_add_content (A, true);
- film->examine_and_add_content (B, true);
- film->examine_and_add_content (C, true);
+ film->examine_and_add_content (A);
+ film->examine_and_add_content (B);
+ film->examine_and_add_content (C);
wait_for_jobs ();
BOOST_CHECK_EQUAL (A->full_length(), DCPTime (288000));
@@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE (player_silence_padding_test)
film->set_container (Ratio::from_id ("185"));
film->set_audio_channels (6);
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
shared_ptr<Player> player = film->make_player ();
diff --git a/test/recover_test.cc b/test/recover_test.cc
index d442b6a4d..a0886fbf4 100644
--- a/test/recover_test.cc
+++ b/test/recover_test.cc
@@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE (recover_test)
shared_ptr<ImageContent> content (new ImageContent (film, "test/data/3d_test"));
content->set_video_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
film->make_dcp ();
diff --git a/test/repeat_frame_test.cc b/test/repeat_frame_test.cc
index d312ae7ed..1d19d269e 100644
--- a/test/repeat_frame_test.cc
+++ b/test/repeat_frame_test.cc
@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE (repeat_frame_test)
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/red_24.mp4"));
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
diff --git a/test/scaling_test.cc b/test/scaling_test.cc
index d642271c2..441af6bf3 100644
--- a/test/scaling_test.cc
+++ b/test/scaling_test.cc
@@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE (scaling_test)
film->set_name ("scaling_test");
shared_ptr<ImageContent> imc (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
- film->examine_and_add_content (imc, true);
+ film->examine_and_add_content (imc);
wait_for_jobs ();
diff --git a/test/seek_zero_test.cc b/test/seek_zero_test.cc
index 7abe7fa26..2a1a06136 100644
--- a/test/seek_zero_test.cc
+++ b/test/seek_zero_test.cc
@@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE (seek_zero_test)
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/count300bd48.m2ts"));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
content->set_scale (VideoContentScale (Ratio::from_id ("185")));
diff --git a/test/silence_padding_test.cc b/test/silence_padding_test.cc
index 25f2d80c9..d876a0228 100644
--- a/test/silence_padding_test.cc
+++ b/test/silence_padding_test.cc
@@ -48,7 +48,7 @@ test_silence_padding (int channels)
film->set_name (film_name);
shared_ptr<SndfileContent> content (new SndfileContent (film, "test/data/staircase.wav"));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
film->set_audio_channels (channels);
diff --git a/test/skip_frame_test.cc b/test/skip_frame_test.cc
index 3e4f895c5..dac7b5a25 100644
--- a/test/skip_frame_test.cc
+++ b/test/skip_frame_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE (skip_frame_test)
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/count300bd48.m2ts"));
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
diff --git a/test/threed_test.cc b/test/threed_test.cc
index 0553d4c0f..f51a77109 100644
--- a/test/threed_test.cc
+++ b/test/threed_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE (threed_test)
film->set_name ("test_film2");
shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
c->set_video_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
diff --git a/test/upmixer_a_test.cc b/test/upmixer_a_test.cc
index bdca521a2..9bcbf3a69 100644
--- a/test/upmixer_a_test.cc
+++ b/test/upmixer_a_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE (upmixer_a_test)
film->set_name ("frobozz");
shared_ptr<SndfileContent> content (new SndfileContent (film, "test/data/white.wav"));
content->set_audio_processor (AudioProcessor::from_id ("stereo-5.1-upmix-a"));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
diff --git a/test/util_test.cc b/test/util_test.cc
index 43b7b9b1d..2a66cb855 100644
--- a/test/util_test.cc
+++ b/test/util_test.cc
@@ -33,12 +33,21 @@ BOOST_AUTO_TEST_CASE (md5_digest_test)
{
vector<boost::filesystem::path> p;
p.push_back ("test/data/md5.test");
- string const t = md5_digest (p, shared_ptr<Job> ());
- BOOST_CHECK_EQUAL (t, "15058685ba99decdc4398c7634796eb0");
+ BOOST_CHECK_EQUAL (md5_digest_head_tail (p, 1024), "57497ef84a0487f2bb0939a1f5703912");
+ p.push_back ("test/data/md5.test2");
+ BOOST_CHECK_EQUAL (md5_digest_head_tail (p, 1024), "5a3a89857b931755ae728a518224a05c");
+
+ p.clear ();
+ p.push_back ("test/data/md5.test3");
+ p.push_back ("test/data/md5.test");
+ p.push_back ("test/data/md5.test2");
+ p.push_back ("test/data/md5.test4");
+ BOOST_CHECK_EQUAL (md5_digest_head_tail (p, 1024), "52ccf111e4e72b58bb7b2aaa6bd45ea5");
+
p.clear ();
p.push_back ("foobar");
- BOOST_CHECK_THROW (md5_digest (p, shared_ptr<Job> ()), std::runtime_error);
+ BOOST_CHECK_THROW (md5_digest_head_tail (p, 1024), OpenFileError);
}
/* Straightforward test of DCPTime::round_up */
diff --git a/test/xml_subtitle_test.cc b/test/xml_subtitle_test.cc
index f6452c788..7c3ca3efe 100644
--- a/test/xml_subtitle_test.cc
+++ b/test/xml_subtitle_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE (xml_subtitle_test)
film->set_burn_subtitles (false);
shared_ptr<SubRipContent> content (new SubRipContent (film, "test/data/subrip2.srt"));
content->set_use_subtitles (true);
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
film->make_dcp ();
wait_for_jobs ();