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

Upgrade GTest/GMock to v1.10 #841

Closed
elBoberido opened this issue Jun 9, 2021 · 0 comments · Fixed by #1006
Closed

Upgrade GTest/GMock to v1.10 #841

elBoberido opened this issue Jun 9, 2021 · 0 comments · Fixed by #1006
Assignees
Labels
test A module/integration/stress/etc test for a component

Comments

@elBoberido
Copy link
Member

Brief feature description

GTest/GMock v1.10 introduced some new features which makes especially writing mocks a lot easier.

Detailed information

With GMock v1.8 it is quite cumbersome to mock methods with the noexcept specifier since it is not possible to use the MOCK_METHOD directly and a delegation is needed. Since iceoryx uses this specifier all over the place its a PITA to write mocks with GMock v1.8

Assuming you want to mock the following class

class Foo
{
  public:
    virtual bool bar(int, int) noexcept;
};

With GMock v1.8 the mock looks like this

class FooMock : public Foo
{
  public:
    bool bar(int a, int b) noexcept override
    {
        return barMock(a, b);
    }

    MOCK_METHOD2(barMock, bool(int, int));
};

With GMock v1.10 it is much simpler

class FooMock : public Foo
{
  public:
    MOCK_METHOD(bool, bar, (int, int), (noexcept override));
};

Furthermore, override can also directly be used, which helps to write more robust mocks.

Last but not least, we already use GTest/GMock v1.10 for Windows since v1.8 has issues on this platform.

@elBoberido elBoberido added the test A module/integration/stress/etc test for a component label Jun 9, 2021
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 4, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 4, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 4, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 4, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 4, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 4, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 4, 2022
@elBoberido elBoberido self-assigned this Jan 4, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 4, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 4, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 7, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 7, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 7, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 7, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 7, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 7, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 7, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 7, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 7, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 7, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 11, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 11, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 11, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 11, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 11, 2022
elBoberido added a commit that referenced this issue Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test A module/integration/stress/etc test for a component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant