diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2015-04-20 18:51:35 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2015-04-29 11:55:38 -0400 |
commit | da31be34dc6664d76868543e9ccdaecad4f504c6 (patch) | |
tree | cca380d1419bffe8371f24f73fca169a042b87e1 /src/mongo/dbtests/directclienttests.cpp | |
parent | bdbe140e3cc502a58d50a8ec472bd9c05cf12e4f (diff) | |
download | mongo-da31be34dc6664d76868543e9ccdaecad4f504c6.tar.gz |
SERVER-18131 Clean up LastError.
Makes LastError a decoration on Client. Removes behavior that was specific to
the dbKillCursors wire protocol message into the processing for that message,
and out of last error. Simplifies lifetime of LastError. It always exists on
Clients, so there's no checking for its existence, and no passing it around
through parts of the networking library.
Diffstat (limited to 'src/mongo/dbtests/directclienttests.cpp')
-rw-r--r-- | src/mongo/dbtests/directclienttests.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mongo/dbtests/directclienttests.cpp b/src/mongo/dbtests/directclienttests.cpp index 822db3b58f4..fc076a9f926 100644 --- a/src/mongo/dbtests/directclienttests.cpp +++ b/src/mongo/dbtests/directclienttests.cpp @@ -33,6 +33,7 @@ #include <iostream> +#include "mongo/db/client.h" #include "mongo/db/db.h" #include "mongo/db/dbdirectclient.h" #include "mongo/db/json.h" @@ -49,15 +50,11 @@ namespace DirectClientTests { class ClientBase { public: ClientBase() { - _prevError = mongo::lastError._get( false ); - mongo::lastError.release(); - mongo::lastError.reset( new LastError() ); + mongo::LastError::get(cc()).reset(); } virtual ~ClientBase() { - mongo::lastError.reset( _prevError ); + mongo::LastError::get(cc()).reset(); } - private: - LastError* _prevError; }; const char *ns = "a.b"; |