diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a413ef5..0fe278e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -80,4 +80,6 @@ boost_test(TYPE run SOURCES test_detail_random_provider.cpp LINK_LIBRARIES Boost boost_test(TYPE run SOURCES test_serialization.cpp LINK_LIBRARIES Boost::serialization) +boost_test(TYPE compile SOURCES test_uuid_cx.cpp) + boost_test(TYPE run SOURCES quick.cpp) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 8178539..178e5c2 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -201,6 +201,10 @@ run test_entropy_error.cpp ; run test_detail_random_provider.cpp : : : /boost/array//boost_array ; +# constexpr tests + +compile test_uuid_cx.cpp ; + # 'quick' test for CI run quick.cpp ; diff --git a/test/test_uuid_cx.cpp b/test/test_uuid_cx.cpp new file mode 100644 index 0000000..79a20d0 --- /dev/null +++ b/test/test_uuid_cx.cpp @@ -0,0 +1,22 @@ +// Copyright 2024 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include + +#if defined(BOOST_NO_CXX14_CONSTEXPR) + +#include +BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX14_CONSTEXPR is defined") + +#else + +#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) + +using namespace boost::uuids; + +constexpr uuid u1; +constexpr uuid u2 = {{ 0x01, 0x02 }}; + +#endif