summaryrefslogtreecommitdiff
path: root/dbtests/clienttests.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2010-08-11 12:38:57 +0200
committerAntonin Kral <a.kral@bobek.cz>2010-08-11 12:38:57 +0200
commit7645618fd3914cb8a20561625913c20d49504a49 (patch)
tree8370f846f58f6d71165b7a0e2eda04648584ec76 /dbtests/clienttests.cpp
parent68c73c3c7608b4c87f07440dc3232801720b1168 (diff)
downloadmongodb-7645618fd3914cb8a20561625913c20d49504a49.tar.gz
Imported Upstream version 1.6.0
Diffstat (limited to 'dbtests/clienttests.cpp')
-rw-r--r--dbtests/clienttests.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/dbtests/clienttests.cpp b/dbtests/clienttests.cpp
index 6735a40..58287e9 100644
--- a/dbtests/clienttests.cpp
+++ b/dbtests/clienttests.cpp
@@ -16,7 +16,7 @@
// client.cpp
-#include "stdafx.h"
+#include "pch.h"
#include "../client/dbclient.h"
#include "dbtests.h"
#include "../db/concurrency.h"
@@ -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() );
}
@@ -153,7 +161,7 @@ namespace ClientTests {
ASSERT( db.runCommand( "unittests", BSON( "collstats" << "clienttests.create" ), info ) );
}
};
-
+
class All : public Suite {
public:
All() : Suite( "client" ){