summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-02-13 10:47:22 +0000
committerCarl Hetherington <cth@carlh.net>2018-02-13 10:47:22 +0000
commit8f8ffead78f16269f22b5b0354395d0a583873fa (patch)
tree62f1a714669e65779cb970bcf35789e3056766c5
parentec6b451c615134984688a2085d6c3f9fcfa870bc (diff)
Add some tolerance when checking audio references.
-rw-r--r--test/ffmpeg_encoder_test.cc7
-rw-r--r--test/test.cc8
-rw-r--r--test/test.h2
3 files changed, 8 insertions, 9 deletions
diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc
index df64a2c48..c847619d9 100644
--- a/test/ffmpeg_encoder_test.cc
+++ b/test/ffmpeg_encoder_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2017 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2017-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -221,8 +221,5 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_basic_test_mixdown)
FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_basic_test_mixdown.mp4", FFmpegEncoder::FORMAT_H264, true);
encoder.go ();
- /* Skip the first video packet when checking as it contains x264 options which can vary between machines
- (e.g. number of threads used for encoding).
- */
- check_ffmpeg ("build/test/ffmpeg_encoder_basic_test_mixdown.mp4", "test/data/ffmpeg_encoder_basic_test_mixdown.mp4");
+ check_ffmpeg ("build/test/ffmpeg_encoder_basic_test_mixdown.mp4", "test/data/ffmpeg_encoder_basic_test_mixdown.mp4", 1);
}
diff --git a/test/test.cc b/test/test.cc
index 551f64dbd..f829a86f6 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -34,6 +34,8 @@
#include "lib/ratio.h"
#include "lib/dcp_content_type.h"
#include "lib/log_entry.h"
+#include "lib/compose.hpp"
+#include "test.h"
#include <dcp/dcp.h>
#include <dcp/cpl.h>
#include <dcp/reel.h>
@@ -436,9 +438,9 @@ write_image (shared_ptr<const Image> image, boost::filesystem::path file, string
}
void
-check_ffmpeg (boost::filesystem::path ref, boost::filesystem::path check)
+check_ffmpeg (boost::filesystem::path ref, boost::filesystem::path check, int audio_tolerance)
{
- int const r = system (string("ffcmp " + ref.string() + " " + check.string()).c_str());
+ int const r = system (String::compose("ffcmp -t %1 %2 %3", audio_tolerance, ref.string(), check.string()).c_str());
BOOST_REQUIRE_EQUAL (WEXITSTATUS(r), 0);
}
diff --git a/test/test.h b/test/test.h
index ff5a2a34e..78fa26b43 100644
--- a/test/test.h
+++ b/test/test.h
@@ -35,7 +35,7 @@ extern void check_wav_file (boost::filesystem::path ref, boost::filesystem::path
extern void check_mxf_audio_file (boost::filesystem::path ref, boost::filesystem::path check);
extern void check_xml (boost::filesystem::path, boost::filesystem::path, std::list<std::string>);
extern void check_file (boost::filesystem::path, boost::filesystem::path);
-extern void check_ffmpeg (boost::filesystem::path, boost::filesystem::path);
+extern void check_ffmpeg (boost::filesystem::path, boost::filesystem::path, int audio_tolerance);
extern void check_image (boost::filesystem::path, boost::filesystem::path);
extern boost::filesystem::path test_film_dir (std::string);
extern void write_image (boost::shared_ptr<const Image> image, boost::filesystem::path file, std::string format);