/*
- Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2020-2022 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
#include "lib/audio_content.h"
+#include "lib/config.h"
#include "lib/content.h"
#include "lib/content_factory.h"
#include "lib/cross.h"
auto film = new_test_film2 (name);
- auto ccap = fopen_boost (String::compose("build/test/%1.srt", name), "w");
+ dcp::File ccap(String::compose("build/test/%1.srt", name), "w");
BOOST_REQUIRE (ccap);
for (int i = 0; i < 2048; ++i) {
- fprintf(ccap, "%d\n", i + 1);
+ fprintf(ccap.get(), "%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");
+ fprintf(ccap.get(), "00:%02d:%02d,000 --> 00:%02d:%02d,000\n", minute, second, minute, second + 1);
+ fprintf(ccap.get(), "Here are some closed captions.\n\n");
}
- fclose (ccap);
+ ccap.close();
auto content = content_factory("build/test/" + name + ".srt").front();
content->text.front()->set_type (TextType::CLOSED_CAPTION);
"Some of your content has audio but you have not set the audio language. It is advisable to set the audio language "
"in the \"DCP\" tab unless your audio has no spoken parts."
);
+}
+
+
+BOOST_AUTO_TEST_CASE (hints_certificate_validity)
+{
+ ConfigRestorer cr;
+
+ Config::instance()->set_signer_chain(make_shared<dcp::CertificateChain>(openssl_path(), 40 * 365));
+ auto film = new_test_film2 ("hints_certificate_validity");
+ auto hints = get_hints (film);
+ BOOST_REQUIRE_EQUAL (hints.size(), 1U);
+ BOOST_CHECK_EQUAL (
+ hints[0],
+ "The certificate chain that DCP-o-matic uses for signing DCPs and KDMs has a validity period "
+ "that is too long. This will cause problems playing back DCPs on some systems. "
+ "You are advised to re-create the signing certificate chain by clicking the "
+ "\"Re-make certificates and key...\" button in the Keys page of Preferences."
+ );
}