X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fcollator_test.cc;h=035de9919ffa0e5f20d66243907d56b490d5d3c0;hb=afd18ea6b14373b2078b6d6dbc74c836e6843757;hp=e88d71b06d27a0510b0f534f8ee77746270feefe;hpb=1671e097a24cd169f1ad4ea89b0cb3ae105b1e70;p=dcpomatic.git diff --git a/test/collator_test.cc b/test/collator_test.cc index e88d71b06..035de9919 100644 --- a/test/collator_test.cc +++ b/test/collator_test.cc @@ -20,12 +20,28 @@ #include "lib/collator.h" +#include +#include #include BOOST_AUTO_TEST_CASE(collator_compare_works_and_ignores_case) { - Collator collator; + Collator collator("en"); + +#if 0 + // Print out available locales + // UErrorCode status; + // auto available = ucol_openAvailableLocales(&status); + // int32_t length = 0; + // while (true) { + // auto next = uenum_next(available, &length, &status); + // if (!next) { + // break; + // } + // std::cout << next << "\n"; + // } +#endif BOOST_CHECK_EQUAL(collator.compare("So often YOU won't even notice", "SO OFTEN you won't even NOTiCE"), 0); BOOST_CHECK_EQUAL(collator.compare("So often YOU won't even notice", "SO OFTEN you won't even see"), -1); @@ -35,7 +51,7 @@ BOOST_AUTO_TEST_CASE(collator_compare_works_and_ignores_case) BOOST_AUTO_TEST_CASE(collator_search_works_and_ignores_case) { - Collator collator; + Collator collator("en"); BOOST_CHECK(collator.find("outh", "With filthy mouths, and bad attitudes")); BOOST_CHECK(collator.find("with", "With filthy mouths, and bad attitudes"));