Skip to content
Snippets Groups Projects
Commit e41f31f2 authored by Adam Badura's avatar Adam Badura
Browse files

Add tests for MockFunction deduction (#2277)

Add tests checking that ::testing::MockFunction template argument can
be deduced in a function call context. This is a property raised in the
review, however, not checked before by any tests.
parent 482ac6ee
No related branches found
No related tags found
No related merge requests found
......@@ -779,6 +779,36 @@ TEST(MockMethodMockFunctionTest, AsStdFunctionWithReferenceParameter) {
}
namespace {
template <typename Expected, typename F>
static constexpr bool IsMockFunctionTemplateArgumentDeducedTo(const MockFunction<F>&) {
return std::is_same<F, Expected>::value;
}
} // namespace
template <typename F>
class MockMethodMockFunctionSignatureTest : public Test {
};
using MockMethodMockFunctionSignatureTypes = Types<
void(),
int(),
void(int),
int(int),
int(bool, int),
int(bool, char, int, int, int, int, int, char, int, bool)
>;
TYPED_TEST_SUITE(MockMethodMockFunctionSignatureTest, MockMethodMockFunctionSignatureTypes);
TYPED_TEST(MockMethodMockFunctionSignatureTest, IsMockFunctionTemplateArgumentDeduced) {
using Argument = TypeParam;
MockFunction<Argument> foo;
EXPECT_TRUE(IsMockFunctionTemplateArgumentDeducedTo<Argument>(foo));
}
struct MockMethodSizes0 {
MOCK_METHOD(void, func, ());
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment