summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-07-09 22:53:27 +0200
committerCarl Hetherington <cth@carlh.net>2025-07-10 20:50:32 +0200
commit62c34b28567a097e8f22576e7d7891bd3dbe0ac0 (patch)
tree2a0440ed2bdb58c608582b75da6c877527dd6bda /test
parent2c499921a9f8615c8368d8161cb43c9a93c67311 (diff)
Replace String::compose with fmt.
sed -i "/Plural-Forms/n;/%100/n;/scanf/n;s/%[123456789]/{}/g" src/lib/*.cc src/lib/*.h src/wx/*.cc src/tools/*.cc src/lib/po/*.po src/wx/po/*.po src/tools/po/*.po test/*.cc sed -i "s/String::compose */fmt::format/g" src/lib/*.cc src/lib/*.h src/wx/*.cc src/tools/*.cc test/*.cc
Diffstat (limited to 'test')
-rw-r--r--test/audio_mapping_test.cc2
-rw-r--r--test/burnt_subtitle_test.cc10
-rw-r--r--test/cpl_hash_test.cc6
-rw-r--r--test/digest_test.cc2
-rw-r--r--test/ffmpeg_encoder_test.cc4
-rw-r--r--test/ffmpeg_properties_test.cc2
-rw-r--r--test/file_naming_test.cc4
-rw-r--r--test/hints_test.cc10
-rw-r--r--test/image_filename_sorter_test.cc4
-rw-r--r--test/image_test.cc2
-rw-r--r--test/kdm_naming_test.cc26
-rw-r--r--test/map_cli_test.cc26
-rw-r--r--test/markers_test.cc6
-rw-r--r--test/player_test.cc8
-rw-r--r--test/reels_test.cc2
-rw-r--r--test/subtitle_language_test.cc4
-rw-r--r--test/subtitle_position_test.cc4
-rw-r--r--test/test.cc10
-rw-r--r--test/threed_test.cc2
19 files changed, 67 insertions, 67 deletions
diff --git a/test/audio_mapping_test.cc b/test/audio_mapping_test.cc
index be850f805..d046a95d2 100644
--- a/test/audio_mapping_test.cc
+++ b/test/audio_mapping_test.cc
@@ -73,7 +73,7 @@ guess_check (boost::filesystem::path filename, int output_channel)
AudioMapping m (1, 8);
m.make_default (0, filename);
for (int i = 0; i < 8; ++i) {
- BOOST_TEST_INFO(String::compose("%1 channel %2", filename.string(), i));
+ BOOST_TEST_INFO(fmt::format("{} channel {}", filename.string(), i));
BOOST_CHECK_CLOSE (m.get(0, i), i == output_channel ? 1 : 0, 0.01);
}
}
diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc
index 6b2e64d6a..4bfb446d7 100644
--- a/test/burnt_subtitle_test.cc
+++ b/test/burnt_subtitle_test.cc
@@ -153,8 +153,8 @@ BOOST_AUTO_TEST_CASE(burnt_subtitle_test_position)
{
auto check = [](string alignment)
{
- auto const name = String::compose("burnt_subtitle_test_position_%1", alignment);
- auto subs = content_factory(String::compose("test/data/burn_%1.xml", alignment));
+ auto const name = fmt::format("burnt_subtitle_test_position_{}", alignment);
+ auto subs = content_factory(fmt::format("test/data/burn_{}.xml", alignment));
auto film = new_test_film(name, subs);
subs[0]->text[0]->set_use(true);
subs[0]->text[0]->set_burn(true);
@@ -167,11 +167,11 @@ BOOST_AUTO_TEST_CASE(burnt_subtitle_test_position)
});
#if defined(DCPOMATIC_WINDOWS)
- check_dcp(String::compose("test/data/windows/%1", name), film);
+ check_dcp(fmt::format("test/data/windows/{}", name), film);
#elif defined(DCPOMATIC_OSX)
- check_dcp(String::compose("test/data/mac/%1", name), film);
+ check_dcp(fmt::format("test/data/mac/{}", name), film);
#else
- check_dcp(String::compose("test/data/%1", name), film);
+ check_dcp(fmt::format("test/data/{}", name), film);
#endif
};
diff --git a/test/cpl_hash_test.cc b/test/cpl_hash_test.cc
index 603fa4b8d..5fd7f4d16 100644
--- a/test/cpl_hash_test.cc
+++ b/test/cpl_hash_test.cc
@@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE (hash_added_to_imported_dcp_test)
make_and_verify_dcp (ov);
/* Remove <Hash> tags from the CPL */
- for (auto i: directory_iterator(String::compose("build/test/%1/%2", ov_name, ov->dcp_name()))) {
+ for (auto i: directory_iterator(fmt::format("build/test/{}/{}", ov_name, ov->dcp_name()))) {
if (boost::algorithm::starts_with(i.path().filename().string(), "cpl_")) {
dcp::File in(i.path(), "r");
BOOST_REQUIRE (in);
@@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE (hash_added_to_imported_dcp_test)
}
string const vf_name = "hash_added_to_imported_dcp_test_vf";
- auto ov_content = make_shared<DCPContent>(String::compose("build/test/%1/%2", ov_name, ov->dcp_name()));
+ auto ov_content = make_shared<DCPContent>(fmt::format("build/test/{}/{}", ov_name, ov->dcp_name()));
auto vf = new_test_film(
vf_name, { ov_content }
);
@@ -79,7 +79,7 @@ BOOST_AUTO_TEST_CASE (hash_added_to_imported_dcp_test)
/* Check for Hash tags in the VF DCP */
int hashes = 0;
- for (auto i: directory_iterator(String::compose("build/test/%1/%2", vf_name, vf->dcp_name()))) {
+ for (auto i: directory_iterator(fmt::format("build/test/{}/{}", vf_name, vf->dcp_name()))) {
if (boost::algorithm::starts_with(i.path().filename().string(), "cpl_")) {
dcp::File in(i.path(), "r");
BOOST_REQUIRE (in);
diff --git a/test/digest_test.cc b/test/digest_test.cc
index 39737b7f5..cfd862793 100644
--- a/test/digest_test.cc
+++ b/test/digest_test.cc
@@ -45,7 +45,7 @@ using std::string;
static string
openssl_hash (boost::filesystem::path file)
{
- auto pipe = popen (String::compose ("openssl sha1 -binary %1 | openssl base64 -e", file.string()).c_str (), "r");
+ auto pipe = popen (fmt::format("openssl sha1 -binary {} | openssl base64 -e", file.string()).c_str (), "r");
BOOST_REQUIRE (pipe);
char buffer[128];
string output;
diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc
index 0a48cd745..247b2d394 100644
--- a/test/ffmpeg_encoder_test.cc
+++ b/test/ffmpeg_encoder_test.cc
@@ -77,7 +77,7 @@ ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat f
BOOST_REQUIRE (false);
}
- name = String::compose("%1_test%2", name, number);
+ name = fmt::format("{}_test{}", name, number);
auto c = make_shared<FFmpegContent>(content);
auto film = new_test_film(name, {c}, &cl);
@@ -86,7 +86,7 @@ ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat f
film->write_metadata ();
auto job = make_shared<TranscodeJob>(film, TranscodeJob::ChangedBehaviour::IGNORE);
- auto file = boost::filesystem::path("build") / "test" / String::compose("%1.%2", name, extension);
+ auto file = boost::filesystem::path("build") / "test" / fmt::format("{}.{}", name, extension);
cl.add (file);
FFmpegFilmEncoder encoder(film, job, file, format, false, false, false, 23);
encoder.go ();
diff --git a/test/ffmpeg_properties_test.cc b/test/ffmpeg_properties_test.cc
index 1e0cdc42f..bc18efe02 100644
--- a/test/ffmpeg_properties_test.cc
+++ b/test/ffmpeg_properties_test.cc
@@ -37,7 +37,7 @@ colour_range_test(string name, boost::filesystem::path file, string ref)
{
auto content = content_factory(file);
BOOST_REQUIRE(!content.empty());
- auto film = new_test_film(String::compose("ffmpeg_properties_test_%1", name), { content.front() });
+ auto film = new_test_film(fmt::format("ffmpeg_properties_test_{}", name), { content.front() });
auto properties = content.front()->user_properties(film);
auto iter = std::find_if(properties.begin(), properties.end(), [](UserProperty const& property) { return property.key == "Colour range"; });
diff --git a/test/file_naming_test.cc b/test/file_naming_test.cc
index 2953046b5..482119542 100644
--- a/test/file_naming_test.cc
+++ b/test/file_naming_test.cc
@@ -48,9 +48,9 @@ string
mxf_regex(string part) {
#ifdef DCPOMATIC_WINDOWS
/* Windows replaces . in filenames with _ */
- return String::compose(".*flat_%1_png_.*\\.mxf", part);
+ return fmt::format(".*flat_{}_png_.*\\.mxf", part);
#else
- return String::compose(".*flat_%1\\.png_.*\\.mxf", part);
+ return fmt::format(".*flat_{}\\.png_.*\\.mxf", part);
#endif
};
diff --git a/test/hints_test.cc b/test/hints_test.cc
index 1b510f9e7..53c126fde 100644
--- a/test/hints_test.cc
+++ b/test/hints_test.cc
@@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE (hint_closed_caption_too_long)
check (
TextType::CLOSED_CAPTION,
"hint_closed_caption_too_long",
- String::compose("At least one of your closed caption lines has more than %1 characters. It is advisable to make each line %1 characters at most in length.", MAX_CLOSED_CAPTION_LENGTH, MAX_CLOSED_CAPTION_LENGTH)
+ fmt::format("At least one of your closed caption lines has more than {} characters. It is advisable to make each line {} characters at most in length.", MAX_CLOSED_CAPTION_LENGTH, MAX_CLOSED_CAPTION_LENGTH)
);
}
@@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE (hint_many_closed_caption_lines)
check (
TextType::CLOSED_CAPTION,
"hint_many_closed_caption_lines",
- String::compose("Some of your closed captions span more than %1 lines, so they will be truncated.", MAX_CLOSED_CAPTION_LINES)
+ fmt::format("Some of your closed captions span more than {} lines, so they will be truncated.", MAX_CLOSED_CAPTION_LINES)
);
}
@@ -193,12 +193,12 @@ BOOST_AUTO_TEST_CASE (hint_subtitle_mxf_too_big)
}
fake_font.close();
- auto content = content_factory(String::compose("test/data/%1%2.xml", name, i))[0];
+ auto content = content_factory(fmt::format("test/data/{}{}.xml", name, i))[0];
content->text[0]->set_type(TextType::OPEN_SUBTITLE);
content->text[0]->set_language(dcp::LanguageTag("en-US"));
film->examine_and_add_content(content);
BOOST_REQUIRE (!wait_for_jobs());
- auto const font = content->text[0]->get_font(String::compose("font_%1", i));
+ auto const font = content->text[0]->get_font(fmt::format("font_{}", i));
BOOST_REQUIRE(font);
font->set_file("build/test/hint_subtitle_mxf_too_big.ttf");
}
@@ -220,7 +220,7 @@ BOOST_AUTO_TEST_CASE (hint_closed_caption_xml_too_big)
auto film = new_test_film(name);
- dcp::File ccap(String::compose("build/test/%1.srt", name), "w");
+ dcp::File ccap(fmt::format("build/test/{}.srt", name), "w");
BOOST_REQUIRE (ccap);
for (int i = 0; i < 2048; ++i) {
fprintf(ccap.get(), "%d\n", i + 1);
diff --git a/test/image_filename_sorter_test.cc b/test/image_filename_sorter_test.cc
index c4b2622a8..b7b65611b 100644
--- a/test/image_filename_sorter_test.cc
+++ b/test/image_filename_sorter_test.cc
@@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE (image_filename_sorter_test2)
{
vector<boost::filesystem::path> paths;
for (int i = 0; i < 100000; ++i) {
- paths.push_back(String::compose("some.filename.with.%1.number.tiff", i));
+ paths.push_back(fmt::format("some.filename.with.{}.number.tiff", i));
}
std::random_device rd;
@@ -78,6 +78,6 @@ BOOST_AUTO_TEST_CASE (image_filename_sorter_test2)
sort (paths.begin(), paths.end(), ImageFilenameSorter());
for (int i = 0; i < 100000; ++i) {
- BOOST_CHECK_EQUAL(paths[i].string(), String::compose("some.filename.with.%1.number.tiff", i));
+ BOOST_CHECK_EQUAL(paths[i].string(), fmt::format("some.filename.with.{}.number.tiff", i));
}
}
diff --git a/test/image_test.cc b/test/image_test.cc
index a643146fc..18710f842 100644
--- a/test/image_test.cc
+++ b/test/image_test.cc
@@ -512,7 +512,7 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test7)
Image::Alignment::PADDED,
false
);
- path file = String::compose("crop_scale_window_test7-%1.png", left_crop);
+ path file = fmt::format("crop_scale_window_test7-{}.png", left_crop);
write_image(cropped, path("build") / "test" / file);
check_image(path("test") / "data" / file, path("build") / "test" / file, 10);
}
diff --git a/test/kdm_naming_test.cc b/test/kdm_naming_test.cc
index 4735ef75e..e8bafb6a2 100644
--- a/test/kdm_naming_test.cc
+++ b/test/kdm_naming_test.cc
@@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test)
boost::algorithm::replace_all (until_time, ":", "-");
auto const dcp_date = boost::gregorian::to_iso_string(film->isdcf_date());
- auto const ref = String::compose("KDM_Cinema_A_-_Screen_1_-_MyGreatFilm_TST-1_F_XX-XX_MOS_2K_%1_SMPTE_OV_-_%2_%3_-_%4_%5.xml", dcp_date, from.date(), from_time, until.date(), until_time);
+ auto const ref = fmt::format("KDM_Cinema_A_-_Screen_1_-_MyGreatFilm_TST-1_F_XX-XX_MOS_2K_{}_SMPTE_OV_-_{}_{}_-_{}_{}.xml", dcp_date, from.date(), from_time, until.date(), until_time);
BOOST_CHECK_MESSAGE (boost::filesystem::exists("build/test/single_kdm_naming_test/" + ref), "File " << ref << " not found");
}
@@ -224,41 +224,41 @@ BOOST_AUTO_TEST_CASE(directory_kdm_naming_test)
boost::algorithm::replace_all (until_time, ":", "-");
auto const dcp_date = boost::gregorian::to_iso_string(film->isdcf_date());
- auto const dcp_name = String::compose("MyGreatFilm_TST-1_F_XX-XX_MOS_2K_%1_SMPTE_OV", dcp_date);
- auto const common = String::compose("%1_-_%2_%3_-_%4_%5", dcp_name, from.date(), from_time, until.date(), until_time);
+ auto const dcp_name = fmt::format("MyGreatFilm_TST-1_F_XX-XX_MOS_2K_{}_SMPTE_OV", dcp_date);
+ auto const common = fmt::format("{}_-_{}_{}_-_{}_{}", dcp_name, from.date(), from_time, until.date(), until_time);
path const base = "build/test/directory_kdm_naming_test";
- path dir_a = String::compose("Cinema_A_-_%s_-_%1", common);
+ path dir_a = fmt::format("Cinema_A_-_%s_-_{}", common);
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_a), "Directory " << dir_a << " not found");
- path dir_b = String::compose("Cinema_B_-_%s_-_%1", common);
+ path dir_b = fmt::format("Cinema_B_-_%s_-_{}", common);
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_b), "Directory " << dir_b << " not found");
#ifdef DCPOMATIC_WINDOWS
- path ref = String::compose("KDM_%1.xml", dcp_name);
+ path ref = fmt::format("KDM_{}.xml", dcp_name);
#else
- path ref = String::compose("KDM_Cinema_A_-_Screen_2_-_%1_-_%2.xml", common, cpl_id);
+ path ref = fmt::format("KDM_Cinema_A_-_Screen_2_-_{}_-_{}.xml", common, cpl_id);
#endif
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_a / ref), "File " << ref << " not found");
#ifdef DCPOMATIC_WINDOWS
- ref = String::compose("KDM_%1.xml", dcp_name);
+ ref = fmt::format("KDM_{}.xml", dcp_name);
#else
- ref = String::compose("KDM_Cinema_B_-_Screen_X_-_%1_-_%2.xml", common, cpl_id);
+ ref = fmt::format("KDM_Cinema_B_-_Screen_X_-_{}_-_{}.xml", common, cpl_id);
#endif
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_b / ref), "File " << ref << " not found");
#ifdef DCPOMATIC_WINDOWS
- ref = String::compose("KDM_%1.xml", dcp_name);
+ ref = fmt::format("KDM_{}.xml", dcp_name);
#else
- ref = String::compose("KDM_Cinema_A_-_Screen_1_-_%1_-_%2.xml", common, cpl_id);
+ ref = fmt::format("KDM_Cinema_A_-_Screen_1_-_{}_-_{}.xml", common, cpl_id);
#endif
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_a / ref), "File " << ref << " not found");
#ifdef DCPOMATIC_WINDOWS
- ref = String::compose("KDM_%1.xml", dcp_name);
+ ref = fmt::format("KDM_{}.xml", dcp_name);
#else
- ref = String::compose("KDM_Cinema_B_-_Screen_Z_-_%1_-_%2.xml", common, cpl_id);
+ ref = fmt::format("KDM_Cinema_B_-_Screen_Z_-_{}_-_{}.xml", common, cpl_id);
#endif
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_b / ref), "File " << ref << " not found");
}
diff --git a/test/map_cli_test.cc b/test/map_cli_test.cc
index aaf5b944f..7705890d4 100644
--- a/test/map_cli_test.cc
+++ b/test/map_cli_test.cc
@@ -90,7 +90,7 @@ find_cpl(boost::filesystem::path dir)
BOOST_AUTO_TEST_CASE(map_simple_dcp_copy)
{
string const name = "map_simple_dcp_copy";
- string const out = String::compose("build/test/%1_out", name);
+ string const out = fmt::format("build/test/{}_out", name);
auto content = content_factory("test/data/flat_red.png");
auto film = new_test_film(name + "_in", content);
@@ -120,7 +120,7 @@ BOOST_AUTO_TEST_CASE(map_simple_dcp_copy)
BOOST_AUTO_TEST_CASE(map_simple_dcp_copy_by_id)
{
string const name = "map_simple_dcp_copy_by_id";
- string const out = String::compose("build/test/%1_out", name);
+ string const out = fmt::format("build/test/{}_out", name);
auto content = content_factory("test/data/flat_red.png");
auto film = new_test_film(name + "_in", content);
@@ -152,7 +152,7 @@ BOOST_AUTO_TEST_CASE(map_simple_dcp_copy_by_id)
BOOST_AUTO_TEST_CASE(map_simple_dcp_copy_with_symlinks)
{
string const name = "map_simple_dcp_copy_with_symlinks";
- string const out = String::compose("build/test/%1_out", name);
+ string const out = fmt::format("build/test/{}_out", name);
auto content = content_factory("test/data/flat_red.png");
auto film = new_test_film(name + "_in", content);
@@ -185,7 +185,7 @@ BOOST_AUTO_TEST_CASE(map_simple_dcp_copy_with_symlinks)
BOOST_AUTO_TEST_CASE(map_simple_dcp_copy_with_hardlinks)
{
string const name = "map_simple_dcp_copy_with_hardlinks";
- string const out = String::compose("build/test/%1_out", name);
+ string const out = fmt::format("build/test/{}_out", name);
auto content = content_factory("test/data/flat_red.png");
auto film = new_test_film(name + "_in", content);
@@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE(map_simple_dcp_copy_with_hardlinks)
BOOST_AUTO_TEST_CASE(map_simple_interop_dcp_with_subs)
{
string const name = "map_simple_interop_dcp_with_subs";
- string const out = String::compose("build/test/%1_out", name);
+ string const out = fmt::format("build/test/{}_out", name);
auto picture = content_factory("test/data/flat_red.png").front();
auto subs = content_factory("test/data/15s.srt").front();
@@ -247,7 +247,7 @@ void
test_map_ov_vf_copy(vector<string> extra_args = {})
{
string const name = "map_ov_vf_copy";
- string const out = String::compose("build/test/%1_out", name);
+ string const out = fmt::format("build/test/{}_out", name);
auto ov_content = content_factory("test/data/flat_red.png");
auto ov_film = new_test_film(name + "_ov", ov_content);
@@ -298,7 +298,7 @@ BOOST_AUTO_TEST_CASE(map_ov_vf_copy)
BOOST_AUTO_TEST_CASE(map_ov_vf_copy_multiple_reference)
{
string const name = "map_ov_vf_copy_multiple_reference";
- string const out = String::compose("build/test/%1_out", name);
+ string const out = fmt::format("build/test/{}_out", name);
auto ov_content = content_factory("test/data/flat_red.png");
auto ov_film = new_test_film(name + "_ov", ov_content);
@@ -346,7 +346,7 @@ BOOST_AUTO_TEST_CASE(map_simple_dcp_copy_with_rename)
ConfigRestorer cr;
Config::instance()->set_dcp_asset_filename_format(dcp::NameFormat("hello%c"));
string const name = "map_simple_dcp_copy_with_rename";
- string const out = String::compose("build/test/%1_out", name);
+ string const out = fmt::format("build/test/{}_out", name);
auto content = content_factory("test/data/flat_red.png");
auto film = new_test_film(name + "_in", content);
@@ -394,7 +394,7 @@ static
void
test_two_cpls_each_with_subs(string name, bool interop)
{
- string const out = String::compose("build/test/%1_out", name);
+ string const out = fmt::format("build/test/{}_out", name);
vector<dcp::VerificationNote::Code> acceptable_errors;
if (interop) {
@@ -408,7 +408,7 @@ test_two_cpls_each_with_subs(string name, bool interop)
for (auto i = 0; i < 2; ++i) {
auto picture = content_factory("test/data/flat_red.png").front();
auto subs = content_factory("test/data/15s.srt").front();
- films[i] = new_test_film(String::compose("%1_%2_in", name, i), { picture, subs });
+ films[i] = new_test_film(fmt::format("{}_{}_in", name, i), { picture, subs });
films[i]->set_interop(interop);
subs->only_text()->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp(films[i], acceptable_errors);
@@ -450,7 +450,7 @@ BOOST_AUTO_TEST_CASE(map_with_given_config)
ConfigRestorer cr;
string const name = "map_with_given_config";
- string const out = String::compose("build/test/%1_out", name);
+ string const out = fmt::format("build/test/{}_out", name);
auto content = content_factory("test/data/flat_red.png");
auto film = new_test_film(name + "_in", content);
@@ -480,7 +480,7 @@ BOOST_AUTO_TEST_CASE(map_with_given_config)
BOOST_AUTO_TEST_CASE(map_multireel_interop_ov_and_vf_adding_ccaps)
{
string const name = "map_multireel_interop_ov_and_vf_adding_ccaps";
- string const out = String::compose("build/test/%1_out", name);
+ string const out = fmt::format("build/test/{}_out", name);
vector<shared_ptr<Content>> video = {
content_factory("test/data/flat_red.png")[0],
@@ -545,7 +545,7 @@ BOOST_AUTO_TEST_CASE(map_uses_config_for_issuer_and_creator)
Config::instance()->set_dcp_creator("Fred");
string const name = "map_uses_config_for_issuer_and_creator";
- string const out = String::compose("build/test/%1_out", name);
+ string const out = fmt::format("build/test/{}_out", name);
auto content = content_factory("test/data/flat_red.png");
auto film = new_test_film(name + "_in", content);
diff --git a/test/markers_test.cc b/test/markers_test.cc
index f7ff3a6b5..6e5f9d8df 100644
--- a/test/markers_test.cc
+++ b/test/markers_test.cc
@@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE (automatic_ffoc_lfoc_markers_test1)
film->set_interop (false);
make_and_verify_dcp (film);
- dcp::DCP dcp (String::compose("build/test/%1/%2", name, film->dcp_name()));
+ dcp::DCP dcp (fmt::format("build/test/{}/{}", name, film->dcp_name()));
dcp.read ();
BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U);
auto cpl = dcp.cpls().front();
@@ -86,7 +86,7 @@ BOOST_AUTO_TEST_CASE (automatic_ffoc_lfoc_markers_test2)
dcp::VerificationNote::Code::INCORRECT_LFOC
});
- dcp::DCP dcp (String::compose("build/test/%1/%2", name, film->dcp_name()));
+ dcp::DCP dcp (fmt::format("build/test/{}/{}", name, film->dcp_name()));
dcp.read ();
BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U);
auto cpl = dcp.cpls().front();
@@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(markers_correct_with_reels)
film->set_reel_type(ReelType::BY_VIDEO_CONTENT);
make_and_verify_dcp(film);
- dcp::DCP dcp(String::compose("build/test/%1/%2", name, film->dcp_name()));
+ dcp::DCP dcp(fmt::format("build/test/{}/{}", name, film->dcp_name()));
dcp.read ();
BOOST_REQUIRE_EQUAL(dcp.cpls().size(), 1U);
auto cpl = dcp.cpls()[0];
diff --git a/test/player_test.cc b/test/player_test.cc
index 384a73ebc..1ba1602a2 100644
--- a/test/player_test.cc
+++ b/test/player_test.cc
@@ -225,12 +225,12 @@ BOOST_AUTO_TEST_CASE (player_seek_test)
butler->seek (t, true);
auto video = butler->get_video(Butler::Behaviour::BLOCKING, 0);
BOOST_CHECK_EQUAL(video.second.get(), t.get());
- write_image(video.first->image(AV_PIX_FMT_RGB24, VideoRange::FULL, true), String::compose("build/test/player_seek_test_%1.png", i));
+ write_image(video.first->image(AV_PIX_FMT_RGB24, VideoRange::FULL, true), fmt::format("build/test/player_seek_test_{}.png", i));
/* This 14.08 is empirically chosen (hopefully) to accept changes in rendering between the reference and a test machine
(17.10 and 16.04 seem to anti-alias a little differently) but to reject gross errors e.g. missing fonts or missing
text altogether.
*/
- check_image(TestPaths::private_data() / String::compose("player_seek_test_%1.png", i), String::compose("build/test/player_seek_test_%1.png", i), 14.08);
+ check_image(TestPaths::private_data() / fmt::format("player_seek_test_{}.png", i), fmt::format("build/test/player_seek_test_{}.png", i), 14.08);
}
}
@@ -261,9 +261,9 @@ BOOST_AUTO_TEST_CASE (player_seek_test2)
auto video = butler->get_video(Butler::Behaviour::BLOCKING, 0);
BOOST_CHECK_EQUAL(video.second.get(), t.get());
write_image(
- video.first->image(AV_PIX_FMT_RGB24, VideoRange::FULL, true), String::compose("build/test/player_seek_test2_%1.png", i)
+ video.first->image(AV_PIX_FMT_RGB24, VideoRange::FULL, true), fmt::format("build/test/player_seek_test2_{}.png", i)
);
- check_image(TestPaths::private_data() / String::compose("player_seek_test2_%1.png", i), String::compose("build/test/player_seek_test2_%1.png", i), 14.08);
+ check_image(TestPaths::private_data() / fmt::format("player_seek_test2_{}.png", i), fmt::format("build/test/player_seek_test2_{}.png", i), 14.08);
}
}
diff --git a/test/reels_test.cc b/test/reels_test.cc
index b79bd4e17..9ef5fbb9d 100644
--- a/test/reels_test.cc
+++ b/test/reels_test.cc
@@ -668,7 +668,7 @@ BOOST_AUTO_TEST_CASE(reel_assets_same_length_with_atmos)
picture->video->set_length(480);
BOOST_REQUIRE_EQUAL(messages.size(), 1U);
- BOOST_CHECK_EQUAL(messages[0], variant::insert_dcpomatic("%1 had to change your reel settings to accommodate the Atmos content"));
+ BOOST_CHECK_EQUAL(messages[0], variant::insert_dcpomatic("{} had to change your reel settings to accommodate the Atmos content"));
auto const reels = film->reels();
BOOST_CHECK_EQUAL(reels.size(), 2U);
diff --git a/test/subtitle_language_test.cc b/test/subtitle_language_test.cc
index 789412912..1f5d09942 100644
--- a/test/subtitle_language_test.cc
+++ b/test/subtitle_language_test.cc
@@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE (subtitle_language_interop_test)
false
);
- check_dcp(String::compose("test/data/%1", name), String::compose("build/test/%1/%2", name, film->dcp_name()));
+ check_dcp(fmt::format("test/data/{}", name), fmt::format("build/test/{}/{}", name, film->dcp_name()));
}
@@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE (subtitle_language_smpte_test)
* differences in sound between the DCP and the reference to avoid test
* failures for unrelated reasons.
*/
- check_dcp(String::compose("test/data/%1", name), String::compose("build/test/%1/%2", name, film->dcp_name()), true);
+ check_dcp(fmt::format("test/data/{}", name), fmt::format("build/test/{}/{}", name, film->dcp_name()), true);
}
diff --git a/test/subtitle_position_test.cc b/test/subtitle_position_test.cc
index 05e305478..fb800b882 100644
--- a/test/subtitle_position_test.cc
+++ b/test/subtitle_position_test.cc
@@ -112,8 +112,8 @@ vpos_test(dcp::VAlign reference, float position, dcp::SubtitleStandard from, dcp
break;
}
- auto name = String::compose("vpos_test_%1_%2", standard, valign_to_string(reference));
- auto in = content_factory(String::compose("test/data/%1.xml", name));
+ auto name = fmt::format("vpos_test_{}_{}", standard, valign_to_string(reference));
+ auto in = content_factory(fmt::format("test/data/{}.xml", name));
auto film = new_test_film(name, in);
film->set_interop(to == dcp::Standard::INTEROP);
diff --git a/test/test.cc b/test/test.cc
index 6d8e6f5f7..85698b3fe 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -594,7 +594,7 @@ check_xml(
auto test_children = test->get_children ();
string context;
if (ref_file && test_file) {
- context = String::compose(" comparing %1 and %2", ref_file->string(), test_file->string());
+ context = fmt::format(" comparing {} and {}", ref_file->string(), test_file->string());
}
BOOST_REQUIRE_MESSAGE (
ref_children.size() == test_children.size(),
@@ -739,7 +739,7 @@ png_flush (png_structp)
static void
png_error_fn (png_structp, char const * message)
{
- throw EncodeError (String::compose("Error during PNG write: %1", message));
+ throw EncodeError (fmt::format("Error during PNG write: {}", message));
}
@@ -822,7 +822,7 @@ write_image (shared_ptr<const Image> image, boost::filesystem::path file)
void
check_ffmpeg (boost::filesystem::path ref, boost::filesystem::path check, int audio_tolerance)
{
- int const r = system (String::compose("ffcmp -t %1 %2 %3", audio_tolerance, ref.string(), check.string()).c_str());
+ int const r = system (fmt::format("ffcmp -t {} {} {}", audio_tolerance, ref.string(), check.string()).c_str());
BOOST_REQUIRE_EQUAL (WEXITSTATUS(r), 0);
}
@@ -1015,13 +1015,13 @@ make_and_verify_dcp(shared_ptr<Film> film, vector<dcp::VerificationNote::Code> i
auto dcp_inspect_env = getenv("DCPOMATIC_DCP_INSPECT");
if (dcp_inspect && dcp_inspect_env) {
boost::filesystem::path dcp_inspect(dcp_inspect_env);
- auto cmd = String::compose("%1 %2 > %3 2>&1", dcp_inspect.string(), film->dir(film->dcp_name()).string(), film->file("dcp_inspect.log").string());
+ auto cmd = fmt::format("{} {} > {} 2>&1", dcp_inspect.string(), film->dir(film->dcp_name()).string(), film->file("dcp_inspect.log").string());
auto result = system(cmd.c_str());
BOOST_CHECK_EQUAL(WEXITSTATUS(result), 0);
}
if (clairmeta && getenv("DCPOMATIC_CLAIRMETA")) {
- auto cmd = String::compose("python3 -m clairmeta.cli check -type dcp %1 > %2 2>&1", film->dir(film->dcp_name()).string(), film->file("clairmeta.log").string());
+ auto cmd = fmt::format("python3 -m clairmeta.cli check -type dcp {} > {} 2>&1", film->dir(film->dcp_name()).string(), film->file("clairmeta.log").string());
auto result = system(cmd.c_str());
BOOST_CHECK_EQUAL(WEXITSTATUS(result), 0);
}
diff --git a/test/threed_test.cc b/test/threed_test.cc
index 5508eb735..2f92d5b7a 100644
--- a/test/threed_test.cc
+++ b/test/threed_test.cc
@@ -209,7 +209,7 @@ BOOST_AUTO_TEST_CASE (threed_test7)
}
}
BOOST_REQUIRE (failed);
- BOOST_CHECK_EQUAL (failed->error_summary(), String::compose("The content file %1 is set as 3D but does not appear to contain 3D images. Please set it to 2D. You can still make a 3D DCP from this content by ticking the 3D option in the DCP video tab.", boost::filesystem::canonical(content_path).string()));
+ BOOST_CHECK_EQUAL (failed->error_summary(), fmt::format("The content file {} is set as 3D but does not appear to contain 3D images. Please set it to 2D. You can still make a 3D DCP from this content by ticking the 3D option in the DCP video tab.", boost::filesystem::canonical(content_path).string()));
while (signal_manager->ui_idle ()) {}