summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/cpl_hash_test.cc6
-rw-r--r--test/digest_test.cc4
-rw-r--r--test/ffmpeg_encoder_test.cc6
-rw-r--r--test/hints_test.cc8
-rw-r--r--test/image_filename_sorter_test.cc6
-rw-r--r--test/image_test.cc4
-rw-r--r--test/kdm_naming_test.cc22
-rw-r--r--test/markers_test.cc4
-rw-r--r--test/player_test.cc10
-rw-r--r--test/subtitle_language_test.cc4
-rw-r--r--test/test.cc4
-rw-r--r--test/threed_test.cc2
12 files changed, 40 insertions, 40 deletions
diff --git a/test/cpl_hash_test.cc b/test/cpl_hash_test.cc
index f34c29583..0e57d54e4 100644
--- a/test/cpl_hash_test.cc
+++ b/test/cpl_hash_test.cc
@@ -51,7 +51,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(dcp::compose("build/test/%1/%2", ov_name, ov->dcp_name()))) {
if (boost::algorithm::starts_with(i.path().filename().string(), "cpl_")) {
auto in = fopen_boost(i.path(), "r");
BOOST_REQUIRE (in);
@@ -70,7 +70,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>(dcp::compose("build/test/%1/%2", ov_name, ov->dcp_name()));
auto vf = new_test_film2 (
vf_name, { ov_content }
);
@@ -80,7 +80,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(dcp::compose("build/test/%1/%2", vf_name, vf->dcp_name()))) {
if (boost::algorithm::starts_with(i.path().filename().string(), "cpl_")) {
auto in = fopen_boost(i.path(), "r");
BOOST_REQUIRE (in);
diff --git a/test/digest_test.cc b/test/digest_test.cc
index 59a8cb7a7..0a155d8ba 100644
--- a/test/digest_test.cc
+++ b/test/digest_test.cc
@@ -28,9 +28,9 @@
#include "lib/film.h"
#include "lib/image_content.h"
#include "lib/dcp_content_type.h"
-#include "lib/compose.hpp"
#include "lib/config.h"
#include "test.h"
+#include <dcp/compose.h>
#include <dcp/cpl.h>
#include <dcp/reel.h>
#include <dcp/reel_picture_asset.h>
@@ -46,7 +46,7 @@ using std::make_shared;
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 (dcp::compose ("openssl sha1 -binary %1 | 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 d0bce0356..62c55e682 100644
--- a/test/ffmpeg_encoder_test.cc
+++ b/test/ffmpeg_encoder_test.cc
@@ -20,7 +20,6 @@
#include "lib/audio_content.h"
-#include "lib/compose.hpp"
#include "lib/content_factory.h"
#include "lib/dcp_content.h"
#include "lib/ffmpeg_content.h"
@@ -34,6 +33,7 @@
#include "lib/transcode_job.h"
#include "lib/video_content.h"
#include "test.h"
+#include <dcp/compose.h>
#include <boost/test/unit_test.hpp>
@@ -65,7 +65,7 @@ ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat f
BOOST_REQUIRE (false);
}
- name = String::compose("%1_test%2", name, number);
+ name = dcp::compose("%1_test%2", name, number);
auto c = make_shared<FFmpegContent>(content);
shared_ptr<Film> film = new_test_film2 (name, {c}, &cl);
@@ -74,7 +74,7 @@ ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat f
film->write_metadata ();
auto job = make_shared<TranscodeJob>(film);
- auto file = boost::filesystem::path("build") / "test" / String::compose("%1.%2", name, extension);
+ auto file = boost::filesystem::path("build") / "test" / dcp::compose("%1.%2", name, extension);
cl.add (file);
FFmpegEncoder encoder (film, job, file, format, false, false, false, 23);
encoder.go ();
diff --git a/test/hints_test.cc b/test/hints_test.cc
index 263f02435..827427222 100644
--- a/test/hints_test.cc
+++ b/test/hints_test.cc
@@ -90,7 +90,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)
+ dcp::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)
);
}
@@ -100,7 +100,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)
+ dcp::compose("Some of your closed captions span more than %1 lines, so they will be truncated.", MAX_CLOSED_CAPTION_LINES)
);
}
@@ -174,7 +174,7 @@ BOOST_AUTO_TEST_CASE (hint_subtitle_mxf_too_big)
content->text.front()->set_type (TextType::OPEN_SUBTITLE);
content->text.front()->set_language (dcp::LanguageTag("en-US"));
for (int i = 1; i < 512; ++i) {
- auto font = make_shared<dcpomatic::Font>(String::compose("font_%1", i));
+ auto font = make_shared<dcpomatic::Font>(dcp::compose("font_%1", i));
font->set_file ("test/data/LiberationSans-Regular.ttf");
content->text.front()->add_font(font);
}
@@ -197,7 +197,7 @@ BOOST_AUTO_TEST_CASE (hint_closed_caption_xml_too_big)
auto film = new_test_film2 (name);
- auto ccap = fopen_boost (String::compose("build/test/%1.srt", name), "w");
+ auto ccap = fopen_boost (dcp::compose("build/test/%1.srt", name), "w");
BOOST_REQUIRE (ccap);
for (int i = 0; i < 2048; ++i) {
fprintf(ccap, "%d\n", i + 1);
diff --git a/test/image_filename_sorter_test.cc b/test/image_filename_sorter_test.cc
index eb662a120..b6d5a731a 100644
--- a/test/image_filename_sorter_test.cc
+++ b/test/image_filename_sorter_test.cc
@@ -26,7 +26,7 @@
#include "lib/image_filename_sorter.h"
-#include "lib/compose.hpp"
+#include <dcp/compose.h>
#include <boost/test/unit_test.hpp>
@@ -67,11 +67,11 @@ 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(dcp::compose("some.filename.with.%1.number.tiff", i));
}
random_shuffle (paths.begin(), paths.end());
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(), dcp::compose("some.filename.with.%1.number.tiff", i));
}
}
diff --git a/test/image_test.cc b/test/image_test.cc
index 3993b3efb..c461a93d3 100644
--- a/test/image_test.cc
+++ b/test/image_test.cc
@@ -26,12 +26,12 @@
*/
-#include "lib/compose.hpp"
#include "lib/image.h"
#include "lib/image_content.h"
#include "lib/image_decoder.h"
#include "lib/ffmpeg_image_proxy.h"
#include "test.h"
+#include <dcp/compose.h>
#include <boost/test/unit_test.hpp>
#include <iostream>
@@ -364,7 +364,7 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test7)
true,
false
);
- path file = String::compose("crop_scale_window_test7-%1.png", left_crop);
+ path file = dcp::compose("crop_scale_window_test7-%1.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 f692c165d..a78d0a12d 100644
--- a/test/kdm_naming_test.cc
+++ b/test/kdm_naming_test.cc
@@ -120,7 +120,7 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test)
auto until_time = until.time_of_day (true, false);
boost::algorithm::replace_all (until_time, ":", "-");
- auto const ref = String::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
+ auto const ref = dcp::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4.xml", 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");
}
@@ -195,36 +195,36 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on(
path const base = "build/test/directory_kdm_naming_test";
- path dir_a = String::compose("Cinema_A_-_%s_-_my_great_film_-_%1_%2_-_%3_%4", from.date(), from_time, until.date(), until_time);
+ path dir_a = dcp::compose("Cinema_A_-_%s_-_my_great_film_-_%1_%2_-_%3_%4", from.date(), from_time, until.date(), until_time);
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_a), "Directory " << dir_a << " not found");
- path dir_b = String::compose("Cinema_B_-_%s_-_my_great_film_-_%1_%2_-_%3_%4", from.date(), from_time, until.date(), until_time);
+ path dir_b = dcp::compose("Cinema_B_-_%s_-_my_great_film_-_%1_%2_-_%3_%4", from.date(), from_time, until.date(), until_time);
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_b), "Directory " << dir_b << " not found");
#ifdef DCPOMATIC_WINDOWS
- path ref = String::compose("KDM_Cinema_A_-_Screen_2_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
+ path ref = dcp::compose("KDM_Cinema_A_-_Screen_2_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
#else
- path ref = String::compose("KDM_Cinema_A_-_Screen_2_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
+ path ref = dcp::compose("KDM_Cinema_A_-_Screen_2_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
#endif
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_a / ref), "File " << ref << " not found");
#ifdef DCPOMATIC_WINDOWS
- ref = String::compose("KDM_Cinema_B_-_Screen_X_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
+ ref = dcp::compose("KDM_Cinema_B_-_Screen_X_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
#else
- ref = String::compose("KDM_Cinema_B_-_Screen_X_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
+ ref = dcp::compose("KDM_Cinema_B_-_Screen_X_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
#endif
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_b / ref), "File " << ref << " not found");
#ifdef DCPOMATIC_WINDOWS
- ref = String::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
+ ref = dcp::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
#else
- ref = String::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
+ ref = dcp::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
#endif
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_a / ref), "File " << ref << " not found");
#ifdef DCPOMATIC_WINDOWS
- ref = String::compose("KDM_Cinema_B_-_Screen_Z_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
+ ref = dcp::compose("KDM_Cinema_B_-_Screen_Z_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
#else
- ref = String::compose("KDM_Cinema_B_-_Screen_Z_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
+ ref = dcp::compose("KDM_Cinema_B_-_Screen_Z_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
#endif
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_b / ref), "File " << ref << " not found");
}
diff --git a/test/markers_test.cc b/test/markers_test.cc
index 844f25660..a2d581423 100644
--- a/test/markers_test.cc
+++ b/test/markers_test.cc
@@ -51,7 +51,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 (dcp::compose("build/test/%1/%2", name, film->dcp_name()));
dcp.read ();
BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U);
auto cpl = dcp.cpls().front();
@@ -87,7 +87,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 (dcp::compose("build/test/%1/%2", name, film->dcp_name()));
dcp.read ();
BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U);
auto cpl = dcp.cpls().front();
diff --git a/test/player_test.cc b/test/player_test.cc
index c325537fa..08fa5eb18 100644
--- a/test/player_test.cc
+++ b/test/player_test.cc
@@ -38,9 +38,9 @@
#include "lib/dcp_content.h"
#include "lib/text_content.h"
#include "lib/butler.h"
-#include "lib/compose.hpp"
#include "lib/cross.h"
#include "test.h"
+#include <dcp/compose.h>
#include <boost/test/unit_test.hpp>
#include <boost/algorithm/string.hpp>
#include <iostream>
@@ -242,12 +242,12 @@ BOOST_AUTO_TEST_CASE (player_seek_test)
butler->seek (t, true);
auto video = butler->get_video(true, 0);
BOOST_CHECK_EQUAL(video.second.get(), t.get());
- write_image(video.first->image(bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, true), String::compose("build/test/player_seek_test_%1.png", i));
+ write_image(video.first->image(bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, true), dcp::compose("build/test/player_seek_test_%1.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() / dcp::compose("player_seek_test_%1.png", i), dcp::compose("build/test/player_seek_test_%1.png", i), 14.08);
}
}
@@ -277,9 +277,9 @@ BOOST_AUTO_TEST_CASE (player_seek_test2)
auto video = butler->get_video(true, 0);
BOOST_CHECK_EQUAL(video.second.get(), t.get());
write_image(
- video.first->image(bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, true), String::compose("build/test/player_seek_test2_%1.png", i)
+ video.first->image(bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, true), dcp::compose("build/test/player_seek_test2_%1.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() / dcp::compose("player_seek_test2_%1.png", i), dcp::compose("build/test/player_seek_test2_%1.png", i), 14.08);
}
}
diff --git a/test/subtitle_language_test.cc b/test/subtitle_language_test.cc
index e198b78f9..2ee0da336 100644
--- a/test/subtitle_language_test.cc
+++ b/test/subtitle_language_test.cc
@@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE (subtitle_language_interop_test)
dcp::VerificationNote::Code::INVALID_SUBTITLE_DURATION
});
- check_dcp (String::compose("test/data/%1", name), String::compose("build/test/%1/%2", name, film->dcp_name()));
+ check_dcp (dcp::compose("test/data/%1", name), dcp::compose("build/test/%1/%2", name, film->dcp_name()));
}
@@ -79,6 +79,6 @@ BOOST_AUTO_TEST_CASE (subtitle_language_smpte_test)
dcp::VerificationNote::Code::MISSING_CPL_METADATA
});
- check_dcp (String::compose("test/data/%1", name), String::compose("build/test/%1/%2", name, film->dcp_name()));
+ check_dcp (dcp::compose("test/data/%1", name), dcp::compose("build/test/%1/%2", name, film->dcp_name()));
}
diff --git a/test/test.cc b/test/test.cc
index 4dab0cff1..7720fa3b7 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -25,7 +25,6 @@
*/
-#include "lib/compose.hpp"
#include "lib/config.h"
#include "lib/cross.h"
#include "lib/dcp_content_type.h"
@@ -42,6 +41,7 @@
#include "lib/signal_manager.h"
#include "lib/util.h"
#include "test.h"
+#include <dcp/compose.h>
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include <dcp/mono_picture_asset.h>
@@ -754,7 +754,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 (dcp::compose("ffcmp -t %1 %2 %3", audio_tolerance, ref.string(), check.string()).c_str());
BOOST_REQUIRE_EQUAL (WEXITSTATUS(r), 0);
}
diff --git a/test/threed_test.cc b/test/threed_test.cc
index f98464fb5..06d05c1d8 100644
--- a/test/threed_test.cc
+++ b/test/threed_test.cc
@@ -201,7 +201,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.", content_path.string()));
+ BOOST_CHECK_EQUAL (failed->error_summary(), dcp::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.", content_path.string()));
while (signal_manager->ui_idle ()) {}