Skip to content

Commit

Permalink
Add test_uuid_3.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed May 17, 2024
1 parent 414c7f9 commit 7cc541d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ set(BOOST_TEST_LINK_LIBRARIES Boost::uuid Boost::core)
boost_test(TYPE run SOURCES test_uuid.cpp LINK_LIBRARIES Boost::container_hash COMPILE_DEFINITIONS BOOST_UUID_REPORT_IMPLEMENTATION=1)
boost_test(TYPE run SOURCES test_uuid.cpp LINK_LIBRARIES Boost::container_hash COMPILE_DEFINITIONS BOOST_UUID_NO_SIMD=1 BOOST_UUID_REPORT_IMPLEMENTATION=1 NAME test_uuid_no_simd)
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_attribute_packed.cpp)
Expand Down
1 change: 1 addition & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ run test_uuid.cpp
: : : <define>BOOST_UUID_REPORT_IMPLEMENTATION ;
run test_uuid.cpp : : : <define>BOOST_UUID_NO_SIMD <define>BOOST_UUID_REPORT_IMPLEMENTATION : test_uuid_no_simd ;
run test_uuid_2.cpp ;
run test_uuid_3.cpp ;

# test type properties

Expand Down
32 changes: 32 additions & 0 deletions test/test_uuid_3.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// 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/uuid/uuid_io.hpp>
#include <boost/core/lightweight_test.hpp>

using namespace boost::uuids;

int main()
{
{
uuid u;

std::uint8_t* p = u.data();

BOOST_TEST_EQ( p, u.begin() );
BOOST_TEST_EQ( p + u.size(), u.end() );
}

{
uuid const u;

std::uint8_t const* p = u.data();

BOOST_TEST_EQ( p, u.begin() );
BOOST_TEST_EQ( p + u.size(), u.end() );
}

return boost::report_errors();
}

0 comments on commit 7cc541d

Please sign in to comment.