+
+BOOST_AUTO_TEST_CASE (hint_subtitle_mxf_too_big)
+{
+ string const name = "hint_subtitle_mxf_too_big";
+
+ shared_ptr<Film> film = new_test_film2 (name);
+ shared_ptr<Content> content = content_factory("test/data/" + name + ".srt").front();
+ content->text.front()->set_type (TEXT_OPEN_SUBTITLE);
+ for (int i = 1; i < 512; ++i) {
+ shared_ptr<dcpomatic::Font> font(new dcpomatic::Font(String::compose("font_%1", i)));
+ font->set_file ("test/data/LiberationSans-Regular.ttf");
+ content->text.front()->add_font(font);
+ }
+ film->examine_and_add_content (content);
+ BOOST_REQUIRE (!wait_for_jobs());
+ vector<string> hints = get_hints (film);
+
+ BOOST_REQUIRE_EQUAL (hints.size(), 1);
+ BOOST_CHECK_EQUAL (
+ hints[0],
+ "At least one of your subtitle files is larger than " MAX_TEXT_MXF_SIZE_TEXT " in total. "
+ "You should divide the DCP into shorter reels."
+ );
+}
+
+
+BOOST_AUTO_TEST_CASE (hint_closed_caption_xml_too_big)
+{
+ string const name = "hint_closed_caption_xml_too_big";
+
+ shared_ptr<Film> film = new_test_film2 (name);
+
+ FILE* ccap = fopen_boost (String::compose("build/test/%1.srt", name), "w");
+ BOOST_REQUIRE (ccap);
+ for (int i = 0; i < 2048; ++i) {
+ fprintf(ccap, "%d\n", i + 1);
+ int second = i * 2;
+ int minute = second % 60;
+ fprintf(ccap, "00:%02d:%02d,000 --> 00:%02d:%02d,000\n", minute, second, minute, second + 1);
+ fprintf(ccap, "Here are some closed captions.\n\n");
+ }
+ fclose (ccap);
+
+ shared_ptr<Content> content = content_factory("build/test/" + name + ".srt").front();
+ content->text.front()->set_type (TEXT_CLOSED_CAPTION);
+ film->examine_and_add_content (content);
+ BOOST_REQUIRE (!wait_for_jobs());
+ vector<string> hints = get_hints (film);
+
+ BOOST_REQUIRE_EQUAL (hints.size(), 1);
+ BOOST_CHECK_EQUAL (
+ hints[0],
+ "At least one of your closed caption files' XML part is larger than " MAX_CLOSED_CAPTION_XML_SIZE_TEXT ". "
+ "You should divide the DCP into shorter reels."
+ );
+}
+