+
+
+/** Read some more metadata from v2.14.x that fails to open on 2.15.x */
+BOOST_AUTO_TEST_CASE (metadata_loads_from_2_14_x_2)
+{
+ namespace fs = boost::filesystem;
+ auto dir = fs::path("build/test/metadata_loads_from_2_14_x_2");
+ fs::remove_all(dir);
+ auto film = make_shared<Film>(dir);
+ fs::copy_file("test/data/2.14.x.metadata.2.xml", dir / "metadata.xml");
+ auto notes = film->read_metadata(dir / "metadata.xml");
+ BOOST_REQUIRE_EQUAL (notes.size(), 1U);
+ BOOST_REQUIRE_EQUAL (notes.front(),
+ "A subtitle or closed caption file in this project is marked with the language 'eng', "
+ "which DCP-o-matic does not recognise. The file's language has been cleared."
+ );
+}
+
+
+BOOST_AUTO_TEST_CASE (metadata_loads_from_2_14_x_3)
+{
+ namespace fs = boost::filesystem;
+ auto dir = fs::path("build/test/metadata_loads_from_2_14_x_3");
+ fs::remove_all(dir);
+ auto film = make_shared<Film>(dir);
+ fs::copy_file("test/data/2.14.x.metadata.3.xml", dir / "metadata.xml");
+ auto notes = film->read_metadata(dir / "metadata.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));
+}
+
+
+/** Check that an empty <MasteredLuminance> tag results in the film's luminance being unset */
+BOOST_AUTO_TEST_CASE (metadata_loads_from_2_14_x_4)
+{
+ namespace fs = boost::filesystem;
+ auto dir = fs::path("build/test/metadata_loads_from_2_14_x_4");
+ fs::remove_all(dir);
+ auto film = make_shared<Film>(dir);
+ fs::copy_file("test/data/2.14.x.metadata.4.xml", dir / "metadata.xml");
+ auto notes = film->read_metadata(dir / "metadata.xml");
+
+ BOOST_REQUIRE (!film->luminance());
+}
+