Disables -Wunused-member-function and -Wused-but-marked-unused that trigger via MOCK_METHOD() and EXPECT_THAT() macros.
Fixes: #4052, #4055 PiperOrigin-RevId: 491647393 Change-Id: I8e2ad838156fa8c7e9dccd1740af797e694992b6
This commit is contained in:
committed by
Copybara-Service
parent
e68764c147
commit
a16bfcfda1
@@ -958,6 +958,21 @@ TEST(MockMethodMockFunctionTest, MockMethodSizeOverhead) {
|
||||
EXPECT_EQ(sizeof(LegacyMockMethodSizes0), sizeof(MockMethodSizes0));
|
||||
}
|
||||
|
||||
TEST(MockMethodMockFunctionTest, EnsureNoUnusedMemberFunction) {
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic error "-Wunused-member-function"
|
||||
#endif
|
||||
// https://github.com/google/googletest/issues/4052
|
||||
struct Foo {
|
||||
MOCK_METHOD(void, foo, ());
|
||||
};
|
||||
EXPECT_CALL(Foo(), foo()).Times(0);
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
void hasTwoParams(int, int);
|
||||
void MaybeThrows();
|
||||
void DoesntThrow() noexcept;
|
||||
|
||||
Reference in New Issue
Block a user