Alexander Grund
6bfbde5c24
Improve test_system
...
Split parent and child code into functions for better output
Introduce TEST_EQUAL for better output
Compare each entry in env-pointer and argv
Don't check env-pointer values against getenv() as they might differ:
When launching the program from e.g. bash with `temp=bar`then there is
TEMP and temp in the list (env-pointer) but getenv/GetEnvironmentVariable
is case insensitive picking up the first matching value.
2020-04-03 16:21:15 +02:00
Alexander Grund
aef150a638
Use Boost_ prefix for configurable options
2020-03-29 21:26:47 +02:00
Alexander Grund
c6241c917b
Workaround for empty environment variables
...
On AzP the test fails due to BUILD_REQUESTEDFOREMAIL= being in the env
pointer but not in the environment.
On Windows a "set FOO=" UNsets FOO so empty values are likely not part
of the environment, hence don't check via getenv for those.
Add a test including an empty env variable.
2020-03-28 18:44:37 +01:00
Alexander Grund
58773bbcf3
Add debug output to test_system
2020-03-28 17:51:44 +01:00
Alexander Grund
7054b4b2a6
Allow building as standalone (No Boost references at all)
...
Update conversion script
Fix references in Code
Add tests
2020-03-15 18:44:21 +01:00
Alexander Grund
3e0a7e33b1
Fix minor issues and improve stackstring tests
...
Make some functions protected to derive a test class from stackstring
which can be used to detect wether a stack or heap value is used
Fix or silence issues from static analyser findings
Double-check and handle surrogates in iostream
2020-03-14 17:46:49 +01:00
Alexander Grund
5379ff55b4
Handle/Silence issues from coverity
2020-03-05 16:07:37 +01:00
Alexander Grund
1efba9eec7
Add C++11 move ctor and assignment and swap functions
2020-02-28 19:35:38 +01:00
Alexander Grund
0804214f92
[Test] Fix tests for stackstring
...
Values that should go onto stack were put on heap invalidating some tests
2020-02-25 15:00:49 +01:00
Alexander Grund
6ae2d8aa9b
Fix crash on assignment of empty stackstring
...
Also add this as a testcase
2020-02-25 15:00:49 +01:00
Alexander Grund
b171658b0a
[Test] Improve test_stackstring
...
Show some progress
Test using stackstring in a vector
2020-02-25 15:00:49 +01:00
Alexander Grund
3e391eac15
Rename BOOST_NOWIDE_USE_FSTREAM_REPLACEMENTS to BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
2020-02-25 15:00:49 +01:00
Alexander Grund
c792d00d02
[CI] Test shared and static builds through b2
2020-02-25 15:00:49 +01:00
Alexander Grund
a54481131d
Fix build on MinGW/Cygwin when -std=c++nn is passed
...
That flag forces ISO conformance removing the declarations of the
required _w* functions.
Move the implementations using those into source files and undef
__STRICT_ANSI__ inside that file
Also allows to not use the *_s functions on MSVC as
_CRT_SECURE_NO_WARNINGS can be safely define inside the cpp files.
2020-02-25 15:00:36 +01:00
Alexander Grund
7474cb8b4a
Avoid CRT_SECURE_WARNINGS on clang-win
2020-02-24 18:00:48 +01:00
Alexander Grund
777ed33ad0
[Test] Improve fstream tests
...
- Add test for gcount after get/putback
- Remove "sanity" checks using std streams
- Avoid the need to test the superset of functionality and focus on
what Boost.Nowide (should) provide
- Also avoids compiler quirks (e.g. MSVC or libstdc++ behavior on putback)
2020-02-24 14:32:25 +01:00
Alexander Grund
4cbfd4be41
[Test] Avoid message boxes on assertion failures
2020-02-24 13:31:57 +01:00
Alexander Grund
2dbe4552c3
Don't use map.at for C++98 compatibility
2020-02-24 13:31:57 +01:00
Alexander Grund
9a12cb560b
[Test] Prevent abort on freopen(NULL on MSVC
2020-02-22 23:31:41 +01:00
Alexander Grund
7e75be04b5
[Test] Add some output to test_stdio
2020-02-22 15:51:14 +01:00
Alexander Grund
d3fc524943
[Test] Avoid C4127 (constant expression detected in test macro)
2020-02-22 15:51:14 +01:00
Alexander Grund
35e98fad2f
[CI] Fix Jamfile
2020-02-22 15:51:11 +01:00
Alexander Grund
53809122df
Allow passing string length to widen/narrow
...
This allows to use non-NULL-terminated strings as input
Also update the docs
2020-02-10 15:05:24 +01:00
Alexander Grund
3ff3002a22
Improve performance test
...
Run multiple times and take mean speed
Present results in a table for easier comparison
Add some tricks to avoid optimization reordering stuff that breaks the benchmark
2020-02-06 16:57:09 +01:00
Alexander Grund
98b2a398bf
Test for std::string ctor/open on all platforms
2020-02-05 13:07:24 +01:00
Alexander Grund
dbac66606d
Add support for *::filesystem::path to fstream classes
2020-02-04 19:04:07 +01:00
Alexander Grund
d3b49dd589
Also test string ctor of fstream classes when replacements are used
...
I.e. BOOST_NOWIDE_USE_FSTREAM_REPLACEMENTS is defined
2020-02-04 19:04:07 +01:00
Alexander Grund
8e08054b42
Reduce max line length to 120
2020-02-04 17:46:48 +01:00
Alexander Grund
14675cd822
Fix utf8_codecvt conversion of UTF-16 string with trailing surrogate
...
The correct result is `partial`, not `ok`
2020-01-08 17:24:46 +01:00
Alexander Grund
bf8b679555
Improve conversion tests
...
- Move common test cases into test_sets
- Run test_sets with all variants of conversions
- Handle incomplete input in codecvt conversion test
2020-01-08 17:24:46 +01:00
Alexander Grund
999893c4e6
Remove unused u2w_tests array from test
2020-01-08 10:25:49 +01:00
Alexander Grund
7854435d8e
Switch pointer alignment to left
...
Consistency with rest of boost
2020-01-07 21:27:26 +01:00
Alexander Grund
bb2487351f
Use west-const
...
Almost all of boost does, so be nice stay consistent
2020-01-07 21:26:12 +01:00
Alexander Grund
1168f607bb
Remove vim format tags
2020-01-07 19:41:33 +01:00
Alexander Grund
afe7304f29
Use define instead of commandline switch for test_system
2020-01-07 19:41:33 +01:00
Alexander Grund
920e60c6da
Remove unused vectors in test_codecvt
2020-01-06 09:42:18 +01:00
Alexander Grund
74586edc53
Test and fix compile failure in is_open function
2020-01-06 09:42:18 +01:00
Alexander Grund
1eefeed7eb
Supress long-long warning
2020-01-02 21:04:35 +01:00
Alexander Grund
f47a70130f
Enable correct warnings for CMake tests
2020-01-02 18:47:57 +01:00
Alexander Grund
956ecbf6d1
Use pragma instead of _CRT_SECURE_NO_WARNINGS
...
Allows to detect missing suppressions in headers
2020-01-02 18:47:57 +01:00
Alexander Grund
e972bea06d
Make stackstring return NULL when no string was converted (NULL passed or default constructed)
...
This is important for e.g. freopen where an empty string and a NULL pointer have different meanings
Rename c_str to get to avoid confusion
2020-01-02 18:47:56 +01:00
Alexander Grund
7e4e8c2194
Split tests for convert and stackstring
2020-01-02 18:47:55 +01:00
Alexander Grund
831f4461fd
Improve stdio test
...
Add comment for every subtest
Ensure completeness
2020-01-02 18:47:54 +01:00
Alexander Grund
393b8d510a
Add test for filebuf under non-windows
2020-01-02 18:47:53 +01:00
Alexander Grund
5813bfacec
Add BOOST_NOWIDE_USE_FSTREAM_REPLACEMENTS macro
...
Allows to test the fstream classes on e.g. Linux
They were designed to work cross-platform
2020-01-02 18:47:53 +01:00
Alexander Grund
c50504e388
Rewrite test_fstream
...
Small functions testing subsets
Descriptive comments
Add some missing tests
2020-01-02 18:47:48 +01:00
Alexander Grund
10d43c46cd
Create test_failed function for easier debugging
...
Can set breakpoints inside
2020-01-02 18:47:47 +01:00
Alexander Grund
1bff7b670c
Remove usage of Boost.LightweightTest
...
Tests assume TEST terminates execution on failure which is not how BLWT behaves
2020-01-02 18:47:46 +01:00
Alexander Grund
5c684c0fe6
Combine cenv and system to cstdlib
...
Follows the C++ headers
2020-01-02 18:47:45 +01:00
Alexander Grund
695fb73512
Make instances of stackstring const where possible
2020-01-02 18:47:44 +01:00