diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-07-07 15:11:34 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-07-07 15:11:34 +0100 |
| commit | 3618ca642ef77e1a0fd56988bc1cd90a6b822fca (patch) | |
| tree | 105260637f41232d52e26cec0ce364d45d942dd3 | |
| parent | d704110228aae2bc7cd2ebc8ccd23d78be4fef9b (diff) | |
Arch build fixes.
| -rwxr-xr-x | asdcplib/src/h__Writer.cpp | 15 | ||||
| -rw-r--r-- | src/stl_text_reader.h | 1 | ||||
| -rw-r--r-- | test/dcp_reader_test.cc | 43 | ||||
| -rw-r--r-- | test/test.cc | 9 |
4 files changed, 36 insertions, 32 deletions
diff --git a/asdcplib/src/h__Writer.cpp b/asdcplib/src/h__Writer.cpp index d743e30..b24fa9c 100755 --- a/asdcplib/src/h__Writer.cpp +++ b/asdcplib/src/h__Writer.cpp @@ -31,6 +31,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "AS_DCP_internal.h" #include "KLV.h" +#include <iostream> using std::cout; using namespace ASDCP; @@ -104,7 +105,7 @@ AddDMScrypt(Partition& HeaderPart, SourcePackage& Package, HeaderPart.AddChildObject(Segment); Seq->StructuralComponents.push_back(Segment->InstanceUID); Segment->EventComment = "AS-DCP KLV Encryption"; - + CryptographicFramework* CFW = new CryptographicFramework(Dict); HeaderPart.AddChildObject(CFW); Segment->DMFramework = CFW->InstanceUID; @@ -272,7 +273,7 @@ ASDCP::h__Writer::AddSourceClip(const MXF::Rational& EditRate, ui32_t TCFrameRat MPTrack.Clip->SourceTrackID = 2; m_DurationUpdateList.push_back(&(MPTrack.Clip->Duration)); - + // // File (Source) Package // @@ -363,7 +364,7 @@ ASDCP::h__Writer::AddDMSegment(const MXF::Rational& EditRate, ui32_t TCFrameRate // MPTrack.Clip->SourceTrackID = 2; m_DurationUpdateList.push_back(&(MPTrack.Clip->Duration)); - + // // File (Source) Package // @@ -454,7 +455,7 @@ ASDCP::h__Writer::CreateBodyPart(const MXF::Rational& EditRate, ui32_t BytesPerE UL OPAtomUL(m_Dict->ul(MDD_OPAtom)); m_BodyPart.OperationalPattern = OPAtomUL; m_HeaderPart.m_RIP.PairArray.push_back(RIP::Pair(1, m_BodyPart.ThisPartition)); // Second RIP Entry - + UL BodyUL(m_Dict->ul(MDD_ClosedCompleteBodyPartition)); result = m_BodyPart.WriteToFile(m_File, BodyUL); } @@ -627,7 +628,7 @@ ASDCP::h__Writer::WriteEKLVPacket(const ASDCP::FrameBuffer& FrameBuf, const byte if ( ASDCP_SUCCESS(result) ) result = m_File.Writev(Overhead.Data(), Overhead.Length()); - + if ( ASDCP_SUCCESS(result) ) result = m_File.Writev((byte_t*)FrameBuf.RoData(), FrameBuf.Size()); @@ -664,8 +665,8 @@ ASDCP::h__Writer::WriteMXFFooter() { // Set top-level file package correctly for OP-Atom - // m_MPTCSequence->Duration = m_MPTimecode->Duration = m_MPClSequence->Duration = m_MPClip->Duration = - // m_FPTCSequence->Duration = m_FPTimecode->Duration = m_FPClSequence->Duration = m_FPClip->Duration = + // m_MPTCSequence->Duration = m_MPTimecode->Duration = m_MPClSequence->Duration = m_MPClip->Duration = + // m_FPTCSequence->Duration = m_FPTimecode->Duration = m_FPClSequence->Duration = m_FPClip->Duration = DurationElementList_t::iterator dli = m_DurationUpdateList.begin(); diff --git a/src/stl_text_reader.h b/src/stl_text_reader.h index 5309040..c966a2f 100644 --- a/src/stl_text_reader.h +++ b/src/stl_text_reader.h @@ -22,6 +22,7 @@ #include "reader.h" #include <boost/optional.hpp> +#include <iostream> namespace sub { diff --git a/test/dcp_reader_test.cc b/test/dcp_reader_test.cc index a5ec975..d17d146 100644 --- a/test/dcp_reader_test.cc +++ b/test/dcp_reader_test.cc @@ -20,6 +20,7 @@ #include "interop_dcp_reader.h" #include "collect.h" #include <boost/test/unit_test.hpp> +#include <boost/optional/optional_io.hpp> #include <fstream> using std::list; @@ -179,7 +180,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (b.text, "At afternoon tea with John Peel"); BOOST_CHECK_EQUAL (b.effect, sub::BORDER); BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0)); - + ++j; BOOST_REQUIRE (j != i->lines.end ()); BOOST_REQUIRE_EQUAL (j->blocks.size(), 1); @@ -197,7 +198,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) ++j; BOOST_CHECK (j == i->lines.end ()); } - + ++i; BOOST_REQUIRE (i != subs.end ()); BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 0, 50, 42 * 4)); @@ -259,7 +260,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (b.text, "At home it depends how I feel.\""); BOOST_CHECK_EQUAL (b.effect, sub::BORDER); BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0)); - + ++j; BOOST_REQUIRE (j != i->lines.end ()); BOOST_REQUIRE_EQUAL (j->blocks.size(), 1); @@ -288,7 +289,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 16, 42 * 4)); BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0)); BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0)); - + { list<sub::Line>::iterator j = i->lines.begin (); BOOST_REQUIRE (j != i->lines.end ()); @@ -303,7 +304,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (b.text, "With the legendary Miss Enid Blyton"); BOOST_CHECK_EQUAL (b.effect, sub::BORDER); BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0)); - + ++j; BOOST_REQUIRE (j != i->lines.end ()); BOOST_REQUIRE_EQUAL (j->blocks.size(), 1); @@ -327,8 +328,8 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 1, 20, 219 * 4)); BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 22, 73 * 4)); BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0)); - BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0)); - + BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0)); + { list<sub::Line>::iterator j = i->lines.begin (); BOOST_REQUIRE (j != i->lines.end ()); @@ -343,7 +344,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (b.text, "and I'll show you my body\""); BOOST_CHECK_EQUAL (b.effect, sub::BORDER); BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0)); - + ++j; BOOST_REQUIRE (j != i->lines.end ()); BOOST_REQUIRE_EQUAL (j->blocks.size(), 1); @@ -368,7 +369,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 28, 208 * 4)); BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0)); BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0)); - + { list<sub::Line>::iterator j = i->lines.begin (); BOOST_REQUIRE (j != i->lines.end ()); @@ -383,7 +384,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (b.text, "That curious creature the Sphinx"); BOOST_CHECK_EQUAL (b.effect, sub::BORDER); BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0)); - + ++j; BOOST_REQUIRE (j != i->lines.end ()); BOOST_REQUIRE_EQUAL (j->blocks.size(), 1); @@ -423,7 +424,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (b.text, "It sits there and smirks"); BOOST_CHECK_EQUAL (b.effect, sub::BORDER); BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0)); - + ++j; BOOST_REQUIRE (j != i->lines.end ()); BOOST_REQUIRE_EQUAL (j->blocks.size(), 1); @@ -448,7 +449,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 47, 94 * 4)); BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0)); BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0)); - + { list<sub::Line>::iterator j = i->lines.begin (); BOOST_REQUIRE (j != i->lines.end ()); @@ -463,7 +464,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (b.text, "Then when you're not looking, it winks."); BOOST_CHECK_EQUAL (b.effect, sub::BORDER); BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0)); - + ++j; BOOST_REQUIRE (j != i->lines.end ()); BOOST_REQUIRE_EQUAL (j->blocks.size(), 1); @@ -488,7 +489,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 48, 167 * 4)); BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0)); BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0)); - + { list<sub::Line>::iterator j = i->lines.begin (); BOOST_REQUIRE (j != i->lines.end ()); @@ -503,7 +504,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (b.text, "Out mooning, at night, on the ledge"); BOOST_CHECK_EQUAL (b.effect, sub::BORDER); BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0)); - + ++j; BOOST_REQUIRE (j != i->lines.end ()); BOOST_REQUIRE_EQUAL (j->blocks.size(), 1); @@ -521,14 +522,14 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) ++j; BOOST_CHECK (j == i->lines.end ()); } - + ++i; BOOST_REQUIRE (i != subs.end ()); BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 1, 53, 21 * 4)); BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 56, 10 * 4)); BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0)); BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0)); - + { list<sub::Line>::iterator j = i->lines.begin (); BOOST_REQUIRE (j != i->lines.end ()); @@ -543,7 +544,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (b.text, "Is the maestro, James Brown"); BOOST_CHECK_EQUAL (b.effect, sub::BORDER); BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0)); - + ++j; BOOST_REQUIRE (j != i->lines.end ()); BOOST_REQUIRE_EQUAL (j->blocks.size(), 1); @@ -561,14 +562,14 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) ++j; BOOST_CHECK (j == i->lines.end ()); } - + ++i; BOOST_REQUIRE (i != subs.end ()); BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 2, 5, 208 * 4)); BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 2, 7, 31 * 4)); BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0)); BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0)); - + { list<sub::Line>::iterator j = i->lines.begin (); BOOST_REQUIRE (j != i->lines.end ()); @@ -583,7 +584,7 @@ BOOST_AUTO_TEST_CASE (dcp_reader_test2) BOOST_CHECK_EQUAL (b.text, "HELLO"); BOOST_CHECK_EQUAL (b.effect, sub::BORDER); BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0)); - + ++j; BOOST_REQUIRE (j != i->lines.end ()); BOOST_REQUIRE_EQUAL (j->blocks.size(), 1); diff --git a/test/test.cc b/test/test.cc index 693e5b2..9cbfe14 100644 --- a/test/test.cc +++ b/test/test.cc @@ -23,6 +23,7 @@ #include <boost/filesystem.hpp> #include <fstream> #include <string> +#include <iostream> #include "iso6937_tables.h" using std::string; @@ -63,10 +64,10 @@ check_text (boost::filesystem::path a, boost::filesystem::path b) if (!boost::filesystem::exists (b)) { cerr << "File not found: " << b << "\n"; } - + BOOST_CHECK (boost::filesystem::exists (a)); BOOST_CHECK (boost::filesystem::exists (b)); - + ifstream p (a.c_str ()); ifstream q (b.c_str ()); @@ -91,7 +92,7 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check) BOOST_CHECK (ref_file); FILE* check_file = fopen (check.string().c_str(), "rb"); BOOST_CHECK (check_file); - + int const buffer_size = 65536; uint8_t* ref_buffer = new uint8_t[buffer_size]; uint8_t* check_buffer = new uint8_t[buffer_size]; @@ -109,7 +110,7 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check) s << "Files differ at offset " << (offset + i) << "; reference is " << hex << ((int) ref_buffer[i]) << ", check is " << hex << ((int) check_buffer[i]); - + BOOST_CHECK_MESSAGE (ref_buffer[i] == check_buffer[i], s.str ()); } |
