@@ -49,16 +49,13 @@ std::string from_icu_string(const icu::UnicodeString& str)
4949# define BOOST_LOCALE_ICU_VERSION_EXACT 0
5050#endif
5151
52- // Currency style changes between ICU versions, so get "real" value from ICU
53- #if BOOST_LOCALE_ICU_VERSION >= 402
54-
5552std::string get_icu_currency_iso (const double value)
5653{
57- # if BOOST_LOCALE_ICU_VERSION >= 408
54+ #if BOOST_LOCALE_ICU_VERSION >= 408
5855 auto styleIso = UNUM_CURRENCY_ISO;
59- # else
56+ #else
6057 auto styleIso = icu::NumberFormat::kIsoCurrencyStyle ;
61- # endif
58+ #endif
6259 UErrorCode err = U_ZERO_ERROR;
6360 std::unique_ptr<icu::NumberFormat> fmt (icu::NumberFormat::createInstance (get_icu_test_locale (), styleIso, err));
6461 TEST_REQUIRE (U_SUCCESS (err) && fmt.get ());
@@ -67,8 +64,6 @@ std::string get_icu_currency_iso(const double value)
6764 return from_icu_string (fmt->format (value, tmp));
6865}
6966
70- #endif
71-
7267using format_style_t = std::ios_base&(std::ios_base&);
7368
7469#ifdef BOOST_LOCALE_WITH_ICU
@@ -425,12 +420,11 @@ void test_manip(std::string e_charset = "UTF-8")
425420
426421 TEST_PARSE_FAILS (as::currency, " $" , double );
427422
428- #if BOOST_LOCALE_ICU_VERSION >= 402
429423 TEST_FMT_PARSE_2 (as::currency, as::currency_national, 1345 , " $1,345.00" );
430424 TEST_FMT_PARSE_2 (as::currency, as::currency_national, 1345.34 , " $1,345.34" );
431425 TEST_FMT_PARSE_2 (as::currency, as::currency_iso, 1345 , get_icu_currency_iso (1345 ));
432426 TEST_FMT_PARSE_2 (as::currency, as::currency_iso, 1345.34 , get_icu_currency_iso (1345.34 ));
433- # endif
427+
434428 TEST_FMT_PARSE_1 (as::spellout, 10 , " ten" );
435429#if 402 <= BOOST_LOCALE_ICU_VERSION && BOOST_LOCALE_ICU_VERSION < 408
436430 if (e_charset == " UTF-8" )
@@ -503,15 +497,13 @@ void test_manip(std::string e_charset = "UTF-8")
503497 a_datetime,
504498 icu_time_long,
505499 a_time + a_timesec);
506- #if !(BOOST_LOCALE_ICU_VERSION == 308 && defined(__CYGWIN__)) // Known failure due to ICU issue
507500 TEST_PARSE (as::time >> as::time_full >> as::time_zone (" GMT+01:00" ), " 4:33:13 PM GMT+01:00" , a_time + a_timesec);
508501 TEST_FMT_PARSE_3_2 (as::time,
509502 as::time_full,
510503 as::time_zone (" GMT+01:00" ),
511504 a_datetime,
512505 icu_time_full,
513506 a_time + a_timesec);
514- #endif
515507
516508 const std::string icu_def = get_ICU_datetime (as::time, a_datetime);
517509 const std::string icu_short = get_ICU_datetime (as::time_short, a_datetime);
@@ -760,11 +752,7 @@ void test_format_class(std::string charset = "UTF-8")
760752
761753 // format with locale & encoding
762754 {
763- #if BOOST_LOCALE_ICU_VERSION >= 400
764755 const auto expected = boost::locale::conv::utf_to_utf<CharType>(" 10,00\xC2\xA0 €" );
765- #else
766- const auto expected = boost::locale::conv::utf_to_utf<CharType>(" 10,00 €" ); // LCOV_EXCL_LINE
767- #endif
768756 TEST_EQ (do_format<CharType>(loc, " {1,cur,locale=de_DE.UTF-8}" , 10 ), expected);
769757 }
770758
@@ -792,20 +780,14 @@ void test_format_class(std::string charset = "UTF-8")
792780 TEST_FORMAT_CLS (" {1,cur}" , 1234 , " $1,234.00" );
793781 TEST_FORMAT_CLS (" {1,currency}" , 1234 , " $1,234.00" );
794782 if (charset == " UTF-8" ) {
795- #if BOOST_LOCALE_ICU_VERSION >= 400
796783 TEST_FORMAT_CLS (" {1,cur,locale=de_DE}" , 10 , " 10,00\xC2\xA0 €" );
797- #else
798- TEST_FORMAT_CLS (" {1,cur,locale=de_DE}" , 10 , " 10,00 €" ); // LCOV_EXCL_LINE
799- #endif
800784 }
801- #if BOOST_LOCALE_ICU_VERSION >= 402
802785 TEST_FORMAT_CLS (" {1,cur=nat}" , 1234 , " $1,234.00" );
803786 TEST_FORMAT_CLS (" {1,cur=national}" , 1234 , " $1,234.00" );
804787 TEST_FORMAT_CLS (" {1,cur=iso}" , 1234 , get_icu_currency_iso (1234 ));
805- #endif
806788 TEST_FORMAT_CLS (" {1,spell}" , 10 , " ten" );
807789 TEST_FORMAT_CLS (" {1,spellout}" , 10 , " ten" );
808- #if 402 <= BOOST_LOCALE_ICU_VERSION && BOOST_LOCALE_ICU_VERSION < 408
790+ #if BOOST_LOCALE_ICU_VERSION < 408
809791 if (charset == " UTF-8" ) {
810792 TEST_FORMAT_CLS (" {1,ord}" , 1 , " 1\xcb\xa2\xe1\xb5\x97 " );
811793 TEST_FORMAT_CLS (" {1,ordinal}" , 1 , " 1\xcb\xa2\xe1\xb5\x97 " );
0 commit comments