summaryrefslogtreecommitdiffhomepage
path: root/src/test-unicode.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2022-01-02 18:18:15 +0100
committerRoland Reichwein <mail@reichwein.it>2022-01-02 18:18:15 +0100
commit58a7b18ba7d593b52521e4d70b4c1b546876c678 (patch)
treeda13b110ad93d76a5b38ee673b05a94cb9287fd7 /src/test-unicode.cpp
parent7241d48ec4d0a0a59325d7a9208bdf5e076ba002 (diff)
Bugfix for C++17, fix comments, fix GCC warnings
Diffstat (limited to 'src/test-unicode.cpp')
-rw-r--r--src/test-unicode.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test-unicode.cpp b/src/test-unicode.cpp
index 7216cff..6eb523e 100644
--- a/src/test-unicode.cpp
+++ b/src/test-unicode.cpp
@@ -49,6 +49,7 @@ std::vector<types_collection_type> success_sets {
// separators
SUCCESS_TUPLE("abc\r\ndef"),
SUCCESS_TUPLE("äöü\0\u20ac"),
+ SUCCESS_TUPLE("äöü0\u20ac"),
// optimization relevant strings
SUCCESS_TUPLE("01234567\u20ac01234567"),
@@ -306,7 +307,7 @@ void test_utf_to_utf(std::tuple<Ts...>& t)
result = unicode::convert<From, To>(std::get<i>(t));
BOOST_CHECK_MESSAGE(std::get<j>(t) == result, "Container: From " << typeid(From).name() << "(" << i << ", " << std::get<i>(t) << ") to " << typeid(To).name() << "(" << j << ", " << std::get<j>(t) << "), got " << result);
- // test facet interface
+ // test encoding interface
result = unicode::convert<typename unicode::Encoding_t<typename From::value_type>, typename unicode::Encoding_t<typename To::value_type>>(std::get<i>(t));
BOOST_CHECK_MESSAGE(std::get<j>(t) == result, "Encoding: From " << typeid(From).name() << "(" << i << ", " << std::get<i>(t) << ") to " << typeid(To).name() << "(" << j << ", " << std::get<j>(t) << "), got " << result);
@@ -384,7 +385,7 @@ void test_utf_to_utf_failure(std::basic_string<From>& s)
BOOST_ERROR("Unexpected error on convert(): " << ex.what());
};
- // via facet
+ // via encoding
try {
(void) unicode::convert<typename unicode::Encoding_t<From>,typename unicode::Encoding_t<To>>(s);
BOOST_ERROR("Encoding: Expected exception at index: " << index << ", " << typeid(From).name() << " -> " << typeid(To).name());
@@ -530,7 +531,7 @@ void test_random_invalid(random_context& rc, size_t length)
BOOST_ERROR("Unexpected error on convert(): " << ex.what());
}
- // facet interface
+ // encoding interface
try {
To result{unicode::convert<typename unicode::Encoding_t<typename From::value_type>,typename unicode::Encoding_t<typename To::value_type>>(r)};
@@ -602,7 +603,7 @@ void test_random_valid(random_context& rc, size_t length, const std::string& des
return unicode::convert<unicode::UTF_32, typename unicode::Encoding_t<typename From::value_type>>(s);
});
- for (int i = 0; i < list.size(); i++) {
+ for (size_t i = 0; i < list.size(); i++) {
BOOST_CHECK(list[i].size() >= u32list[i].size());
To result{unicode::convert<typename unicode::Encoding_t<typename From::value_type>,typename unicode::Encoding_t<typename To::value_type>>(list[i])};
BOOST_CHECK(result.size() >= u32list[i].size());