Add a possibly-useful test.
[dcpomatic.git] / test / config_test.cc
index ec67a200a3462a556e666733b109bf1bea0dd4ad..67c00cf41c80bb786082c4f8997d7dc5f9c2f9a6 100644 (file)
@@ -91,3 +91,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 ();
+}
+