Skip to content

Commit

Permalink
Add test_uuid_cx. Refs #161.
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Sep 22, 2024
1 parent 1a866fb commit 6c43a6d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 4 additions & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ run test_entropy_error.cpp ;
run test_detail_random_provider.cpp
: : : <library>/boost/array//boost_array ;

# constexpr tests

compile test_uuid_cx.cpp ;

# 'quick' test for CI

run quick.cpp ;
22 changes: 22 additions & 0 deletions test/test_uuid_cx.cpp
Original file line number Diff line number Diff line change
@@ -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 <boost/uuid/uuid.hpp>
#include <boost/config.hpp>

#if defined(BOOST_NO_CXX14_CONSTEXPR)

#include <boost/config/pragma_message.hpp>
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

0 comments on commit 6c43a6d

Please sign in to comment.