summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-06-26 19:23:59 +0100
committerCarl Hetherington <cth@carlh.net>2013-06-26 19:23:59 +0100
commitd4833e319e1d5168b8ee4a7ac1f779a65d975f01 (patch)
treecaaba94f1c6e211062435229c8994f51b0f899ce
parent7699a43eab349c8d16dd084f457fe48363c70a5d (diff)
Add failing test for trim-end not working.
-rw-r--r--test/trimmer_test.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/trimmer_test.cc b/test/trimmer_test.cc
index 605f7d1b2..ad2f2f6f5 100644
--- a/test/trimmer_test.cc
+++ b/test/trimmer_test.cc
@@ -20,12 +20,14 @@
using boost::shared_ptr;
shared_ptr<const Image> trimmer_test_last_video;
+int trimmer_test_video_frames = 0;
shared_ptr<const AudioBuffers> trimmer_test_last_audio;
void
trimmer_test_video_helper (shared_ptr<const Image> image, bool, shared_ptr<Subtitle>)
{
trimmer_test_last_video = image;
+ ++trimmer_test_video_frames;
}
void
@@ -92,4 +94,17 @@ BOOST_AUTO_TEST_CASE (trimmer_audio_test)
BOOST_CHECK (trimmer_test_last_audio == 0);
}
+BOOST_AUTO_TEST_CASE (trim_end_test)
+{
+ Trimmer trimmer (shared_ptr<Log> (), 0, 75, 200, 48000, 25, 25);
+
+ shared_ptr<SimpleImage> image (new SimpleImage (PIX_FMT_RGB24, libdcp::Size (256, 256), true));
+ trimmer.Video.connect (bind (&trimmer_test_video_helper, _1, _2, _3));
+ trimmer_test_video_frames = 0;
+ for (int i = 0; i < 200; ++i) {
+ trimmer.process_video (image, false, shared_ptr<Subtitle> ());
+ }
+
+ BOOST_CHECK_EQUAL (trimmer_test_video_frames, 125);
+}