summaryrefslogtreecommitdiff
path: root/dbtests
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2009-02-09 13:04:32 -0500
committerDwight <dmerriman@gmail.com>2009-02-09 13:04:32 -0500
commit147948c7b33d4542a99352dd02ec3cb88f401a7c (patch)
treef7f2daa54521467911f742c42cfd073eb528f80c /dbtests
parent10d5a55c357c9190b85576fc77bee8a71bb4d05e (diff)
downloadmongo-147948c7b33d4542a99352dd02ec3cb88f401a7c.tar.gz
doneAndDecouple() -> obj()
Diffstat (limited to 'dbtests')
-rw-r--r--dbtests/btreetests.cpp2
-rw-r--r--dbtests/jsobjtests.cpp8
-rw-r--r--dbtests/jsontests.cpp70
-rw-r--r--dbtests/mockdbclient.h2
-rw-r--r--dbtests/namespacetests.cpp34
-rw-r--r--dbtests/pairingtests.cpp2
-rw-r--r--dbtests/repltests.cpp2
7 files changed, 60 insertions, 60 deletions
diff --git a/dbtests/btreetests.cpp b/dbtests/btreetests.cpp
index f2d7883ed54..be1ceea6f38 100644
--- a/dbtests/btreetests.cpp
+++ b/dbtests/btreetests.cpp
@@ -75,7 +75,7 @@ namespace BtreeTests {
BSONObjBuilder builder;
string val( n, c );
builder.append( "a", val );
- return builder.doneAndDecouple();
+ return builder.obj();
}
void locate( BSONObj &key, int expectedPos,
bool expectedFound, const DiskLoc &expectedLocation,
diff --git a/dbtests/jsobjtests.cpp b/dbtests/jsobjtests.cpp
index 4433a4b1d97..abcfa3f8047 100644
--- a/dbtests/jsobjtests.cpp
+++ b/dbtests/jsobjtests.cpp
@@ -37,18 +37,18 @@ namespace JsobjTests {
static BSONObj basic( const char *name, int val ) {
BSONObjBuilder b;
b.appendInt( name, val );
- return b.doneAndDecouple();
+ return b.obj();
}
static BSONObj basic( const char *name, vector< int > val ) {
BSONObjBuilder b;
b.appendIntArray( name, val );
- return b.doneAndDecouple();
+ return b.obj();
}
template< class T >
static BSONObj basic( const char *name, T val ) {
BSONObjBuilder b;
b.append( name, val );
- return b.doneAndDecouple();
+ return b.obj();
}
};
@@ -314,7 +314,7 @@ namespace JsobjTests {
BSONObjBuilder scope;
scope.append( "a", "b" );
b.appendCodeWScope( "c", "d", scope.done() );
- return b.doneAndDecouple();
+ return b.obj();
}
BSONObj invalid() const {
BSONObj ret = valid();
diff --git a/dbtests/jsontests.cpp b/dbtests/jsontests.cpp
index 9d9f130de72..e78d6f29d83 100644
--- a/dbtests/jsontests.cpp
+++ b/dbtests/jsontests.cpp
@@ -358,7 +358,7 @@ namespace JsonTests {
class Empty : public Base {
virtual BSONObj bson() const {
BSONObjBuilder b;
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{}";
@@ -368,7 +368,7 @@ namespace JsonTests {
class EmptyWithSpace : public Base {
virtual BSONObj bson() const {
BSONObjBuilder b;
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ }";
@@ -379,7 +379,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.append( "a", "b" );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : \"b\" }";
@@ -390,7 +390,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.append( "", "" );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"\" : \"\" }";
@@ -407,7 +407,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.append( "$where", 1 );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"$where\" : 1 }";
@@ -418,7 +418,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.append( "a", 1 );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : 1 }";
@@ -434,7 +434,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.append( "a", -4.4433e-2 );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : -4.4433e-2 }";
@@ -446,7 +446,7 @@ namespace JsonTests {
BSONObjBuilder b;
b.append( "a", 1 );
b.append( "b", "foo" );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : 1, \"b\" : \"foo\" }";
@@ -459,7 +459,7 @@ namespace JsonTests {
b.append( "a", 1 );
BSONObjBuilder c;
c.append( "z", b.done() );
- return c.doneAndDecouple();
+ return c.obj();
}
virtual string json() const {
return "{ \"z\" : { \"a\" : 1 } }";
@@ -471,7 +471,7 @@ namespace JsonTests {
vector< int > arr;
BSONObjBuilder b;
b.append( "a", arr );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : [] }";
@@ -486,7 +486,7 @@ namespace JsonTests {
arr.push_back( 3 );
BSONObjBuilder b;
b.append( "a", arr );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : [ 1, 2, 3 ] }";
@@ -497,7 +497,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.appendBool( "a", true );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : true }";
@@ -508,7 +508,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.appendBool( "a", false );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : false }";
@@ -519,7 +519,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.appendNull( "a" );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : null }";
@@ -530,7 +530,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.append( "a", "\" \\ / \b \f \n \r \t" );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : \"\\\" \\\\ \\/ \\b \\f \\n \\r \\t\" }";
@@ -541,7 +541,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.append( "a", "\x7f" );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : \"\x7f\" }";
@@ -552,7 +552,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.append( "\n", "b" );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"\\n\" : \"b\" }";
@@ -572,7 +572,7 @@ namespace JsonTests {
u[ 6 ] = 0;
b.append( "a", u );
ASSERT_EQUALS( string( u ), b.done().firstElement().valuestr() );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : \"\\ua000\\uA000\" }";
@@ -597,7 +597,7 @@ namespace JsonTests {
u[ 7 ] = 0;
b.append( "a", u );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : \"\\u0001\\u007f\\u07ff\\uffff\" }";
@@ -618,7 +618,7 @@ namespace JsonTests {
u[ 5 ] = 0;
b.append( "a", u );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : \"\\u0700\\uff00\" }";
@@ -631,7 +631,7 @@ namespace JsonTests {
OID o;
memset( &o, 0, 12 );
b.appendDBRef( "a", "foo", o );
- return b.doneAndDecouple();
+ return b.obj();
}
// NOTE Testing other formats handled by by Base class.
virtual string json() const {
@@ -643,7 +643,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.appendOID( "_id" );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"_id\" : \"000000000000000000000000\" }";
@@ -656,7 +656,7 @@ namespace JsonTests {
OID o;
memset( &o, 0x0f, 12 );
b.appendOID( "_id", &o );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"_id\" : \"0f0f0f0f0f0f0f0f0f0f0f0f\" }";
@@ -671,7 +671,7 @@ namespace JsonTests {
z[ 2 ] = 'c';
BSONObjBuilder b;
b.appendBinData( "a", 3, ByteArray, z );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : { \"$binary\" : \"YWJj\", \"$type\" : \"02\" } }";
@@ -685,7 +685,7 @@ namespace JsonTests {
z[ 1 ] = 'b';
BSONObjBuilder b;
b.appendBinData( "a", 2, ByteArray, z );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : { \"$binary\" : \"YWI=\", \"$type\" : \"02\" } }";
@@ -698,7 +698,7 @@ namespace JsonTests {
z[ 0 ] = 'a';
BSONObjBuilder b;
b.appendBinData( "a", 1, ByteArray, z );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : { \"$binary\" : \"YQ==\", \"$type\" : \"02\" } }";
@@ -716,7 +716,7 @@ namespace JsonTests {
};
BSONObjBuilder b;
b.appendBinData( "a", 48, ByteArray, z );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : { \"$binary\" : \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\", \"$type\" : \"02\" } }";
@@ -727,7 +727,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.appendDate( "a", 0 );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : { \"$date\" : 0 } }";
@@ -738,7 +738,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.appendDate( "a", 100 );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : { \"$date\" : 100 } }";
@@ -757,7 +757,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.appendRegex( "a", "b", "i" );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : { \"$regex\" : \"b\", \"$options\" : \"i\" } }";
@@ -768,7 +768,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.appendRegex( "a", "\t", "i" );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : { \"$regex\" : \"\\t\", \"$options\" : \"i\" } }";
@@ -779,7 +779,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.appendRegex( "a", "\"", "" );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ \"a\" : /\"/ }";
@@ -808,7 +808,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.append( "a_b", 1 );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ a_b : 1 }";
@@ -819,7 +819,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.append( "$a_b", 1 );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ $a_b : 1 }";
@@ -830,7 +830,7 @@ namespace JsonTests {
virtual BSONObj bson() const {
BSONObjBuilder b;
b.append( "ab'c\"", "bb\b '\"" );
- return b.doneAndDecouple();
+ return b.obj();
}
virtual string json() const {
return "{ 'ab\\'c\"' : 'bb\\b \\'\"' }";
diff --git a/dbtests/mockdbclient.h b/dbtests/mockdbclient.h
index 739e7e5d666..af9149c51e6 100644
--- a/dbtests/mockdbclient.h
+++ b/dbtests/mockdbclient.h
@@ -67,7 +67,7 @@ public:
BSONObjBuilder result;
result.append( "ok", runCommandAgainstRegistered( "admin.$cmd", query.obj, result ) ? 1.0 : 0.0 );
if ( cc_ ) cc_->afterCommand();
- return result.doneAndDecouple();
+ return result.obj();
}
virtual bool connect( const char *serverHostname, string& errmsg ) {
return true;
diff --git a/dbtests/namespacetests.cpp b/dbtests/namespacetests.cpp
index 486348a4cef..4bd8e3c3a4a 100644
--- a/dbtests/namespacetests.cpp
+++ b/dbtests/namespacetests.cpp
@@ -58,18 +58,18 @@ namespace NamespaceTests {
virtual BSONObj key() const {
BSONObjBuilder k;
k.append( "a", 1 );
- return k.doneAndDecouple();
+ return k.obj();
}
BSONObj aDotB() const {
BSONObjBuilder k;
k.append( "a.b", 1 );
- return k.doneAndDecouple();
+ return k.obj();
}
BSONObj aAndB() const {
BSONObjBuilder k;
k.append( "a", 1 );
k.append( "b", 1 );
- return k.doneAndDecouple();
+ return k.obj();
}
static vector< int > shortArray() {
vector< int > a;
@@ -82,7 +82,7 @@ namespace NamespaceTests {
BSONObjBuilder b;
b.append( "b", i );
b.append( "c", 4 );
- return b.doneAndDecouple();
+ return b.obj();
}
static void checkSize( int expected, const BSONObjSetDefaultOrder &objs ) {
ASSERT_EQUALS( BSONObjSetDefaultOrder::size_type( expected ), objs.size() );
@@ -120,7 +120,7 @@ namespace NamespaceTests {
BSONObjSetDefaultOrder keys;
id().getKeysFromObject( b.done(), keys );
checkSize( 1, keys );
- assertEquals( e.doneAndDecouple(), *keys.begin() );
+ assertEquals( e.obj(), *keys.begin() );
}
};
@@ -136,7 +136,7 @@ namespace NamespaceTests {
BSONObjSetDefaultOrder keys;
id().getKeysFromObject( a.done(), keys );
checkSize( 1, keys );
- assertEquals( e.doneAndDecouple(), *keys.begin() );
+ assertEquals( e.obj(), *keys.begin() );
}
private:
virtual BSONObj key() const {
@@ -158,7 +158,7 @@ namespace NamespaceTests {
for ( BSONObjSetDefaultOrder::iterator i = keys.begin(); i != keys.end(); ++i, ++j ) {
BSONObjBuilder b;
b.append( "", j );
- assertEquals( b.doneAndDecouple(), *i );
+ assertEquals( b.obj(), *i );
}
}
};
@@ -179,7 +179,7 @@ namespace NamespaceTests {
BSONObjBuilder b;
b.append( "", j );
b.append( "", 2 );
- assertEquals( b.doneAndDecouple(), *i );
+ assertEquals( b.obj(), *i );
}
}
private:
@@ -204,7 +204,7 @@ namespace NamespaceTests {
BSONObjBuilder b;
b.append( "", 5 );
b.append( "", j );
- assertEquals( b.doneAndDecouple(), *i );
+ assertEquals( b.obj(), *i );
}
}
private:
@@ -212,7 +212,7 @@ namespace NamespaceTests {
BSONObjBuilder k;
k.append( "first", 1 );
k.append( "a", 1 );
- return k.doneAndDecouple();
+ return k.obj();
}
};
@@ -232,7 +232,7 @@ namespace NamespaceTests {
for ( BSONObjSetDefaultOrder::iterator i = keys.begin(); i != keys.end(); ++i, ++j ) {
BSONObjBuilder b;
b.append( "", j );
- assertEquals( b.doneAndDecouple(), *i );
+ assertEquals( b.obj(), *i );
}
}
private:
@@ -276,7 +276,7 @@ namespace NamespaceTests {
for ( BSONObjSetDefaultOrder::iterator i = keys.begin(); i != keys.end(); ++i, ++j ) {
BSONObjBuilder b;
b.append( "", j );
- assertEquals( b.doneAndDecouple(), *i );
+ assertEquals( b.obj(), *i );
}
}
private:
@@ -304,7 +304,7 @@ namespace NamespaceTests {
BSONObjBuilder c;
c.append( "", j );
c.append( "", 99 );
- assertEquals( c.doneAndDecouple(), *i );
+ assertEquals( c.obj(), *i );
}
}
private:
@@ -312,7 +312,7 @@ namespace NamespaceTests {
BSONObjBuilder k;
k.append( "a.b", 1 );
k.append( "d", 1 );
- return k.doneAndDecouple();
+ return k.obj();
}
};
@@ -323,7 +323,7 @@ namespace NamespaceTests {
vector< BSONObj > elts;
BSONObjBuilder s;
s.append( "foo", 41 );
- elts.push_back( s.doneAndDecouple() );
+ elts.push_back( s.obj() );
for ( int i = 1; i < 4; ++i )
elts.push_back( simpleBC( i ) );
BSONObjBuilder b;
@@ -336,7 +336,7 @@ namespace NamespaceTests {
for ( BSONObjSetDefaultOrder::iterator i = keys.begin(); i != keys.end(); ++i, ++j ) {
BSONObjBuilder b;
b.append( "", j );
- assertEquals( b.doneAndDecouple(), *i );
+ assertEquals( b.obj(), *i );
}
}
private:
@@ -428,7 +428,7 @@ namespace NamespaceTests {
string as( 187, 'a' );
BSONObjBuilder b;
b.append( "a", as );
- return b.doneAndDecouple();
+ return b.obj();
}
private:
const char *ns_;
diff --git a/dbtests/pairingtests.cpp b/dbtests/pairingtests.cpp
index 541b0fd9959..27d92a9b932 100644
--- a/dbtests/pairingtests.cpp
+++ b/dbtests/pairingtests.cpp
@@ -177,7 +177,7 @@ namespace PairingTests {
BSONObjBuilder b;
b.appendInt( "ok", ok );
b.appendInt( "you_are", youAre );
- return b.doneAndDecouple();
+ return b.obj();
}
};
diff --git a/dbtests/repltests.cpp b/dbtests/repltests.cpp
index e3c69fcb9ac..9b35e471c57 100644
--- a/dbtests/repltests.cpp
+++ b/dbtests/repltests.cpp
@@ -143,7 +143,7 @@ namespace ReplTests {
id.init();
b.appendOID( "_id", &id );
b.appendElements( fromjson( json ) );
- return b.doneAndDecouple();
+ return b.obj();
}
private:
static DBDirectClient client_;