diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-05-08 00:15:51 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-05-08 00:15:51 +0100 |
| commit | 9facd099fd1b0651af721883ea1ffe5590d4b23b (patch) | |
| tree | 28044eba95ffb18fc37fc7f9fcb3685a09c49d0f | |
| parent | cc120b1a461fd91a8ea4553aa2f7fddce5f7f74a (diff) | |
| parent | 7b03aba8bc4e9df269430d79ce4ee2c6bd5f344c (diff) | |
Merge branch 'master' of ssh://main.carlh.net/home/carl/git/libdcp
| -rw-r--r-- | cscript | 4 | ||||
| -rwxr-xr-x | run/tests | 2 | ||||
| -rw-r--r-- | src/dcp_time.cc | 20 | ||||
| -rw-r--r-- | src/verify.cc | 4 | ||||
| -rw-r--r-- | test/dcp_time_test.cc | 4 | ||||
| -rw-r--r-- | test/frame_info_hash_test.cc | 4 | ||||
| -rw-r--r-- | test/verify_test.cc | 4 |
7 files changed, 32 insertions, 10 deletions
@@ -36,9 +36,9 @@ import shutil def dependencies(target, options): if (target.platform == 'windows' and target.version == 'xp') or (options is not None and 'jpeg' in options and options['jpeg'] == 'oj1'): - return (('libcxml', 'v0.15.5'), ('openjpeg-cdist', '4233dd7'), ('asdcplib-cth', 'f3b0fb8')) + return (('libcxml', 'a45e430'), ('openjpeg-cdist', '4233dd7'), ('asdcplib-cth', 'f3b0fb8')) else: - return (('libcxml', 'v0.15.5'), ('openjpeg2-cdist', 'c40a3b8'), ('asdcplib-cth', 'f3b0fb8')) + return (('libcxml', 'a45e430'), ('openjpeg2-cdist', 'c40a3b8'), ('asdcplib-cth', 'f3b0fb8')) def build(target, options): cmd = './waf configure --disable-examples --prefix=%s' % target.directory @@ -27,6 +27,8 @@ elif [ "$1" == "--callgrind" ]; then shift valgrind --tool="callgrind" $work/tests $private $* else + # This gives a warning from newer boost versions but doing it + # as $work/tests $* -- $private fails on older boost versions. $work/tests $private $* if [ "$?" != "0" ]; then echo "FAIL: unit tests" diff --git a/src/dcp_time.cc b/src/dcp_time.cc index f0b7e231..acc9723f 100644 --- a/src/dcp_time.cc +++ b/src/dcp_time.cc @@ -39,6 +39,7 @@ #include "dcp_time.h" #include "exceptions.h" #include "compose.hpp" +#include "dcp_assert.h" #include <boost/algorithm/string.hpp> #include <boost/optional.hpp> #include <iostream> @@ -356,5 +357,22 @@ Time::as_seconds () const Time Time::rebase (int tcr_) const { - return Time (h, m, s, lrintf (float (e) * tcr_ / tcr), tcr_); + long int e_ = lrintf (float (e) * tcr_ / tcr); + int s_ = s; + if (e_ >= tcr_) { + e_ -= tcr_; + ++s_; + } + int m_ = m; + if (s_ >= 60) { + s_ -= 60; + ++m_; + } + int h_ = h; + if (m_ >= 60) { + m_ -= 60; + ++h_; + } + + return Time (h_, m_, s_, e_, tcr_); } diff --git a/src/verify.cc b/src/verify.cc index ab6ba115..87958ed9 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -90,13 +90,13 @@ dcp::verify (vector<boost::filesystem::path> directories, function<void (string, if (reel->main_picture()) { stage ("Checking picture asset hash", reel->main_picture()->asset()->file()); if (verify_asset (reel->main_picture(), progress)) { - notes.push_back (VerificationNote (VerificationNote::VERIFY_ERROR, "Picture asset hash is incorrect")); + notes.push_back (VerificationNote (VerificationNote::VERIFY_ERROR, "Picture asset hash is incorrect.")); } } if (reel->main_sound()) { stage ("Checking sound asset hash", reel->main_sound()->asset()->file()); if (verify_asset (reel->main_sound(), progress)) { - notes.push_back (VerificationNote (VerificationNote::VERIFY_ERROR, "Sound asset hash is incorrect")); + notes.push_back (VerificationNote (VerificationNote::VERIFY_ERROR, "Sound asset hash is incorrect.")); } } } diff --git a/test/dcp_time_test.cc b/test/dcp_time_test.cc index 48a35b5a..405640f8 100644 --- a/test/dcp_time_test.cc +++ b/test/dcp_time_test.cc @@ -102,7 +102,9 @@ BOOST_AUTO_TEST_CASE (dcp_time) b = dcp::Time (9, 12, 41, 17, 99); BOOST_CHECK_EQUAL (b.rebase(250), dcp::Time(9, 12, 41, 43, 250)); a = dcp::Time (0, 2, 57, 999, 1000); - BOOST_CHECK_EQUAL (a.rebase(250), dcp::Time(0, 2, 57, 250, 250)); + BOOST_CHECK_EQUAL (a.rebase(250), dcp::Time(0, 2, 58, 0, 250)); + a = dcp::Time (0, 47, 9, 998, 1000); + BOOST_CHECK_EQUAL (a.rebase(250), dcp::Time(0, 47, 10, 0, 250)); /* Check some allowed constructions from string */ diff --git a/test/frame_info_hash_test.cc b/test/frame_info_hash_test.cc index d1f81d2c..8e894d29 100644 --- a/test/frame_info_hash_test.cc +++ b/test/frame_info_hash_test.cc @@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE (frame_info_hash_test) unsigned int seed = 42; /* Check a few random frames */ - check (&seed, writer, "bb19bc96466d1b65708dabafa2e2ec0f"); - check (&seed, writer, "426ec5ac52d7a27fe278f7736d53151f"); + check (&seed, writer, "c039c5a0e5d20bc646f7e9c10e2d5874"); + check (&seed, writer, "d9e694cfe84544c54a869c128ba39343"); check (&seed, writer, "fafb05a0039cb9fc604279c90a13cb87"); } diff --git a/test/verify_test.cc b/test/verify_test.cc index a0360730..f39d7ae6 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE (verify_test1) notes = dcp::verify (directories, &stage, &progress); BOOST_CHECK_EQUAL (notes.size(), 2); BOOST_CHECK_EQUAL (notes.front().type(), dcp::VerificationNote::VERIFY_ERROR); - BOOST_CHECK_EQUAL (notes.front().note(), "Picture asset hash is incorrect"); + BOOST_CHECK_EQUAL (notes.front().note(), "Picture asset hash is incorrect."); BOOST_CHECK_EQUAL (notes.back().type(), dcp::VerificationNote::VERIFY_ERROR); - BOOST_CHECK_EQUAL (notes.back().note(), "Sound asset hash is incorrect"); + BOOST_CHECK_EQUAL (notes.back().note(), "Sound asset hash is incorrect."); } |
