summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-08-01 09:35:39 -0400
committerMathias Stearn <mathias@10gen.com>2017-08-16 16:28:02 -0400
commit40036f67d0c15e2cd319e82f8c6a1e691fb74806 (patch)
treefd9744b756fb092c47c1b3fbcd15e349fe0e270a /src/mongo/dbtests
parent53a9b329fbf1a6d8b620fee2cbb2ef1c27ddd3f3 (diff)
downloadmongo-40036f67d0c15e2cd319e82f8c6a1e691fb74806.tar.gz
SERVER-30580 No more status locations
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r--src/mongo/dbtests/multikey_paths_test.cpp19
-rw-r--r--src/mongo/dbtests/query_stage_count.cpp18
-rw-r--r--src/mongo/dbtests/query_stage_sort.cpp15
3 files changed, 25 insertions, 27 deletions
diff --git a/src/mongo/dbtests/multikey_paths_test.cpp b/src/mongo/dbtests/multikey_paths_test.cpp
index 6caa614c495..ed64a4c3045 100644
--- a/src/mongo/dbtests/multikey_paths_test.cpp
+++ b/src/mongo/dbtests/multikey_paths_test.cpp
@@ -293,16 +293,15 @@ TEST_F(MultikeyPathsTest, PathsUpdatedOnDocumentUpdate) {
const bool indexesAffected = true;
OpDebug* opDebug = nullptr;
OplogUpdateEntryArgs args;
- collection
- ->updateDocument(_opCtx.get(),
- record->id,
- oldDoc,
- BSON("_id" << 0 << "a" << 5 << "b" << BSON_ARRAY(1 << 2 << 3)),
- enforceQuota,
- indexesAffected,
- opDebug,
- &args)
- .status_with_transitional_ignore();
+ collection->updateDocument(
+ _opCtx.get(),
+ record->id,
+ oldDoc,
+ BSON("_id" << 0 << "a" << 5 << "b" << BSON_ARRAY(1 << 2 << 3)),
+ enforceQuota,
+ indexesAffected,
+ opDebug,
+ &args);
wuow.commit();
}
}
diff --git a/src/mongo/dbtests/query_stage_count.cpp b/src/mongo/dbtests/query_stage_count.cpp
index 0663a1ce626..a66c4d5ab38 100644
--- a/src/mongo/dbtests/query_stage_count.cpp
+++ b/src/mongo/dbtests/query_stage_count.cpp
@@ -126,16 +126,14 @@ public:
BSONObj oldDoc = _coll->getRecordStore()->dataFor(&_opCtx, oldrecordId).releaseToBson();
OplogUpdateEntryArgs args;
args.nss = _coll->ns();
- _coll
- ->updateDocument(&_opCtx,
- oldrecordId,
- Snapshotted<BSONObj>(_opCtx.recoveryUnit()->getSnapshotId(), oldDoc),
- newDoc,
- false,
- true,
- NULL,
- &args)
- .status_with_transitional_ignore();
+ _coll->updateDocument(&_opCtx,
+ oldrecordId,
+ Snapshotted<BSONObj>(_opCtx.recoveryUnit()->getSnapshotId(), oldDoc),
+ newDoc,
+ false,
+ true,
+ NULL,
+ &args);
wunit.commit();
}
diff --git a/src/mongo/dbtests/query_stage_sort.cpp b/src/mongo/dbtests/query_stage_sort.cpp
index bb9082c81fb..2c698748b6c 100644
--- a/src/mongo/dbtests/query_stage_sort.cpp
+++ b/src/mongo/dbtests/query_stage_sort.cpp
@@ -350,18 +350,19 @@ public:
set<RecordId>::iterator it = recordIds.begin();
Snapshotted<BSONObj> oldDoc = coll->docFor(&_opCtx, *it);
- OID updatedId = oldDoc.value().getField("_id").OID();
- SnapshotId idBeforeUpdate = oldDoc.snapshotId();
+ const OID updatedId = oldDoc.value().getField("_id").OID();
+ const SnapshotId idBeforeUpdate = oldDoc.snapshotId();
// We purposefully update the document to have a 'foo' value greater than limit().
// This allows us to check that we don't return the new copy of a doc by asserting
// foo < limit().
- BSONObj newDoc = BSON("_id" << updatedId << "foo" << limit() + 10);
+ auto newDoc = [&](const Snapshotted<BSONObj>& oldDoc) {
+ return BSON("_id" << oldDoc.value()["_id"] << "foo" << limit() + 10);
+ };
OplogUpdateEntryArgs args;
args.nss = coll->ns();
{
WriteUnitOfWork wuow(&_opCtx);
- coll->updateDocument(&_opCtx, *it, oldDoc, newDoc, false, false, NULL, &args)
- .status_with_transitional_ignore();
+ coll->updateDocument(&_opCtx, *it, oldDoc, newDoc(oldDoc), false, false, NULL, &args);
wuow.commit();
}
exec->restoreState();
@@ -379,8 +380,8 @@ public:
oldDoc = coll->docFor(&_opCtx, *it);
{
WriteUnitOfWork wuow(&_opCtx);
- coll->updateDocument(&_opCtx, *it++, oldDoc, newDoc, false, false, NULL, &args)
- .status_with_transitional_ignore();
+ coll->updateDocument(
+ &_opCtx, *it++, oldDoc, newDoc(oldDoc), false, false, NULL, &args);
wuow.commit();
}
}