test_nil_generator.cpp 931 B

1234567891011121314151617181920212223242526272829
  1. // (C) Copyright Andy Tompkins 2010. Permission to copy, use, modify, sell and
  2. // distribute this software is granted provided this copyright notice appears
  3. // in all copies. This software is provided "as is" without express or implied
  4. // warranty, and with no claim as to its suitability for any purpose.
  5. // Distributed under the Boost Software License, Version 1.0. (See
  6. // accompanying file LICENSE_1_0.txt or copy at
  7. // https://www.boost.org/LICENSE_1_0.txt)
  8. // libs/uuid/test/test_nil_generator.cpp -------------------------------//
  9. #include <boost/uuid/uuid.hpp>
  10. #include <boost/uuid/uuid_io.hpp>
  11. #include <boost/uuid/nil_generator.hpp>
  12. #include <boost/detail/lightweight_test.hpp>
  13. int main(int, char*[])
  14. {
  15. using namespace boost::uuids;
  16. uuid u1 = nil_generator()();
  17. uuid u2 = {{0}};
  18. BOOST_TEST_EQ(u1, u2);
  19. uuid u3 = nil_uuid();
  20. BOOST_TEST_EQ(u3, u2);
  21. return boost::report_errors();
  22. }