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

Add a test for uuid overalignment

This commit is contained in:
Peter Dimov
2024-06-10 18:12:08 +03:00
parent a6117a422c
commit 1b4b53d029
3 changed files with 24 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ boost_test(TYPE run SOURCES test_uuid_2.cpp)
boost_test(TYPE run SOURCES test_uuid_3.cpp)
boost_test(TYPE run SOURCES test_alignment.cpp)
boost_test(TYPE run SOURCES test_alignment_2.cpp)
boost_test(TYPE run SOURCES test_attribute_packed.cpp)
boost_test(TYPE run SOURCES test_pragma_pack.cpp)
boost_test(TYPE run SOURCES test_data.cpp)

View File

@@ -62,6 +62,7 @@ run test_uuid_3.cpp ;
# test type properties
run test_alignment.cpp ;
run test_alignment_2.cpp ;
run test_attribute_packed.cpp ;
run test_pragma_pack.cpp ;
run test_data.cpp ;

22
test/test_alignment_2.cpp Normal file
View File

@@ -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/core/lightweight_test.hpp>
#include <cstddef>
using namespace boost::uuids;
int main()
{
BOOST_TEST_LE( alignof(uuid), alignof(std::max_align_t) );
#if defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__)
BOOST_TEST_LE( alignof(uuid), __STDCPP_DEFAULT_NEW_ALIGNMENT__ );
#endif
return boost::report_errors();
}