summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-10-13 23:38:28 +0100
committerCarl Hetherington <cth@carlh.net>2017-10-13 23:38:28 +0100
commita615ba5e8616b054ab65a0762e09588ae44ff0e6 (patch)
tree92e9f30c80dfb73e439978bb2074968316628099
parent00b4448859226420bafd83f28fb5a1a0f2a13e26 (diff)
Don't corrupt dcp_asset_filename_format configuration option during the test.
-rw-r--r--test/file_naming_test.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/file_naming_test.cc b/test/file_naming_test.cc
index 8951f8380..bd7efb0d9 100644
--- a/test/file_naming_test.cc
+++ b/test/file_naming_test.cc
@@ -34,8 +34,26 @@
using std::string;
using boost::shared_ptr;
+class Keep
+{
+public:
+ Keep ()
+ {
+ _format = Config::instance()->dcp_asset_filename_format ();
+ }
+
+ ~Keep ()
+ {
+ Config::instance()->set_dcp_asset_filename_format (_format);
+ }
+
+private:
+ dcp::NameFormat _format;
+};
+
BOOST_AUTO_TEST_CASE (file_naming_test)
{
+ Keep k;
Config::instance()->set_dcp_asset_filename_format (dcp::NameFormat ("%c"));
shared_ptr<Film> film = new_test_film ("file_naming_test");
@@ -74,6 +92,7 @@ BOOST_AUTO_TEST_CASE (file_naming_test)
BOOST_AUTO_TEST_CASE (file_naming_test2)
{
+ Keep k;
Config::instance()->set_dcp_asset_filename_format (dcp::NameFormat ("%c"));
shared_ptr<Film> film = new_test_film ("file_naming_test2");