X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fframe_info_test.cc;h=02ff83aa59ebba64df2e555f5a7daea8f9371006;hb=2cc2026701c9e8268ba154ec9330c5d56cbdc240;hp=8f883f68b9416087e4856f1bc56b39af6819d3fd;hpb=24ce9ff6ecb266ba357d948067223891b190b07c;p=libdcp.git diff --git a/test/frame_info_test.cc b/test/frame_info_test.cc index 8f883f68..02ff83aa 100644 --- a/test/frame_info_test.cc +++ b/test/frame_info_test.cc @@ -19,14 +19,15 @@ #include #include -#include "picture_asset_writer.h" +#include "picture_mxf.h" +#include "picture_mxf_writer.h" using namespace std; -/* Test writing of frame_info_test with fstream and stdio */ +/* Test writing and reading of frame_info_test with fstream and stdio */ BOOST_AUTO_TEST_CASE (frame_info_test) { - libdcp::FrameInfo a (8589934592, 17179869184, "thisisahash"); + dcp::FrameInfo a (8589934592LL, 17179869184LL, "thisisahash"); ofstream o1 ("build/test/frame_info1"); a.write (o1); @@ -46,4 +47,15 @@ BOOST_AUTO_TEST_CASE (frame_info_test) getline (c2, s2); BOOST_CHECK_EQUAL (s1, s2); + + ifstream l1 ("build/test/frame_info1"); + dcp::FrameInfo b1 (l1); + + FILE* l2 = fopen ("build/test/frame_info2", "r"); + BOOST_CHECK (l2); + dcp::FrameInfo b2 (l2); + + BOOST_CHECK_EQUAL (b1.offset, b2.offset); + BOOST_CHECK_EQUAL (b1.size, b2.size); + BOOST_CHECK_EQUAL (b1.hash, b2.hash); }