diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-02-14 12:36:23 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-02-14 21:40:06 +0100 |
| commit | a632e34e3c9ca94574fcab1b3006227ed2833766 (patch) | |
| tree | d8bbfa15962fc466a3ec0173f7ed778e1792a188 /test/dcpomatic_time_test.cc | |
| parent | 39fce9acb7869c551fded172aa070d75c7a9bc50 (diff) | |
Fix incorrect coalesce() output when one input range is wholly
covered by another.
Diffstat (limited to 'test/dcpomatic_time_test.cc')
| -rw-r--r-- | test/dcpomatic_time_test.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/dcpomatic_time_test.cc b/test/dcpomatic_time_test.cc index e4383b539..5d23f2478 100644 --- a/test/dcpomatic_time_test.cc +++ b/test/dcpomatic_time_test.cc @@ -302,6 +302,18 @@ BOOST_AUTO_TEST_CASE (dcpomatic_time_period_coalesce_test5) BOOST_CHECK (q.back() == DCPTimePeriod(DCPTime(100), DCPTime(106))); } +BOOST_AUTO_TEST_CASE (test_coalesce_with_overlapping_periods) +{ + DCPTimePeriod A (DCPTime(0), DCPTime(10)); + DCPTimePeriod B (DCPTime(2), DCPTime(8)); + list<DCPTimePeriod> p; + p.push_back (A); + p.push_back (B); + auto q = coalesce(p); + BOOST_REQUIRE_EQUAL (q.size(), 1U); + BOOST_CHECK (q.front() == DCPTimePeriod(DCPTime(0), DCPTime(10))); +} + /* Straightforward test of DCPTime::ceil */ BOOST_AUTO_TEST_CASE (dcpomatic_time_ceil_test) { |
