Alexander Grund
f0d95b079b
Add TEST_CONTEXT
...
Avoid to require manual output in anticipation of failures.
2024-12-01 19:36:58 +01:00
Alexander Grund
034dae9c77
Test the base_converter
(ASCII implementation as fallback)
2023-10-13 10:54:50 +02:00
Alexander Grund
f407262ea7
Add test for codecvt
unshift
and encoding
functions
2023-07-03 14:58:05 +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
0bf6ba514d
Replace unsafe usages of reinterpret_cast
...
Such casts usually work but are technically undefined behavior
if the target isn't `(unsigned) char`
2023-06-09 10:41:44 +02:00
Alexander Grund
9b1813e757
Remove superflous braces
...
Make the code a bit shorter vertically, enforced formating ensures
correct indentation which provides enough readability
2023-05-16 12:04:59 +02:00
Alexander Grund
43dcfd7ec7
Make utf8_codecvt::out
return partial
for trailing surrogates
...
When a high surrogate is encountered there must be something following.
If it is not, the input is incomplete, i.e. "partial".
Fixes #50
2023-03-05 18:15:26 +01: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
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
06ccb9f951
Disable formatting for manually aligned lines
2022-10-10 14:25: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
192807a27e
Fix various MSVC warnings
...
Mostly constant conditions and narrowing casts
2022-07-01 17:13:52 +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
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
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
7727a978d5
Added missing header
2017-07-22 22:50:16 +03:00
Artyom Beilis
9679230cf3
- Implemented generic codecvt
...
- added header only utf8 facet implementation
- moved internal codecvt to use new version
- performance improvements in internal codecvt facets
2015-10-18 17:22:26 +03:00