summaryrefslogtreecommitdiff
path: root/dbtests/clienttests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dbtests/clienttests.cpp')
-rw-r--r--dbtests/clienttests.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/dbtests/clienttests.cpp b/dbtests/clienttests.cpp
index 7b151376dbf..58287e90bde 100644
--- a/dbtests/clienttests.cpp
+++ b/dbtests/clienttests.cpp
@@ -119,12 +119,17 @@ namespace ClientTests {
for( int i = 0; i < 10; ++i )
db.insert( ns(), BSON( "i" << i ) );
auto_ptr< DBClientCursor > c = db.query( ns(), Query().sort( BSON( "i" << 1 ) ) );
+
BSONObj o = c->next();
ASSERT( c->more() );
+ ASSERT_EQUALS( 9 , c->objsLeftInBatch() );
ASSERT( c->moreInCurrentBatch() );
+
c->putBack( o );
ASSERT( c->more() );
+ ASSERT_EQUALS( 10, c->objsLeftInBatch() );
ASSERT( c->moreInCurrentBatch() );
+
o = c->next();
BSONObj o2 = c->next();
BSONObj o3 = c->next();
@@ -136,9 +141,12 @@ namespace ClientTests {
ASSERT_EQUALS( i, o[ "i" ].number() );
}
ASSERT( !c->more() );
+ ASSERT_EQUALS( 0, c->objsLeftInBatch() );
ASSERT( !c->moreInCurrentBatch() );
+
c->putBack( o );
ASSERT( c->more() );
+ ASSERT_EQUALS( 1, c->objsLeftInBatch() );
ASSERT( c->moreInCurrentBatch() );
ASSERT_EQUALS( 1, c->itcount() );
}