2
0
mirror of https://github.com/boostorg/locale.git synced 2026-01-19 16:32:09 +00:00

37 Commits

Author SHA1 Message Date
Alexander Grund
e540a63c0b Enable char8_t strings where available, remove Clang condition
The issue was caused by using an incompatible libstdc++.
For Clang 13 & 14 libstdc++ 11 works.
2025-01-10 13:33:10 +01:00
Alexander Grund
9660cb970a Fix forwarding of variadic template parameter pack 2024-02-07 17:43:13 +01:00
Alexander Grund
324a66752b Use dedicated macro to check availability of std::basic_string<char8_t>
Allow to disable for non-conforming compilers/stdlibs
2023-09-13 09:20:05 +02:00
Alexander Grund
fd6701be21 Workaround missing std::ctype<char8_t> in tests 2023-09-13 09:10:38 +02:00
Alexander Grund
efed993fae Check for availability of std::string<char8_t> 2023-09-12 13:18:28 +02:00
Alexander Grund
0faa3c10cc Add implementations for char8_t where available
Allows to e.g. convert `std::u8string`s, translate them and run boundary
analysis.
Formatting isn't possible due to lack of facets
(more specifically: their IDs) in the standard libraries
2023-09-12 10:07:45 +02:00
Alexander Grund
26469cd230 Suppress or handle missing coverage of test code
Try to achieve 100% test code coverage to find accidentally missed ones.
Especially the WinAPI tests had some wrongly uncovered lines at function
start/end which needed to be excluded.
2023-06-27 23:04:08 +02:00
Alexander Grund
825562182c Use utf_to_utf when target/source encoding is known to be UTF-8
Improves speed by using static dispatch and inlining.
2023-05-29 18:36:01 +02:00
Alexander Grund
51df38ff17 Avoid the c_str getter where possible
Since C++11 we can directly pass the string to
e.g. `std::facet_by_name` making the code more readable.
2023-05-23 18:56:12 +02:00
Alexander Grund
154a0e1a89 Add test using non UTF-8 message key encoding
Check an optimisation not yet tested: Use the catalog with different key
encoding when there are only ASCII keys.
2023-05-16 10:49:58 +02:00
Alexander Grund
428cc467b3 Add test for localization_backend_manager::get_all_backends and use it in tests
Avoid the conditional checks in every 2nd test.
2023-05-03 21:11:46 +02:00
Alexander Grund
cc075982c0 Update doc/changelog 2023-04-24 21:47:26 +02:00
Alexander Grund
66c95ab434 Improve test coverage
- Add test for `basic_message::swap`
- Exclude some cases which would be coding errors
- Add more tests for plural expression errors
2023-04-23 13:40:46 +02:00
Alexander Grund
d1bb994977 Use long long as the count argument for translations
GNU gettext uses `unsigned long`. So switch from `int` to `long long` to
cover at least the same range.
2023-04-21 18:39:27 +02:00
Alexander Grund
f87e12e5aa Refactor test_message
Reduce scope of `message_path` and use it consistently.
Remove untaken branch in `file_loader`
2023-04-21 18:39:26 +02:00
Alexander Grund
b1f4198701 Modernize code with range-based for loops
Also find related readability improvements.
2023-04-16 13:13:48 +02:00
Alexander Grund
617bb54707 Refactoring of test_message
Remove some workarounds and add some `const`
2023-04-14 15:14:56 +02:00
Alexander Grund
0f2f62e647 Add and test messages_info::get_catalog_paths
Public function to get paths to folder to search for catalog files.
Useful for testing and maybe for users.
2023-04-08 19:10:45 +02:00
Alexander Grund
3609eca8b2 Make use of enhanced test macros
Use the TEST-macros that print the values on mismatch to aid debugging
2023-01-10 14:45:07 +01:00
Alexander Grund
b8a3c3cb53 Refactor tests and remove/combine/handle special cases for some ICU versions in tests 2022-10-13 20:58:25 +02:00
Alexander Grund
fa4afd7a5d Switch to consistent west-const
Especially for `const char*` which seems to be more common than `char const*`
2022-10-10 14:25:58 +02:00
Alexander Grund
7784f46243 Format sources
Use clang-format-14 to format source code consistently.
Closes #98
2022-10-10 14:25:58 +02:00
Alexander Grund
b6240532ec Refactor tests using locale names
Unify the tests a bit so it is easier to find the used locales
2022-09-16 23:28:26 +02:00
Alexander Grund
fadb2190ce Move test headers to subfolder
Gets rid of the `test_` prefix in the filenames and avoids confusing those with the actual tests especially by renaming the test framework file from `test_locale.hpp` to `unit_test.hpp`
2022-09-13 12:50:23 +02:00
Alexander Grund
707f801c55 Remive vim markers
To be replaced by clang-format in the future.
2022-07-12 18:35:42 +02:00
Alexander Grund
595934f25e Update license headers
Use the more concise format omitting the reference to the license file
and refer to the URL only.
2022-07-12 18:35:41 +02:00
Alexander Grund
aa30bd33aa Refactor test framework
Use a common `main` function calling into custom `test_main` functions and
move all common code into the former.
Also introduce an RAII class for a `locale_t` to avoid leaks and reduce
the code further.
Add some LCOV annotations for lines not expected to be reached.
2022-06-30 15:08:08 +02:00
Alexander Grund
00c8e07689 Remove using std-namespace and reformat
Removes the `using namespace std` to easier differentiate between
Boost.Locale and Std stuff.
Add spaces around shift operators.
2022-06-30 15:08:08 +02:00
Alexander Grund
d1fc12426f Remove trailing spaces 2022-06-04 11:50:39 +02:00
Alexander Grund
039f016c8c Handle constant-expression and implicit-cast warnings
Use explicit casts to narrow types and suppress the constant-expression
warnings on MSVC via a new macro
2022-05-30 17:20:23 +02:00
Alexander Grund
34d85ff98e Avoid potential int overflows
Those could lead to truncation or buffer overflow. Hence handle those by
erroring or throwing.
2022-05-30 10:32:14 +02:00
Alexander Grund
f3fa220608 Fix includes and unify include style
For consistency the following rules are used:
- public includes (include folder) either include any <boost/locale/*>
  first. At least <boost/locale/config.hpp>
- The first include in a cpp file is the corresponding header if any
- Then <boost/locale/*>, <boost/*>, <*>, "*" in this order
- Warning suppression pragmas come last where possible
- Use the C++ headers where available (i.e. <cstring> not <string.h>)
2022-05-29 22:20:10 +02:00
Artyom Beilis
ff3fe57f08 Removed deprecated BOOST_HAS_CHAR16/32_T macro and replaced with
BOOST_LOCALE_ENABLE_CHAR16_T/BOOST_LOCALE_ENABLE_CHAR32_T
2015-10-18 18:36:39 +03:00
Artyom Beilis
a4e5585ff4 Fixed #11163 bug in generator::set_default_messages_domain 2015-09-30 18:27:27 +03:00
Artyom Beilis
48ff4519b8 - Updates according to library requirements
- cleanup of inspect warnings
  - various requiremets like libraries.htm and maintainers.txt


[SVN r73786]
2011-08-15 19:04:34 +00:00
Artyom Beilis
194a35dd4f - Fixed correct error report in case Windows codepage is not
supported
- Updated tests to skip situations where particular code pages
  may not be supported in Windows


[SVN r73170]
2011-07-17 11:04:57 +00:00
Artyom Beilis
4c30e01d23 First Version of Boost.Locale integrated into SVN trunk
[SVN r73017]
2011-07-12 13:57:36 +00:00