From 9dc97269201603dd479e15a736a64479a5095556 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 19 Dec 2021 19:51:38 +0100 Subject: Simplify utf_iterator for input, build on Debian 10+11, Ubuntu 2004-2204 --- src/test-unicode.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/test-unicode.cpp b/src/test-unicode.cpp index 29e5c2e..d00a33d 100644 --- a/src/test-unicode.cpp +++ b/src/test-unicode.cpp @@ -372,7 +372,7 @@ BOOST_AUTO_TEST_CASE(random_sequences_valid) std::transform(u32list.begin(), u32list.end(), std::back_inserter(u16list), [](const std::u32string& s){return unicode::convert(s);}); // Fill UTF-8 data list - std::vector u8list; + std::vector> u8list; std::transform(u32list.begin(), u32list.end(), std::back_inserter(u8list), [](const std::u32string& s){return unicode::convert(s);}); for (const auto& i : u32list) { @@ -380,7 +380,7 @@ BOOST_AUTO_TEST_CASE(random_sequences_valid) BOOST_CHECK(s32.size() == i.size()); std::u16string s16{unicode::convert(i)}; BOOST_CHECK(s16.size() >= i.size()); - std::u8string s8{unicode::convert(i)}; + std::basic_string s8{unicode::convert(i)}; BOOST_CHECK(s8.size() >= i.size()); } @@ -389,7 +389,7 @@ BOOST_AUTO_TEST_CASE(random_sequences_valid) BOOST_CHECK(s32.size() > 0 || i.size() == 0); std::u16string s16{unicode::convert(i)}; BOOST_CHECK(s16.size() == i.size()); - std::u8string s8{unicode::convert(i)}; + std::basic_string s8{unicode::convert(i)}; BOOST_CHECK(s8.size() >= i.size()); } @@ -398,7 +398,7 @@ BOOST_AUTO_TEST_CASE(random_sequences_valid) BOOST_CHECK(s32.size() > 0 || i.size() == 0); std::u16string s16{unicode::convert(i)}; BOOST_CHECK(s16.size() > 0 || i.size() == 0); - std::u8string s8{unicode::convert(i)}; + std::basic_string s8{unicode::convert(i)}; BOOST_CHECK(s8.size() == i.size()); } @@ -424,7 +424,7 @@ BOOST_AUTO_TEST_CASE(random_sequences_valid) // Performance test UTF-32 -> UTF-8 auto t0{std::chrono::steady_clock::now()}; for (const auto& i : u32list) { - std::u8string s{unicode::convert(i)}; + std::basic_string s{unicode::convert(i)}; } std::cout << "Performance test for converting 1M strings from UTF-32 to UTF-8: " << std::chrono::duration(std::chrono::steady_clock::now() - t0).count() << std::endl; } @@ -451,7 +451,7 @@ BOOST_AUTO_TEST_CASE(random_sequences_valid) // Performance test UTF-16 -> UTF-8 auto t0{std::chrono::steady_clock::now()}; for (const auto& i : u16list) { - std::u8string s{unicode::convert(i)}; + std::basic_string s{unicode::convert(i)}; } std::cout << "Performance test for converting 1M strings from UTF-16 to UTF-8: " << std::chrono::duration(std::chrono::steady_clock::now() - t0).count() << std::endl; } @@ -478,7 +478,7 @@ BOOST_AUTO_TEST_CASE(random_sequences_valid) // Performance test UTF-8 -> UTF-8 auto t0{std::chrono::steady_clock::now()}; for (const auto& i : u8list) { - std::u8string s{unicode::convert(i)}; + std::basic_string s{unicode::convert(i)}; } std::cout << "Performance test for converting 1M strings from UTF-8 to UTF-8: " << std::chrono::duration(std::chrono::steady_clock::now() - t0).count() << std::endl; } -- cgit v1.2.3