diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2015-06-01 11:19:53 -0400 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2015-06-03 11:13:31 -0400 |
commit | b9ed79089841c5c05086a490c1323514f342bb42 (patch) | |
tree | edaf31999ac6c6266254e9a41e54674c4d9120a4 /src/mongo/unittest | |
parent | f9685f7f8ed8240e763da406e3e97d94e7a919e6 (diff) | |
download | mongo-b9ed79089841c5c05086a490c1323514f342bb42.tar.gz |
SERVER-18236 hang slaveOk/secondaryOk and readPreference off OpCtx
- secondaryOk is upconverted/downconverted from QueryOption_SlaveOk
- readPreference is upconverted/downconverted from $query wrapped commands or $queryOptions
- both are now accessed via OperationContext instead of being read from a mutable command object
- removed logic for parsing secondaryOk and readPreference from the command execution pipeline in dbcommands.cpp
Diffstat (limited to 'src/mongo/unittest')
-rw-r--r-- | src/mongo/unittest/unittest.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/unittest/unittest.h b/src/mongo/unittest/unittest.h index e22f76c5f1d..7faa5dcb3bd 100644 --- a/src/mongo/unittest/unittest.h +++ b/src/mongo/unittest/unittest.h @@ -37,6 +37,7 @@ #include <cmath> #include <sstream> #include <string> +#include <utility> #include <vector> #include <boost/config.hpp> @@ -511,6 +512,12 @@ DECLARE_COMPARISON_ASSERTION(GTE, >=); return swt.getValue(); } + template <typename T> + T assertGet(StatusWith<T>&& swt) { + ASSERT_OK(swt.getStatus()); + return std::move(swt.getValue()); + } + /** * Hack to support the runaway test observer in dbtests. This is a hook that * unit test running harnesses (unittest_main and dbtests) must implement. |