Tidy up careful_string_filter and add some extra transliterations.
[dcpomatic.git] / test / util_test.cc
index 67c1a5265f03f4711800436945e63087e9b82bcc..a45c144b1c5056fe48e466b36ba1d04b6f89aff4 100644 (file)
@@ -123,7 +123,7 @@ BOOST_AUTO_TEST_CASE (careful_string_filter_test)
        BOOST_CHECK_EQUAL ("hello_world", careful_string_filter("héllo_wörld"));
        BOOST_CHECK_EQUAL ("hello_world", careful_string_filter("héllo_wörld"));
        BOOST_CHECK_EQUAL ("hello_world_a", careful_string_filter("héllo_wörld_à"));
-       BOOST_CHECK_EQUAL ("hello_world_CcGgIOoSsUu", careful_string_filter("hello_world_ÇçĞğİÖöŞşÜü"));
+       BOOST_CHECK_EQUAL ("hello_world_CcGgIOoSsUuLl", careful_string_filter("hello_world_ÇçĞğİÖöŞşÜüŁł"));
 }
 
 
@@ -139,7 +139,7 @@ progress (float p)
 BOOST_AUTO_TEST_CASE (copy_in_bits_test)
 {
        for (int i = 0; i < 32; ++i) {
-               make_random_file ("build/test/random.dat", rand() % (256 * 1024 * 1024));
+               make_random_file ("build/test/random.dat", std::max(1, rand() % (256 * 1024 * 1024)));
 
                progress_values.clear ();
                copy_in_bits ("build/test/random.dat", "build/test/random.dat2", boost::bind(&progress, _1));