Don't use "NR" in the ISDCF name if there is no rating.
[dcpomatic.git] / test / isdcf_name_test.cc
index 4d17f704c4507bbe0cfeddeade2b339f4151aee4..b1561289581e9f35a216a4e148f05c99d6b85e3d 100644 (file)
@@ -96,9 +96,9 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
        film->set_interop (false);
        BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV");
 
-       /* Test to see that RU ratings like 6+ survive */
+       /* Test to see that RU ratings like 6+ are stripped of their + */
        film->set_ratings({dcp::Rating("RARS", "6+")});
-       BOOST_CHECK_EQUAL (film->dcp_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-6+_MOS_4K_DI_20140704_PPF_SMPTE_OV");
+       BOOST_CHECK_EQUAL (film->dcp_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-6_MOS_4K_DI_20140704_PPF_SMPTE_OV");
        film->set_ratings({dcp::Rating("MPA", "R")});
 
        /* Test interior aspect ratio: shouldn't be shown with trailers */
@@ -232,5 +232,10 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
        /* Check that the proper codes are used, not just part of the language code; in this case, QBP instead of PT (#2235) */
        film->set_audio_language(dcp::LanguageTag("pt-BR"));
        BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_QBP-fr_US-R_71-HI-VI_4K_DI_20140704_PPF_SMPTE_OV");
+
+       /* Check that nothing is added for non-existant ratings */
+       film->set_ratings({});
+       BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_QBP-fr_US_71-HI-VI_4K_DI_20140704_PPF_SMPTE_OV");
+
 }