Mark InternalDefaultActionSetAt as nodiscard.

PiperOrigin-RevId: 820207225
Change-Id: I8e053f724c18b466bd287f80a720542a535615d2
This commit is contained in:
Abseil Team
2025-10-16 06:31:44 -07:00
committed by Copybara-Service
parent e17e37a115
commit b2b9072ecb
3 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -545,7 +545,7 @@ TEST(ExpectCallTest, DoesNotLogWhenVerbosityIsError) {
void OnCallLogger() {
DummyMock mock;
ON_CALL(mock, TestMethod());
(void)ON_CALL(mock, TestMethod());
}
// Verifies that ON_CALL logs if the --gmock_verbose flag is set to "info".
@@ -568,7 +568,7 @@ TEST(OnCallTest, DoesNotLogWhenVerbosityIsError) {
void OnCallAnyArgumentLogger() {
DummyMock mock;
ON_CALL(mock, TestMethodArg(_));
(void)ON_CALL(mock, TestMethodArg(_));
}
// Verifies that ON_CALL prints provided _ argument.
+4 -4
View File
@@ -160,7 +160,7 @@ class MockCC : public CC {
// Tests that a method with expanded name compiles.
TEST(OnCallSyntaxTest, CompilesWithMethodNameExpandedFromMacro) {
MockCC cc;
ON_CALL(cc, Method());
(void)ON_CALL(cc, Method());
}
// Tests that the method with expanded name not only compiles but runs
@@ -193,7 +193,7 @@ TEST(OnCallSyntaxTest, EvaluatesFirstArgumentOnce) {
MockA a;
MockA* pa = &a;
ON_CALL(*pa++, DoA(_));
(void)ON_CALL(*pa++, DoA(_));
EXPECT_EQ(&a + 1, pa);
}
@@ -201,7 +201,7 @@ TEST(OnCallSyntaxTest, EvaluatesSecondArgumentOnce) {
MockA a;
int n = 0;
ON_CALL(a, DoA(n++));
(void)ON_CALL(a, DoA(n++));
EXPECT_EQ(1, n);
}
@@ -232,7 +232,7 @@ TEST(OnCallSyntaxTest, WillByDefaultIsMandatory) {
EXPECT_DEATH_IF_SUPPORTED(
{
ON_CALL(a, DoA(5));
(void)ON_CALL(a, DoA(5));
a.DoA(5);
},
"");