Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate definition and declaration #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vshylienkov
Copy link

Introduces two sets of macro
MOCK_GLOBAL_FUNC*_DECL - for mock function declaration in a header file
MOCK_GLOBAL_FUNC*_DEF - for mock function definition in a source file

example of usage
mocs.hpp
MOCK_GLOBAL_FUNC0_DECL(mul00, int(void))

mocs.cpp
#include "mocs.hpp"
MOCK_GLOBAL_FUNC0_DEF(mul00, int(void))

in testing

#include "mocs.hpp"
#include "gtest/gtest.h"

using namespace testing;

TEST(new_style, zero)
{
const int expected_value = 2;
EXPECT_GLOBAL_CALL(mul00, mul00()).Times(1).WillRepeatedly(Return(expected_value));
int r = mul00();
EXPECT_EQ(r, expected_value);
}

Introduces two sets of macro
`MOCK_GLOBAL_FUNC*_DECL` - for mock function declaration in a header file
`MOCK_GLOBAL_FUNC*_DEF` - for mock function definition in a source file
@jakakordez
Copy link

Hello, what is the status of this? Would greatly appreciate if this was merged as it would ease my development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants