mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
fix bsondemo and add to SConstruct
This commit is contained in:
parent
7cab28a61f
commit
dd337cb1d6
@ -1133,6 +1133,7 @@ clientEnv = env.Clone();
|
||||
clientEnv.Append( CPPPATH=["../"] )
|
||||
clientEnv.Prepend( LIBS=[ "mongoclient"] )
|
||||
clientEnv.Prepend( LIBPATH=["."] )
|
||||
clientEnv["CPPDEFINES"].remove( "MONGO_EXPOSE_MACROS" )
|
||||
l = clientEnv[ "LIBS" ]
|
||||
removeIfInList( l , "pcre" )
|
||||
removeIfInList( l , "pcrecpp" )
|
||||
@ -1185,6 +1186,7 @@ clientTests += [ clientEnv.Program( "secondExample" , [ "client/examples/second.
|
||||
clientTests += [ clientEnv.Program( "whereExample" , [ "client/examples/whereExample.cpp" ] ) ]
|
||||
clientTests += [ clientEnv.Program( "authTest" , [ "client/examples/authTest.cpp" ] ) ]
|
||||
clientTests += [ clientEnv.Program( "httpClientTest" , [ "client/examples/httpClientTest.cpp" ] ) ]
|
||||
clientTests += [ clientEnv.Program( "bsondemo" , [ "bson/bsondemo/bsondemo.cpp" ] ) ]
|
||||
|
||||
# testing
|
||||
test = testEnv.Program( "test" , Glob( "dbtests/*.cpp" ) )
|
||||
|
@ -63,9 +63,13 @@ namespace mongo {
|
||||
}
|
||||
#endif
|
||||
#if !defined(uassert)
|
||||
inline void uasserted(unsigned msgid, std::string) {
|
||||
throw bson::assertion();
|
||||
}
|
||||
|
||||
inline void uassert(unsigned msgid, std::string msg, bool expr) {
|
||||
if( !expr )
|
||||
throw bson::assertion();
|
||||
uasserted( msgid , msg );
|
||||
}
|
||||
inline void msgasserted(int msgid, const char *msg) {
|
||||
throw bson::assertion();
|
||||
|
@ -18,6 +18,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <string.h>
|
||||
|
||||
namespace bson {
|
||||
typedef mongo::BSONElement be;
|
||||
|
@ -273,7 +273,7 @@ namespace mongo {
|
||||
massert( 10323 , "Invalid CodeWScope string size", totalSize >= strSizeWNull + 4 + 4 );
|
||||
massert( 10324 , "Invalid CodeWScope string size",
|
||||
strSizeWNull > 0 &&
|
||||
strSizeWNull - 1 == strnlen( codeWScopeCode(), strSizeWNull ) );
|
||||
(strSizeWNull - 1) == strnlen( codeWScopeCode(), strSizeWNull ) );
|
||||
massert( 10325 , "Invalid CodeWScope size", totalSize >= strSizeWNull + 4 + 4 + 4 );
|
||||
int objSize = *( int * )( value() + 4 + 4 + strSizeWNull );
|
||||
massert( 10326 , "Invalid CodeWScope object size", totalSize == 4 + 4 + strSizeWNull + objSize );
|
||||
|
Loading…
Reference in New Issue
Block a user