2 Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic 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.
11 DCP-o-matic 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.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
21 /** @file test/video_mxf_content_test.cc
22 * @brief Test use of Video MXF content.
27 #include "lib/video_mxf_content.h"
28 #include "lib/content_factory.h"
29 #include "lib/dcp_content_type.h"
30 #include "lib/ratio.h"
32 #include <dcp/mono_picture_asset.h>
33 #include <boost/test/unit_test.hpp>
35 using boost::shared_ptr;
36 using boost::dynamic_pointer_cast;
38 static boost::filesystem::path ref_mxf = "test/data/scaling_test_185_185/j2c_bff270b1-cf7c-483b-be22-265aee6097ba.mxf";
40 static void note (dcp::NoteType, std::string)
45 /** Basic test of using video MXF content */
46 BOOST_AUTO_TEST_CASE (video_mxf_content_test)
48 shared_ptr<Film> film = new_test_film ("video_mxf_content_test");
49 film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
50 film->set_container (Ratio::from_id ("185"));
51 film->set_name ("video_mxf_content_test");
53 shared_ptr<Content> content = content_factory(ref_mxf).front();
54 shared_ptr<VideoMXFContent> check = dynamic_pointer_cast<VideoMXFContent> (content);
55 BOOST_REQUIRE (check);
56 film->examine_and_add_content (content);
57 BOOST_REQUIRE (!wait_for_jobs());
59 BOOST_REQUIRE (!wait_for_jobs());
61 shared_ptr<dcp::MonoPictureAsset> ref (new dcp::MonoPictureAsset (ref_mxf));
62 boost::filesystem::directory_iterator i ("build/test/video_mxf_content_test/video");
63 shared_ptr<dcp::MonoPictureAsset> comp (new dcp::MonoPictureAsset (*i));
64 dcp::EqualityOptions op;
65 BOOST_CHECK (ref->equals (comp, op, note));