Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58075 - in trunk: boost/uuid libs/uuid/test
From: atompkins_at_[hidden]
Date: 2009-11-30 22:00:35


Author: atompkins
Date: 2009-11-30 22:00:34 EST (Mon, 30 Nov 2009)
New Revision: 58075
URL: http://svn.boost.org/trac/boost/changeset/58075

Log:
used BOOST_STATIC_CONSTANT
fixed jamfile to use run rule
some other minor compile time fixes
Text files modified:
   trunk/boost/uuid/uuid.hpp | 5 ++-
   trunk/libs/uuid/test/Jamfile.v2 | 51 ++++++++++++++++++---------------------
   trunk/libs/uuid/test/test_io.cpp | 6 ++--
   trunk/libs/uuid/test/test_serialization.cpp | 2
   trunk/libs/uuid/test/test_uuid.cpp | 6 ++--
   trunk/libs/uuid/test/test_wserialization.cpp | 2
   6 files changed, 34 insertions(+), 38 deletions(-)

Modified: trunk/boost/uuid/uuid.hpp
==============================================================================
--- trunk/boost/uuid/uuid.hpp (original)
+++ trunk/boost/uuid/uuid.hpp 2009-11-30 22:00:34 EST (Mon, 30 Nov 2009)
@@ -26,6 +26,7 @@
 // 25 Feb 2008 - moved to namespace boost::uuids
 // 19 Mar 2009 - changed to a POD, reorganized files
 // 28 Nov 2009 - disabled deprecated warnings for MSVC
+// 30 Nov 2009 - used BOOST_STATIC_CONSTANT
 
 #ifndef BOOST_UUID_HPP
 #define BOOST_UUID_HPP
@@ -34,7 +35,7 @@
 #include <stddef.h>
 #include <boost/cstdint.hpp>
 #include <algorithm>
-
+#include <boost/config.hpp> // for static assert
 #include <boost/mpl/bool.hpp>
 #include <boost/type_traits/is_pod.hpp>
 
@@ -64,7 +65,7 @@
     typedef std::size_t size_type;
     typedef std::ptrdiff_t difference_type;
 
- enum { static_size = 16 };
+ BOOST_STATIC_CONSTANT(size_type, static_size = 16);
 
 public:
     iterator begin() { return data; } /* throw() */

Modified: trunk/libs/uuid/test/Jamfile.v2
==============================================================================
--- trunk/libs/uuid/test/Jamfile.v2 (original)
+++ trunk/libs/uuid/test/Jamfile.v2 2009-11-30 22:00:34 EST (Mon, 30 Nov 2009)
@@ -5,59 +5,54 @@
 
 import testing ;
 
