summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests
diff options
context:
space:
mode:
authorYoonsoo Kim <yoonsoo.kim@mongodb.com>2021-07-22 01:48:29 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-22 02:13:04 +0000
commit52b6b281105274c3a66312fc6ee8a2c12f4a9e40 (patch)
tree9a641823ca82ac833444183251370dad61f81c6b /src/mongo/dbtests
parent97e7a659d01f8f5ceef69a4f738cdf76396d99db (diff)
downloadmongo-52b6b281105274c3a66312fc6ee8a2c12f4a9e40.tar.gz
SERVER-57390 Remove getLastError implementation
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r--src/mongo/dbtests/directclienttests.cpp24
-rw-r--r--src/mongo/dbtests/querytests.cpp7
-rw-r--r--src/mongo/dbtests/updatetests.cpp7
3 files changed, 9 insertions, 29 deletions
diff --git a/src/mongo/dbtests/directclienttests.cpp b/src/mongo/dbtests/directclienttests.cpp
index 2df1ca8ec02..3c9b421ecfa 100644
--- a/src/mongo/dbtests/directclienttests.cpp
+++ b/src/mongo/dbtests/directclienttests.cpp
@@ -44,19 +44,9 @@ namespace DirectClientTests {
using std::unique_ptr;
using std::vector;
-class ClientBase {
-public:
- ClientBase() {
- mongo::LastError::get(cc()).reset();
- }
- virtual ~ClientBase() {
- mongo::LastError::get(cc()).reset();
- }
-};
-
const char* ns = "a.b";
-class InsertMany : ClientBase {
+class InsertMany {
public:
virtual void run() {
const ServiceContext::UniqueOperationContext opCtxPtr = cc().makeOperationContext();
@@ -82,7 +72,7 @@ public:
}
};
-class BadNSCmd : ClientBase {
+class BadNSCmd {
public:
virtual void run() {
const ServiceContext::UniqueOperationContext opCtxPtr = cc().makeOperationContext();
@@ -97,7 +87,7 @@ public:
}
};
-class BadNSQuery : ClientBase {
+class BadNSQuery {
public:
virtual void run() {
const ServiceContext::UniqueOperationContext opCtxPtr = cc().makeOperationContext();
@@ -110,7 +100,7 @@ public:
}
};
-class BadNSGetMore : ClientBase {
+class BadNSGetMore {
public:
virtual void run() {
const ServiceContext::UniqueOperationContext opCtxPtr = cc().makeOperationContext();
@@ -122,7 +112,7 @@ public:
}
};
-class BadNSInsert : ClientBase {
+class BadNSInsert {
public:
virtual void run() {
const ServiceContext::UniqueOperationContext opCtxPtr = cc().makeOperationContext();
@@ -134,7 +124,7 @@ public:
}
};
-class BadNSUpdate : ClientBase {
+class BadNSUpdate {
public:
virtual void run() {
const ServiceContext::UniqueOperationContext opCtxPtr = cc().makeOperationContext();
@@ -146,7 +136,7 @@ public:
}
};
-class BadNSRemove : ClientBase {
+class BadNSRemove {
public:
virtual void run() {
const ServiceContext::UniqueOperationContext opCtxPtr = cc().makeOperationContext();
diff --git a/src/mongo/dbtests/querytests.cpp b/src/mongo/dbtests/querytests.cpp
index 89b52a3f172..b99b686f3bf 100644
--- a/src/mongo/dbtests/querytests.cpp
+++ b/src/mongo/dbtests/querytests.cpp
@@ -260,12 +260,7 @@ public:
class ClientBase {
public:
- ClientBase() : _client(&_opCtx) {
- mongo::LastError::get(_opCtx.getClient()).reset();
- }
- virtual ~ClientBase() {
- mongo::LastError::get(_opCtx.getClient()).reset();
- }
+ ClientBase() : _client(&_opCtx) {}
protected:
void insert(const char* ns, BSONObj o) {
diff --git a/src/mongo/dbtests/updatetests.cpp b/src/mongo/dbtests/updatetests.cpp
index 6ec4144369c..f29ccdb9699 100644
--- a/src/mongo/dbtests/updatetests.cpp
+++ b/src/mongo/dbtests/updatetests.cpp
@@ -58,12 +58,7 @@ namespace dps = ::mongo::dotted_path_support;
class ClientBase {
public:
- ClientBase() : _client(&_opCtx) {
- mongo::LastError::get(_opCtx.getClient()).reset();
- }
- virtual ~ClientBase() {
- mongo::LastError::get(_opCtx.getClient()).reset();
- }
+ ClientBase() : _client(&_opCtx) {}
protected:
const ServiceContext::UniqueOperationContext _txnPtr = cc().makeOperationContext();