1 // (C) Copyright Andy Tompkins 2009. 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 6 // Distributed under the Boost Software License, Version 1.0. (See 7 // accompanying file LICENSE_1_0.txt or copy at 8 // https://www.boost.org/LICENSE_1_0.txt) 9 10 // libs/uuid/test/test_uuid_class.cpp -------------------------------// 11 12 #include <boost/uuid/uuid.hpp> 13 #include <boost/uuid/uuid_generators.hpp> 14 #include <boost/uuid/uuid_io.hpp> 15 16 #include <boost/detail/lightweight_test.hpp> 17 18 class uuid_class : public boost::uuids::uuid 19 { 20 public: uuid_class()21 uuid_class() 22 : boost::uuids::uuid(boost::uuids::random_generator()()) 23 {} 24 uuid_class(boost::uuids::uuid const & u)25 explicit uuid_class(boost::uuids::uuid const& u) 26 : boost::uuids::uuid(u) 27 {} 28 }; 29 main(int,char * [])30 int main(int, char*[]) 31 { 32 uuid_class u1; 33 uuid_class u2; 34 BOOST_TEST_NE(u1, u2); 35 BOOST_TEST_EQ(u1.is_nil(), false); 36 BOOST_TEST_EQ(u2.is_nil(), false); 37 38 u2 = u1; 39 BOOST_TEST_EQ(u1, u2); 40 41 return boost::report_errors(); 42 } 43