Suppresses self-assignment warnings.
This commit is contained in:
parent
915129ee6f
commit
7225dd179a
|
@ -77,7 +77,8 @@ class LinkedPtrTest : public testing::Test {
|
|||
TEST_F(LinkedPtrTest, GeneralTest) {
|
||||
{
|
||||
linked_ptr<A> a0, a1, a2;
|
||||
a0 = a0;
|
||||
// Use explicit function call notation here to suppress self-assign warning.
|
||||
a0.operator=(a0);
|
||||
a1 = a2;
|
||||
ASSERT_EQ(a0.get(), static_cast<A*>(NULL));
|
||||
ASSERT_EQ(a1.get(), static_cast<A*>(NULL));
|
||||
|
|
|
@ -46,13 +46,14 @@ if not IS_LINUX:
|
|||
class GTestNCTest(unittest.TestCase):
|
||||
"""Negative compilation test for Google Test."""
|
||||
|
||||
def testCompilerError(self):
|
||||
"""Verifies that erroneous code leads to expected compiler
|
||||
messages."""
|
||||
# The class body is intentionally empty. The actual test*() methods
|
||||
# will be defined at run time by a call to
|
||||
# DefineNegativeCompilationTests() later.
|
||||
pass
|
||||
|
||||
# Defines a list of test specs, where each element is a tuple
|
||||
# (test name, list of regexes for matching the compiler errors).
|
||||
test_specs = [
|
||||
TEST_SPECS = [
|
||||
('CANNOT_IGNORE_RUN_ALL_TESTS_RESULT',
|
||||
[r'ignoring return value']),
|
||||
|
||||
|
|
|
@ -1150,7 +1150,8 @@ TEST(StringTest, CanBeAssignedNonEmpty) {
|
|||
TEST(StringTest, CanBeAssignedSelf) {
|
||||
String dest("hello");
|
||||
|
||||
dest = dest;
|
||||
// Use explicit function call notation here to suppress self-assign warning.
|
||||
dest.operator=(dest);
|
||||
EXPECT_STREQ("hello", dest.c_str());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user