From bd6d0c99195e324e14390205e2bc6ff88c01e365 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Mon, 26 Mar 2012 12:58:35 -0400 Subject: replace assert with verify SERVER-1259 --- src/mongo/bson/oid.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/mongo/bson/oid.cpp') diff --git a/src/mongo/bson/oid.cpp b/src/mongo/bson/oid.cpp index 77c7cd0687f..b70b96352f8 100644 --- a/src/mongo/bson/oid.cpp +++ b/src/mongo/bson/oid.cpp @@ -21,8 +21,7 @@ #include "../db/nonce.h" #include "bsonobjbuilder.h" #include -#undef assert -#define assert MONGO_assert +#define verify MONGO_verify BOOST_STATIC_ASSERT( sizeof(mongo::OID) == 12 ); @@ -71,7 +70,7 @@ namespace mongo { nonce64 a = Security::getNonceDuringInit(); nonce64 b = Security::getNonceDuringInit(); nonce64 c = Security::getNonceDuringInit(); - assert( !(a==b && b==c) ); + verify( !(a==b && b==c) ); } unsigned long long n = Security::getNonceDuringInit(); @@ -106,7 +105,7 @@ namespace mongo { // xor in the pid into _pid. this reduces the probability of collisions. foldInPid(x); ourMachineAndPid = genMachineAndPid(); - assert( x != ourMachineAndPid ); + verify( x != ourMachineAndPid ); ourMachineAndPid = x; } @@ -134,7 +133,7 @@ namespace mongo { } void OID::init( string s ) { - assert( s.size() == 24 ); + verify( s.size() == 24 ); const char *p = s.c_str(); for( int i = 0; i < 12; i++ ) { data[i] = fromHex(p); -- cgit v1.2.1