summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-11-25 08:36:16 +0000
committerCarl Hetherington <cth@carlh.net>2013-11-25 08:36:16 +0000
commitd03382e1ffd8b9094b03044daaca99336740c3c4 (patch)
tree84b4ad592e885b743f60704b1bfa0cf094f60053 /test
parent24ce9ff6ecb266ba357d948067223891b190b07c (diff)
Add FILE * constructor for FrameInfo.
Diffstat (limited to 'test')
-rw-r--r--test/frame_info_test.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/frame_info_test.cc b/test/frame_info_test.cc
index 8f883f68..c242d07e 100644
--- a/test/frame_info_test.cc
+++ b/test/frame_info_test.cc
@@ -23,7 +23,7 @@
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");
@@ -46,4 +46,15 @@ BOOST_AUTO_TEST_CASE (frame_info_test)
getline (c2, s2);
BOOST_CHECK_EQUAL (s1, s2);
+
+ ifstream l1 ("build/test/frame_info1");
+ libdcp::FrameInfo b1 (l1);
+
+ FILE* l2 = fopen ("build/test/frame_info2", "r");
+ BOOST_CHECK (l2);
+ libdcp::FrameInfo b2 (l2);
+
+ BOOST_CHECK_EQUAL (b1.offset, b2.offset);
+ BOOST_CHECK_EQUAL (b1.size, b2.size);
+ BOOST_CHECK_EQUAL (b1.hash, b2.hash);
}