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_asset_writer.h"
26 /* Test writing and reading of frame_info_test with fstream and stdio */
27 BOOST_AUTO_TEST_CASE (frame_info_test)
29 libdcp::FrameInfo a (8589934592, 17179869184, "thisisahash");
31 ofstream o1 ("build/test/frame_info1");
35 FILE* o2 = fopen ("build/test/frame_info2", "w");
40 ifstream c1 ("build/test/frame_info1");
44 ifstream c2 ("build/test/frame_info2");
48 BOOST_CHECK_EQUAL (s1, s2);
50 ifstream l1 ("build/test/frame_info1");
51 libdcp::FrameInfo b1 (l1);
53 FILE* l2 = fopen ("build/test/frame_info2", "r");
55 libdcp::FrameInfo b2 (l2);
57 BOOST_CHECK_EQUAL (b1.offset, b2.offset);
58 BOOST_CHECK_EQUAL (b1.size, b2.size);
59 BOOST_CHECK_EQUAL (b1.hash, b2.hash);