2 Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <boost/test/unit_test.hpp>
22 #include "picture_mxf.h"
23 #include "picture_mxf_writer.h"
27 /* Test writing and reading of frame_info_test with fstream and stdio */
28 BOOST_AUTO_TEST_CASE (frame_info_test)
30 dcp::FrameInfo a (8589934592LL, 17179869184LL, "thisisahash");
32 ofstream o1 ("build/test/frame_info1");
36 FILE* o2 = fopen ("build/test/frame_info2", "w");
41 ifstream c1 ("build/test/frame_info1");
45 ifstream c2 ("build/test/frame_info2");
49 BOOST_CHECK_EQUAL (s1, s2);
51 ifstream l1 ("build/test/frame_info1");
52 dcp::FrameInfo b1 (l1);
54 FILE* l2 = fopen ("build/test/frame_info2", "r");
56 dcp::FrameInfo b2 (l2);
58 BOOST_CHECK_EQUAL (b1.offset, b2.offset);
59 BOOST_CHECK_EQUAL (b1.size, b2.size);
60 BOOST_CHECK_EQUAL (b1.hash, b2.hash);