diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-04-28 17:28:02 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-04-29 15:09:57 -0400 |
commit | ca3f2b297817fc6f1a535bd0281df7ecc3ba6979 (patch) | |
tree | 71ffefdce2d682b02102c6de68906c4fbcf1aa83 /src/mongo/dbtests/dbhelper_tests.cpp | |
parent | cf3d1dd725362dd098af038f99f7fb232e3210b3 (diff) | |
download | mongo-ca3f2b297817fc6f1a535bd0281df7ecc3ba6979.tar.gz |
SERVER-13084,SERVER-13632,SERVER-13634 Remove DiskLoc methods hitting disk
Diffstat (limited to 'src/mongo/dbtests/dbhelper_tests.cpp')
-rw-r--r-- | src/mongo/dbtests/dbhelper_tests.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mongo/dbtests/dbhelper_tests.cpp b/src/mongo/dbtests/dbhelper_tests.cpp index 1424ce3c861..8ee890939fb 100644 --- a/src/mongo/dbtests/dbhelper_tests.cpp +++ b/src/mongo/dbtests/dbhelper_tests.cpp @@ -26,9 +26,10 @@ * then also delete it in the license file. */ +#include "mongo/client/dbclientcursor.h" +#include "mongo/db/catalog/collection.h" #include "mongo/db/dbhelpers.h" #include "mongo/dbtests/dbtests.h" -#include "mongo/client/dbclientcursor.h" #include "mongo/unittest/unittest.h" namespace mongo { @@ -126,7 +127,7 @@ namespace mongo { { // search _id range (0, 10) Lock::DBRead lk( ns ); - Client::Context ctx( ns ); + KeyRange range( ns, BSON( "_id" << 0 ), BSON( "_id" << numDocsInserted ), @@ -143,9 +144,13 @@ namespace mongo { ASSERT_NOT_EQUALS( estSizeBytes, 0 ); ASSERT_LESS_THAN( estSizeBytes, maxSizeBytes ); + Database* db = dbHolder().get(nsToDatabase(range.ns), storageGlobalParams.dbpath); + const Collection* collection = db->getCollection(ns); + // Make sure all the disklocs actually correspond to the right info - for ( set<DiskLoc>::iterator it = locs.begin(); it != locs.end(); ++it ) { - ASSERT_EQUALS( it->obj()["tag"].OID(), tag ); + for ( set<DiskLoc>::const_iterator it = locs.begin(); it != locs.end(); ++it ) { + const BSONObj obj = collection->docFor(*it); + ASSERT_EQUALS(obj["tag"].OID(), tag); } } } |