2
0
mirror of https://github.com/boostorg/uuid.git synced 2026-01-19 04:42:16 +00:00

283 Commits

Author SHA1 Message Date
Peter Dimov
ba66728bd3 Fix header and compile-fail tests to actually work 2024-04-20 23:08:52 +03:00
Peter Dimov
098600f0dc Add compile-fail tests for random_provider 2024-04-20 23:08:52 +03:00
Peter Dimov
e915b5453f Remove root Jamfile 2024-04-20 23:08:52 +03:00
Peter Dimov
863e5759f4 Remove uses of <boost/cstdint.hpp>, <boost/limits.hpp> 2024-04-20 23:08:51 +03:00
Peter Dimov
3fefa4b88c Remove BOOST_NO_STDC_NAMESPACE workarounds 2024-04-20 23:08:51 +03:00
Peter Dimov
e314f6fc90 Disable use of lexical_cast under GCC 4.7 in test_io.cpp 2024-04-19 23:02:19 +03:00
Rene Rivera
28b4ddeddb Make the library modular usable. 2024-03-11 08:38:17 -05:00
Peter Dimov
cdf41beafb Update test/CMakeLists.txt, test/cmake_subdir_test/CMakeLists.txt 2024-03-05 04:03:49 +02:00
Peter Dimov
aa237cfab0 Add CMake tests 2024-03-05 03:54:58 +02:00
Andrey Semashev
1a4e7ed9a8 Improve generated x86 code for AVX targets (#138)
* Re-format the test code for MSVC bug 981648.

* Improved generated x86 code for SSE4.1 and later targets.

Prefer movdqu to lddqu on CPUs supporting SSE4.1 and later. lddqu has one
extra cycle latency on Skylake and later Intel CPUs, and with AVX vlddqu
is not merged to the following instructions as a memory operand, which makes
the code slightly larger. Legacy SSE3 lddqu is still preferred when SSE4.1
is not enabled because it is faster on Prescott and the same as movdqu on
AMD CPUs. It also doesn't affect code size because movdqu cannot be converted
to a memory operand as memory operands are required to be aligned in SSE.

Closes https://github.com/boostorg/uuid/issues/137.

* Use movdqu universally for loading UUIDs.

This effectively drops the optimization for NetBurst CPUs and instead
prefers code that is slightly better on Skylake and later Intel CPUs,
even when the code is compiled for SSE3 and not SSE4.1.
2023-04-15 21:24:52 +03:00
Volo Zyko
94381580f9 Add BOOST_UUID_RANDOM_PROVIDER_GETRANDOM_DISABLE_LIBC_WRAPPER macro 2022-06-07 08:10:57 -04:00
James E. King III
fb3ec7d83c fix test jamfile referring to BOOST_ROOT instead of relative paths 2022-02-02 20:59:12 -05:00
Gudmundur Adalsteinsson
eaa4be7b96 Add to_chars for writing uuid strings without allocating 2021-06-15 12:47:35 -04:00
James E. King III
cc9648b68c Add BOOST_UUID_COMPAT_PRE_1_71_MD5 compatibility mode 2019-06-25 13:21:13 -04:00
James E. King III
eabf964e98 Fix endian issue copying md5 result to byte buffer.
Fix the sha1 and md5 unit tests for endian correctness.
Originally identified by BinCaoWR in GitHub issue #86 and PR #87

This fixes #86
This closes #87
2019-06-25 13:21:13 -04:00
tinko92
24e3e0db36 Fix for typo (LICENCE) and for https links to license (#103)
* Fix Typo in link to License.
* Changed links to https.
2019-04-22 08:56:05 -04:00
James E. King III
cbf098f298 Expanded windows CI tests for more coverage 2018-11-02 08:21:54 -04:00
James E. King III
9b1988001f fix test code warning in matrix build: hides previous local declaration 2018-10-12 08:12:23 -04:00
Andrey Semashev
405f961431 Add support for Linux-specific getrandom call to obtain random data.
getrandom is the base implementation for getentropy on Linux. It is also
available in the form of a syscall, which can be called directly on systems with
glibc versions older than 2.25 which don't yet provide wrappers for getrandom or
getentropy but have a recent enough Linux kernel (for example, Debian Stretch).

On systems other than Linux (e.g. Solaris) getentropy is documented as a
source for initialization of a user-space PRNG instead of a direct source
for random data. Since we use the random data directly to initialize UUIDs,
using getrandom on other platforms, where available, would be more preferable
than getentropy. Unfortunately, the only other platform that is known to support
both getentropy and getrandom (Solaris) documents getrandom to return 0
on error, which is a valid return value on Linux. It's not clear if this is
a documentation error or a true incompatibility, and I have no way to test,
so do not use getrandom on Solaris for now. For this reason (and in case
if it is also used on some other platforms) getentropy backend is still
preserved.

For running tests in the CI on the getentropy backend added the
BOOST_UUID_RANDOM_PROVIDER_DISABLE_GETRANDOM macro, which will disable getrandom
if one is detected. Currently, the macro is only used for tests on Linux.
2018-06-18 10:27:40 -04:00
Andrey Semashev
4a9f620b6d Add support for movability to random generators. Fix POSIX random provider.
The commit adds support for move constructors and assignment to random UUID
generators and random providers. Also, in POSIX random provider, the commit
improves handling of return value from ::read(), which returns -1
in case of error and may return 0 in case of success. Retry the call when
it was interrupted before reading any bytes from /dev/urandom.

Added new tests for movability and compile-fail tests for no copyability.

This addresses GitHub issue:

https://github.com/boostorg/uuid/issues/71
2018-06-18 10:24:46 -04:00
James E. King III
903e8928f6 issue-59: add std::hash support header 2018-05-07 07:54:31 -04:00
James E. King III
d3eb2b250a fix uuid test bjam dependency declarations
This fixes #60
2018-03-26 19:17:31 -04:00
James E. King, III
d37088ab07 synchronize changes with winapi for bcrypt availability
This fixes #63
2018-03-26 16:04:12 -04:00
Andrey Semashev
5fc3a4fa4f Switch WINAPI calling convention macros to the replacements from Boost.WinAPI
WINAPI macro definition in Boost.WinAPI is deprecated as it may clash with the
macro defined in Windows SDK.
2018-03-12 07:35:47 -04:00
James E. King III
0e0c9dc850 update ci build for cppcheck and ubsan 2018-01-21 21:15:38 -05:00
James E. King III
a8a1ec3d82 Changed the default random_generator implementation to use
operating-system provided entropy as it is more secure and
faster for the typical use case of generating one uuid at
a time.

This is a breaking change for anyone passing a mt19937
into one of the explicit constructors of random_generator,
which would be quite rare.

Changed the default random provider on Windows to use BCrypt
where available, falling back to Wincrypt when necessary or
when explicitly requested through a macro.

Provide a new random_generator_mt19937 type definition for
use cases where a large number of uuids need to be created
with high performance.  This is equivalent to the previous
definition of random_generator.

Provide a random generation benchmark test showing the
cutoff where the mt19937-based generator will outperform the
standard generator based on wall time.

Removed template specialization for boost::random::random_device
so that any UniformRandomNumberGenerator can be used properly
with random_generator.

Replaced the seed_rng detail implementation (which had a number
of flaws) with a replacement header-only random_provider
implementation.

Note: entropy generation errors will cause an entropy_error
to be thrown from random_generator.  The previous implementation
ignored errors and silently failed.

Added internal support for entropy generation on cloudabi
platform leveraging the new random_provider implementation.

Added internal support for Universal Windows Platform (UWP)
development leveraging the new random_provider implementation.

Added internal support for getentropy() on Linux and OpenBSD
if certain requirements are met.

This fixes #24
This closes #53
2017-12-18 09:56:02 -05:00
James E. King, III
8a81273ebf revert change to string_generator so it continues to
throw std::runtime_error like it always had before
therefore removing a breaking change before release

remove one unnecessary code branch in string_generator
2017-11-10 20:04:37 -05:00
James E. King, III
5a48cab9af provide a name_generator_latest that always uses the latest hashing
algorithm for applications that do not need stable hashing over time

This fixes #50
2017-11-04 19:50:09 -04:00
James E. King, III
b5adde4409 fix warnings identified by regression matrix 2017-11-01 08:59:25 -04:00
James E. King, III
7810839cd9 fix build error on cygwin 2017-10-31 21:08:54 -07:00
James E. King, III
797d47df61 improve coverage (except for hashing headers) to 100% 2017-10-31 17:27:11 -07:00
James E. King, III
45b8446255 improve string generator coverage to 100% and resolve build warning 2017-10-31 16:15:38 -07:00
James E. King, III
71abd3cbf4 fix codecov pathing (finally) and improve string generator coverage 2017-10-31 14:18:39 -07:00
James E. King, III
5935ff5d55 travis build job changes 2017-10-26 19:06:09 -04:00
James E. King, III
40c3f1a435 resolve some build warnings identified in the test matrix 2017-10-14 22:06:05 -04:00
James E. King, III
966c5dd2d3 re-enable serialization test 2017-10-12 05:26:44 -07:00
James E. King, III
3d2f7758e9 refactor name_generator to have a configurable hash algorithm
and provide backwards compatibility for sha1, and also added
md5 to complete the RFC 4122 spec implementation

as such, boost::uuids::name_generator is deprecated, however
still defined to use the same implementation in previous boost
releases, and name_generator_sha1 as well as name_generator_md5
now exist, in preparation for whatever will replace sha1.

to properly test the new header structure, I took the bjam
rule from winapi to isolate each header as an include and make sure
it has no dependencies on other headers to be included first,
and was able to remove a few test files that became unnecessary.

This fixes #26
2017-10-10 09:01:43 -04:00
James E. King, III
31f74b28f3 add RFC-4122 namespaces from appendix C to name generator 2017-09-22 21:03:10 -07:00
James E. King, III
d69a529573 Add appveyor and travis pull request integration.
Made appveyor.yml and .travis.yml generic so they can be used elsewhere.
Disabled the serialization test for now, until serialization's develop
branch builds successfully on all the CI platforms again.
2017-09-10 10:20:42 -07:00
James E. King, III
5369a9af95 trac-10665: fix name_generator implementation const correctness, now matches documentation 2017-08-12 17:43:46 -07:00
James E. King, III
7ba5d2b46a 12258: re-enable unit test for random_device generator 2017-08-10 12:07:03 -04:00
James E. King, III
07f68d3b9c 11482: uuid string generator now throws if there is any unexpected input following successful conversion of a uuid in the input string
11483: uuid string generator now throws std::invalid_argument instead of std::runtime_error on an invalid uuid string
12253: make the uuid parser reject invalid data and added negative test cases to prove it
2017-08-09 15:38:37 -04:00
Edward Diener
e2d0595c12 Fixed test. 2016-10-07 07:11:18 -04:00
Marshall Clow
1c493350e6 Merge pull request #15 from aldonin/fix-test_wserialization
Fixed missing boost:: namespace; I'm ok with committing this, but it's not a complete solution. This test is commented out in the Jamfile (I suspect that's why no one noticed that it's broken), but if you un-comment it, it fails with a link error - missing the right serialization libraries. This needs to be fixed, too.
2016-04-25 13:36:12 -07:00
aldonin
453e79917d Fixed missing boost:: namespace 2016-04-21 19:56:28 +03:00
Erich Keane
2449c17c7a Added unit-tests for the std::left issue 2015-12-29 13:38:02 -08:00
Edward Diener
70ff8e38ea Fixes for PR "Added a workaround for MSVC 12 (VS2013) optimizer bug. #4". 2015-09-09 17:39:08 -04:00
Ahmed Charles
fc0839f414 Merge branch 'develop' 2015-05-15 10:55:19 -06:00
VemundH
2627d38ccc added tests to reproduce problem 2014-09-30 21:52:24 +02:00
Andrey Semashev
f23215f423 Merged changes from trunk: warning silencing and support for SSE and C++11. Fixes #8495, #8697, #8509.
[SVN r86660]
2013-11-12 20:19:06 +00:00