25 Commits

Author SHA1 Message Date
Alexander Grund
458aeee83c Use the C++11 cstdint header instead of the boost fallback 2023-06-09 10:41:44 +02:00
Alexander Grund
4a8a7eb51b static_assert char size in wconv
Closes #161
2023-05-10 14:17:12 +02:00
Alexander Grund
329170e360
Fix comments, especially in examples
Some were outdated/wrong (C&P) or using the docstring triple-slash prefix
2023-04-16 16:17:29 +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
668f2277cc Factor out str_end function for getting the end of a C-String 2022-10-22 18:42:51 +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
f54195ec80
Require char16_t/char32_t for tests 2022-09-14 10:26:05 +02:00
Alexander Grund
14f80f5d0d
Remove dependency on Boost.StaticAssert
Replace by C++11 `static_assert`
2022-09-14 09:40:58 +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
8c7338cd0d Use \n instead of std::endl where appropriate
We usually don't need the flush so use \n at end of strings which
greatly shortens the code.
2022-06-30 15:08:08 +02:00
Alexander Grund
d1fc12426f Remove trailing spaces 2022-06-04 11:50:39 +02:00
Alexander Grund
c79faed1b6
Reduce code duplication in test_utf
Move test_to_utf tests into a new test_valid_utf function to avoid the
C&P a bit down as for those both directions should be tested anyway.
Also needed a workaround for old GCCs not allowing unicode constants
below U+A0
2022-06-01 13:42:00 +02:00
Flamefire
543eadfac3 Workaround GCC bug parsing \uFFFF
GCC < 5 creates 2 UTF-16 codepoints instead of 1 due to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41698
2022-06-01 11:40:15 +02:00
Alexander Grund
18179a1850
Refactor test_utf
Rename test_from/test_to to make C&P issue obvious and fix that.
Introduce functions for the tests to better group the subtests
2022-05-31 11:07:49 +02:00
Alexander Grund
8eb87bce92
Add tests using char16_t/char32_t when available 2022-05-31 11:07:49 +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
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
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
79c567a34f Fixed incorrect use of "empty" utfXX_t
[SVN r73527]
2011-08-04 13:27:21 +00:00
Artyom Beilis
4acf3e5512 Fixing an issue with incorrect use of templated member functions
[SVN r73481]
2011-08-01 19:29:17 +00:00
Artyom Beilis
d3a7d0a0fa utf_to_utf is now inline and implemented in headers
[SVN r73469]
2011-08-01 08:04:27 +00:00