-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Testing Infrastructure
-
Server Tooling & Methods
-
Fully Compatible
In unittest/unittest.h, ASSERT_TRUE has ASSERT as an alias for readability.
In a similar vein, some tests would benefit (in terms of readability) from having an ASSERT_NOT macro, which is an alias for ASSERT_FALSE.
For example, I think this:
ASSERT_NOT(::mongo::serverGlobalParams.cwd.empty());
is more readable (ie. more clearly expresses the concept that "cwd is not empty") than either of the alternatives:
// Slightly brain bending
ASSERT_FALSE(::mongo::serverGlobalParams.cwd.empty());
// The ! is easily missed (visually)
ASSERT(!::mongo::serverGlobalParams.cwd.empty());