| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
* Remove setPlainConsoleLogger()
* Update errorcodes linter to work with custom user defined log macros
rename src/mongo/embedded/{embedded_log_appender.h => embedded_log_backend.h} (61%)
|
|
|
|
| |
Capture log system uses logv2, tests can handle converted log statements.
|
| |
|
| |
|
|
|
|
|
| |
- fix dangling else
- all ASSERT* yield a stream expression for appending detail
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Segregate old-style dbtests into their own Suite initialization
system: OldStyleSuiteSpecification. This is where the funky
deprecated features can live on without interfering with the
Suite API. It also gives us a searchable base class to identify
them in the future.
OldStyleSuite has `setupTests()` and an `add<T>()` that
Suite does not have. Suite API can shrink when it doesn't
have to support these dbtest adaptor features.
Suite only needs non-template `add(name, callback)`.
- Add OldStyleSuiteInitializer to some dbtests that were missing it!
These didn't use SuiteInstance to register themselves and were
incorrect. They would self register, resulting in _allSuites()
holding a std::shared_ptr to a static-duration Suite object!
- Change `getSuite()` to return `Suite&` instead of `Suite*`.
- No more "self-registering" in Suite constructor. Registration
must be done as a separate post-construction step. This removes
some unusual lifetime management code and is easier to document.
Suite::getSuite(name) is the only way to make a Suite, and it
does the make_shared and registration calls with a pseudo-private
ConstructorEnable idiom.
- Suite->run() returns std::unique_ptr<Result> instead of
raw `Result*`. It's virtual to support OldStyleSuite behavior.
- Suite._ran does nothing. Removed.
- Result.cur does nothing. Removed.
- Switch to pass-by-value and std::move for most ctor args.
- Add explicit on 1-arg ctors.
- Get rid of TestHolder. It's just a 2-field struct.
- use fmt instead of snprintf
- TEST and TEST_F macros: generate TEST_TYPE once.
- TEST and TEST_F macros: inline the _agent variable.
- Mark _doRun as `override`.
- Terminology: replace CASE_NAME with SUITE_NAME.
- rename DeathTestImpl -> DeathTestBase
- move getDeathTestPattern into the test as a static member function
- refactor out some repetition from the comparator decl macros
- use if-constexpr and diamond relops to clean up the
ComparisonAssertion class.
- dbtests: conditionally skip some add<T> calls
- further dedup (DEATH_)TEST(_F) macros
|
|
|
|
|
|
| |
`MONGO_COMPILER_NOINLINE`
Also removed the `PACKED_DECL`, since it isn't used.
|
|
|
|
|
| |
The `FAIL(...)` invocation should be outside of the try/catch block for
this construct.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Names which match either of these RegExes are reserved for C++ implementations:
- "__"
- "^_[A-Z]"
The unittest macros should not have these names, nor should they have the
capacity to generate these names by token composition.
|
|
|
|
| |
This reverts commit ad9267a722e21268d1005c1428ccad85d5a98946 (SERVER-41614).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Hostnames passed to replSetInitiate, replSetReconfig, addShard, etc. are
all normalized by replacing ASCII uppercase characters with lowercase
characters, consistent with how MongoDB drivers treat hostnames.
The shell's getHostName() function now returns the hostname lowercased.
Fixes undefined behavior in mongo::str::toLower().
|
| |
|
| |
|
|
|
|
| |
This reverts commit 5e346eb4b9bb3ec678d4eac36b3f0a18c1c10939.
|
|
|
|
|
|
|
|
| |
Hostnames passed to replSetInitiate, replSetReconfig, addShard, etc. are
all normalized by replacing ASCII uppercase characters with lowercase
characters, consistent with how MongoDB drivers treat hostnames.
Fixes undefined behavior in mongo::str::toLower().
|
|
|
|
|
|
| |
Rename utils/mongoutils/str.h => utils/str.h
Rename namespace mongoutils::str => str
Rename mongo::strcasecmp => str::caseInsensitiveCompare.
|
|
|
|
|
|
|
|
|
|
|
| |
produced by:
hits="$(git grep -n MONGO_DISALLOW_COPYING | cut -d: -f1 )"
for f in "$hits"; do
sed -i.orig '
s/^\( *\)MONGO_DISALLOW_COPYING(\(.*\));/\1\2(const \2\&) = delete;\n\1\2\& operator=(const \2\&) = delete;/;
' $f
done
|
| |
|
|
|
|
|
|
| |
Remove leading comments that are just stating the filename.
Move any file-level comments below the copyright banner.
Remove leading blank lines.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some tests in `dbtest` do not use the `mongo::unittest::Test` class
as a basis for their implementation and thus need some way to benefit
from global DB Environment initialization functions. Specifically
the changes in SERVER-32630 required `serverCompatibilityVersion`
to be set sensibly. Some tests in `dbtest` were not correctly
getting this benefit; instead only incidentally getting a correct
setting by accident, as the results of an unintended residue of
an earlier operation. This can lead to inconsistentcies in which
tests pass, as link order changes -- the tests are registered using
static initialization, whose instability of order can cause
mysterious failures in `dbtest`.
|
| |
|
|
|
|
|
|
|
| |
GCC-8 doesn't treat `_Pragma(...)` ignore directives in
macros the way that Clang does. Instead of this technique, we'll
make the requirement on `ASSERT_THROWS`' parameter an expression,
not a statement.
|
| |
|
|
|
|
|
|
| |
It shouldn't be necessary to explicitly ignore status returns in
functions when testing their throw behavior - the test is sufficient
to indicate that `Status` is ignored.
|
|
|
|
|
| |
Appenders and LogDomains now use unique ptrs internally and on
signature.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use unique_ptr instead of shared_ptr.
Simplify with range-based for loops and auto where appropriate.
Change ASSERT_EQ guts to rely less on macros.
Change the reserved _[A-Z] names (use trailing underscore instead).
Change a vector<T*> to vector<unique_ptr<T>>.
Change shared_ptr<T*> to unique_ptr<T>.
Add a comment to mongoutils::str::stream lamenting missing relops.
Add static to comparator() members.
Add static constexpr to name() members.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
BSONObj instances should now be compared via the comparator
interface's evaluate() method. This preferred over using
BSONObj::woCompare() directly. If the comparison doesn't
require any database semantics (e.g. there is no collation),
there is a global instance of the SimpleBSONObjComparator
which should be used for BSONObj comparisons. If the
comparison requires special semantics, then callers must
instantiate their own comparator object.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
no _id
|
|
|
|
|
|
| |
While std::function has some broken edge cases on VS2013, so does
boost::function in boost 1.56. Rather than upgrade boost, use MSVC's
std::function and fix up the few places that need adjustment.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The approach of this fix is to first make the appender for capturing log lines
thread safe, and then to make it very unlikely that bad things happen if a test
races between logging and detaching the special capture appender. We make it
unlikely by taking advantage of the fact that appenders are removed by setting a
pointer in a vector to NULL, and make sure that the capture appender is not
destroyed when it is detached, but rather when the test fixture destructor runs.
This means that if logging only occurs while a test fixture exists (likely if
tests don't start threads outside of fixtures), tests will not try to use a
capture appender that has gone out of scope.
|
| |
|
| |
|
|
|
|
| |
MONGO_DISALLOW_COPYING
|