Move some functions up the file so we can use them.
[dcpomatic.git] / test / film_metadata_test.cc
index f1313497adae172d82fbe3396a9c29d1a169ee97..80ecf3881f793c094ff1da8a2d83ec29732e1069 100644 (file)
@@ -41,7 +41,7 @@
 using std::string;
 using std::list;
 using std::make_shared;
-using std::shared_ptr;
+using std::vector;
 
 
 BOOST_AUTO_TEST_CASE (film_metadata_test)
@@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE (film_metadata_test)
        film->set_release_territory (dcp::LanguageTag::RegionSubtag("US"));
        film->write_metadata ();
 
-       list<string> ignore = { "Key", "ContextID" };
+       list<string> ignore = { "Key", "ContextID", "LastWrittenBy" };
        check_xml ("test/data/metadata.xml.ref", dir.string() + "/metadata.xml", ignore);
 
        auto g = make_shared<Film>(dir);
@@ -126,3 +126,28 @@ BOOST_AUTO_TEST_CASE (metadata_loads_from_2_14_x_2)
                       );
 }
 
+
+BOOST_AUTO_TEST_CASE (metadata_loads_from_2_14_x_3)
+{
+       namespace fs = boost::filesystem;
+       auto film = make_shared<Film>(fs::path("build/test/metadata_loads_from_2_14_x_3"));
+       auto notes = film->read_metadata(fs::path("test/data/2.14.x.metadata.3.xml"));
+
+       BOOST_REQUIRE (film->release_territory());
+       BOOST_REQUIRE (film->release_territory()->subtag() == dcp::LanguageTag::RegionSubtag("de").subtag());
+
+       BOOST_REQUIRE (film->audio_language());
+       BOOST_REQUIRE (*film->audio_language() == dcp::LanguageTag("sv-SE"));
+
+       BOOST_REQUIRE (film->content_versions() == vector<string>{"3"});
+       BOOST_REQUIRE (film->ratings() == vector<dcp::Rating>{ dcp::Rating("", "214rating") });
+       BOOST_REQUIRE_EQUAL (film->studio().get_value_or(""), "214studio");
+       BOOST_REQUIRE_EQUAL (film->facility().get_value_or(""), "214facility");
+       BOOST_REQUIRE_EQUAL (film->temp_version(), true);
+       BOOST_REQUIRE_EQUAL (film->pre_release(), true);
+       BOOST_REQUIRE_EQUAL (film->red_band(), true);
+       BOOST_REQUIRE_EQUAL (film->two_d_version_of_three_d(), true);
+       BOOST_REQUIRE_EQUAL (film->chain().get_value_or(""), "214chain");
+       BOOST_REQUIRE (film->luminance() == dcp::Luminance(14, dcp::Luminance::Unit::FOOT_LAMBERT));
+}
+