summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/namespacetests.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2014-05-29 18:52:13 -0400
committerMathias Stearn <mathias@10gen.com>2014-05-30 12:10:16 -0400
commit2d8c11e9d43f6918e19b96219fe5cff6d1b3481e (patch)
treee40f496a73709de479394c1c3de2ca713e511b71 /src/mongo/dbtests/namespacetests.cpp
parenta78d754b67040c19714bc4696dd7feb5ce10d412 (diff)
downloadmongo-2d8c11e9d43f6918e19b96219fe5cff6d1b3481e.tar.gz
SERVER-13641 Stop making a new OperationContextImpl in Database::getFileFormat
Diffstat (limited to 'src/mongo/dbtests/namespacetests.cpp')
-rw-r--r--src/mongo/dbtests/namespacetests.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mongo/dbtests/namespacetests.cpp b/src/mongo/dbtests/namespacetests.cpp
index 9e0f3006a1f..83dae759de6 100644
--- a/src/mongo/dbtests/namespacetests.cpp
+++ b/src/mongo/dbtests/namespacetests.cpp
@@ -61,8 +61,9 @@ namespace NamespaceTests {
class BtreeIndexMissingField {
public:
void run() {
+ OperationContextImpl txn;
BSONObj spec( BSON("key" << BSON( "a" << 1 ) ));
- ASSERT_EQUALS(jstNULL, IndexLegacy::getMissingField(NULL,spec).firstElement().type());
+ ASSERT_EQUALS(jstNULL, IndexLegacy::getMissingField(&txn, NULL,spec).firstElement().type());
}
};
@@ -70,8 +71,9 @@ namespace NamespaceTests {
class TwoDIndexMissingField {
public:
void run() {
+ OperationContextImpl txn;
BSONObj spec( BSON("key" << BSON( "a" << "2d" ) ));
- ASSERT_EQUALS(jstNULL, IndexLegacy::getMissingField(NULL,spec).firstElement().type());
+ ASSERT_EQUALS(jstNULL, IndexLegacy::getMissingField(&txn, NULL,spec).firstElement().type());
}
};
@@ -79,6 +81,7 @@ namespace NamespaceTests {
class HashedIndexMissingField {
public:
void run() {
+ OperationContextImpl txn;
BSONObj spec( BSON("key" << BSON( "a" << "hashed" ) ));
BSONObj nullObj = BSON( "a" << BSONNULL );
@@ -90,7 +93,7 @@ namespace NamespaceTests {
ASSERT_EQUALS( ExpressionKeysPrivate::makeSingleHashKey( nullObj.firstElement(), 0, 0 ),
nullFieldFromKey.Long() );
- BSONObj missingField = IndexLegacy::getMissingField(NULL,spec);
+ BSONObj missingField = IndexLegacy::getMissingField(&txn, NULL,spec);
ASSERT_EQUALS( NumberLong, missingField.firstElement().type() );
ASSERT_EQUALS( nullFieldFromKey, missingField.firstElement());
}
@@ -103,6 +106,7 @@ namespace NamespaceTests {
class HashedIndexMissingFieldAlternateSeed {
public:
void run() {
+ OperationContextImpl txn;
BSONObj spec( BSON("key" << BSON( "a" << "hashed" ) << "seed" << 0x5eed ));
BSONObj nullObj = BSON( "a" << BSONNULL );
@@ -115,7 +119,7 @@ namespace NamespaceTests {
// Ensure that getMissingField recognizes that the seed is different (and returns
// the right key).
- BSONObj missingField = IndexLegacy::getMissingField(NULL,spec);
+ BSONObj missingField = IndexLegacy::getMissingField(&txn, NULL,spec);
ASSERT_EQUALS( NumberLong, missingField.firstElement().type());
ASSERT_EQUALS( nullFieldFromKey, missingField.firstElement());
}