Rename read_interop_subtitle_test -> interop_subtitle_test.
[libdcp.git] / test / reel_asset_test.cc
1 /*
2     Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
3
4     This file is part of libdcp.
5
6     libdcp is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     libdcp is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with libdcp.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "reel_mono_picture_asset.h"
21 #include <libcxml/cxml.h>
22 #include <boost/test/unit_test.hpp>
23
24 using boost::shared_ptr;
25
26 /** Test the XML constructor of ReelPictureAsset */
27 BOOST_AUTO_TEST_CASE (reel_picture_asset_test)
28 {
29         shared_ptr<cxml::Document> doc (new cxml::Document ("MainPicture"));
30
31         doc->read_string (
32                 "<MainPicture>"
33                 "<Id>urn:uuid:06ac1ca7-9c46-4107-8864-a6448e24b04b</Id>"
34                 "<AnnotationText></AnnotationText>"
35                 "<EditRate>24 1</EditRate>"
36                 "<IntrinsicDuration>187048</IntrinsicDuration>"
37                 "<EntryPoint>0</EntryPoint>"
38                 "<Duration>187048</Duration>"
39                 "<Hash>6EQX4NjG8vxIWhLUtHhrGSyLgOY=</Hash>"
40                 "<FrameRate>24 1</FrameRate>"
41                 "<ScreenAspectRatio>2048 858</ScreenAspectRatio>"
42                 "</MainPicture>"
43                 );
44
45         dcp::ReelMonoPictureAsset pa (doc);
46         BOOST_CHECK_EQUAL (pa.screen_aspect_ratio(), dcp::Fraction (2048, 858));
47 }