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:
@@ -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)
|
||||
|
||||
@@ -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
22
test/test_alignment_2.cpp
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user