summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/counttests.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-06-17 13:01:44 -0400
committerEliot Horowitz <eliot@10gen.com>2012-06-17 13:01:44 -0400
commit79a08e1d5b12952dc345c6fcdd7e9d4ffad7a8bf (patch)
tree2a2a4413a3ab38eea2668e9c315dccb8da679a74 /src/mongo/dbtests/counttests.cpp
parent332d3c2060ae825a64542255603be8ee04bc7f72 (diff)
downloadmongo-79a08e1d5b12952dc345c6fcdd7e9d4ffad7a8bf.tar.gz
ERVER-2291 - cleaning count exception handling
Diffstat (limited to 'src/mongo/dbtests/counttests.cpp')
-rw-r--r--src/mongo/dbtests/counttests.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mongo/dbtests/counttests.cpp b/src/mongo/dbtests/counttests.cpp
index 9ed8a1eb486..bcaf4ac0185 100644
--- a/src/mongo/dbtests/counttests.cpp
+++ b/src/mongo/dbtests/counttests.cpp
@@ -82,7 +82,8 @@ namespace CountTests {
insert( "{\"a\":\"b\"}" );
BSONObj cmd = fromjson( "{\"query\":{}}" );
string err;
- ASSERT_EQUALS( 1, runCount( ns(), cmd, err ) );
+ int errCode;
+ ASSERT_EQUALS( 1, runCount( ns(), cmd, err, errCode ) );
}
};
@@ -94,7 +95,8 @@ namespace CountTests {
insert( "{\"a\":\"c\"}" );
BSONObj cmd = fromjson( "{\"query\":{\"a\":\"b\"}}" );
string err;
- ASSERT_EQUALS( 2, runCount( ns(), cmd, err ) );
+ int errCode;
+ ASSERT_EQUALS( 2, runCount( ns(), cmd, err, errCode ) );
}
};
@@ -105,7 +107,8 @@ namespace CountTests {
insert( "{\"c\":\"d\"}" );
BSONObj cmd = fromjson( "{\"query\":{},\"fields\":{\"a\":1}}" );
string err;
- ASSERT_EQUALS( 2, runCount( ns(), cmd, err ) );
+ int errCode;
+ ASSERT_EQUALS( 2, runCount( ns(), cmd, err, errCode ) );
}
};
@@ -117,7 +120,8 @@ namespace CountTests {
insert( "{\"d\":\"e\"}" );
BSONObj cmd = fromjson( "{\"query\":{\"a\":\"b\"},\"fields\":{\"a\":1}}" );
string err;
- ASSERT_EQUALS( 1, runCount( ns(), cmd, err ) );
+ int errCode;
+ ASSERT_EQUALS( 1, runCount( ns(), cmd, err, errCode ) );
}
};
@@ -128,7 +132,8 @@ namespace CountTests {
insert( "{\"a\":\"c\"}" );
BSONObj cmd = fromjson( "{\"query\":{\"a\":/^b/}}" );
string err;
- ASSERT_EQUALS( 1, runCount( ns(), cmd, err ) );
+ int errCode;
+ ASSERT_EQUALS( 1, runCount( ns(), cmd, err, errCode ) );
}
};
@@ -207,7 +212,8 @@ namespace CountTests {
int numYieldsBeforeCount = numYields();
string err;
- ASSERT_EQUALS( 1000, runCount( ns(), countCommand( BSON( "a" << 1 ) ), err ) );
+ int errCode;
+ ASSERT_EQUALS( 1000, runCount( ns(), countCommand( BSON( "a" << 1 ) ), err, errCode ) );
ASSERT_EQUALS( "", err );
int numYieldsAfterCount = numYields();