-project
- : requirements
- <include>../../..
- ;
-
-test-suite "uuid"
- : # make sure uuid.hpp is self-contained
+{
+ test-suite uuid :
+ # make sure uuid.hpp is self-contained
       [ compile compile_uuid_h.cpp ]
-
+
       # make sure uuid_io.hpp is self-contained
       [ compile compile_uuid_io_h.cpp ]
-
+
       # make sure uuid_serialize.hpp is self-contained
       [ compile compile_uuid_serialize_h.cpp ]
-
+
       # make sure uuid_generators.hpp is self-contained
       [ compile compile_uuid_generators_h.cpp ]
-
+
       # I want to look for issues when multiple translation units include
       # uuid header files. For example missing inline on non-template functions
       #[ link test_uuid.cpp compile_uuid_h.cpp : : multiple_translation_units ]
 
       # main test - added compile_uuid_header.cpp in lue of above test
- [ unit-test test_uuid : test_uuid.cpp compile_uuid_h.cpp ]
+ [ run test_uuid.cpp compile_uuid_h.cpp ]
 
       # test inclucing all .hpp files in 2 translations units
       # to make sure a inline state is not missing
- [ unit-test test_inline : test_include1.cpp test_include2.cpp ]
+ [ run test_include1.cpp test_include2.cpp ]
 
       # test uuid_io.hpp
- [ unit-test test_io : test_io.cpp ]
-
+ [ run test_io.cpp ]
+
       # test uuid_generators.hpp
- [ unit-test test_generators : test_generators.cpp ]
-
+ [ run test_generators.cpp ]
+
       # test tagging an object
- [ unit-test test_tagging : test_tagging.cpp ]
-
+ [ run test_tagging.cpp ]
+
       # test uuid class
- [ unit-test test_uuid_class : test_uuid_class.cpp ]
+ [ run test_uuid_class.cpp ]
 
       # test serializing uuids
- [ unit-test test_serialization
- : test_serialization.cpp ../../serialization/build//boost_serialization
+ [ run test_serialization.cpp ../../serialization/build//boost_serialization
       ]
       # TODO - This test fails to like with boost_wserialization
- #[ unit-test test_wserialization
- # : test_wserialization.cpp
+ #[ run test_wserialization.cpp
       # ../../serialization/build//boost_serialization
       # ../../serialization/build//boost_wserialization
- # : <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
+ # : : : <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
       #]
-
+
       # test sha1 hash function
- [ unit-test test_sha1 : test_sha1.cpp ]
- ;
+ [ run test_sha1.cpp ]
+ ;
+}

Modified: trunk/libs/uuid/test/test_io.cpp
==============================================================================
--- trunk/libs/uuid/test/test_io.cpp (original)
+++ trunk/libs/uuid/test/test_io.cpp 2009-11-30 22:00:34 EST (Mon, 30 Nov 2009)
@@ -24,9 +24,9 @@
     using namespace boost::uuids;
     using boost::test_tools::output_test_stream;
 
- const uuid u1 = {0};
- const uuid u2 = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
- const uuid u3 = {0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef,0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef};
+ const uuid u1 = {{0}};
+ const uuid u2 = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}};
+ const uuid u3 = {{0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef,0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef}};
 
     { // test insert/extract operators
         output_test_stream output;

Modified: trunk/libs/uuid/test/test_serialization.cpp
==============================================================================
--- trunk/libs/uuid/test/test_serialization.cpp (original)
+++ trunk/libs/uuid/test/test_serialization.cpp 2009-11-30 22:00:34 EST (Mon, 30 Nov 2009)
@@ -35,7 +35,7 @@
     
     OStringStreamType o_stream;
     
- uuid u1 = {0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef};
+ uuid u1 = {{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef}};
 
     uuid u2;
     

Modified: trunk/libs/uuid/test/test_uuid.cpp
==============================================================================
--- trunk/libs/uuid/test/test_uuid.cpp (original)
+++ trunk/libs/uuid/test/test_uuid.cpp 2009-11-30 22:00:34 EST (Mon, 30 Nov 2009)
@@ -80,7 +80,7 @@
             , { 0xe0, boost::uuids::uuid::variant_future }
             , { 0xf0, boost::uuids::uuid::variant_future }
             };
- for (int i=0; i<sizeof(tests)/sizeof(Test); i++) {
+ for (size_t i=0; i<sizeof(tests)/sizeof(Test); i++) {
             uuid u = {};
             u.data[8] = tests[i].octet7; // note that octet7 is array index 8
             
@@ -111,8 +111,8 @@
             , { 0xe0, boost::uuids::uuid::version_unknown }
             , { 0xf0, boost::uuids::uuid::version_unknown }
             };
- for (int i=0; i<sizeof(tests)/sizeof(Test); i++) {
- uuid u = {};
+ for (size_t i=0; i<sizeof(tests)/sizeof(Test); i++) {
+ uuid u = {{0}};
             u.data[6] = tests[i].octet9; // note that octet9 is array index 8
             
             BOOST_CHECK_EQUAL(u.version(), tests[i].version);

Modified: trunk/libs/uuid/test/test_wserialization.cpp
==============================================================================
--- trunk/libs/uuid/test/test_wserialization.cpp (original)
+++ trunk/libs/uuid/test/test_wserialization.cpp 2009-11-30 22:00:34 EST (Mon, 30 Nov 2009)
@@ -35,7 +35,7 @@
     
     OStringStreamType o_stream;
     
- uuid u1 = {0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef};
+ uuid u1 = {{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef}};
 
     uuid u2;
     


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk