X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fconfig_test.cc;h=d78b9357b86dc8943fcb5021255392c813fa09ed;hb=39fb8198febde1937019db1c300ec363aab5aa56;hp=ec67a200a3462a556e666733b109bf1bea0dd4ad;hpb=19c4d36de9297b58adf25d019bf298a5026104ee;p=dcpomatic.git diff --git a/test/config_test.cc b/test/config_test.cc index ec67a200a..d78b9357b 100644 --- a/test/config_test.cc +++ b/test/config_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington + Copyright (C) 2018-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,13 +18,16 @@ */ + #include "lib/config.h" #include "test.h" #include #include + using std::ofstream; + static void rewrite_bad_config () { @@ -91,3 +94,21 @@ BOOST_AUTO_TEST_CASE (config_backup_test) */ setup_test_config (); } + + +BOOST_AUTO_TEST_CASE (config_write_utf8_test) +{ + boost::filesystem::remove_all ("build/test/config.xml"); + boost::filesystem::copy_file ("test/data/utf8_config.xml", "build/test/config.xml"); + Config::override_path = "build/test"; + Config::drop (); + Config::instance()->write(); + + check_text_file ("test/data/utf8_config.xml", "build/test/config.xml"); + + /* This test has called Config::set_defaults(), so take us back + to the config that we want for our tests. + */ + setup_test_config (); +} +