-
-
Notifications
You must be signed in to change notification settings - Fork 449
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
Move mocks to their own interface #4645
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 25 out of 53. Check the log or trigger a new build to see more.
@@ -1,11 +1,12 @@ | |||
#include "Application.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'Application.hpp' file not found [clang-diagnostic-error]
#include "Application.hpp"
^
@@ -45,65 +46,17 @@ | |||
} | |||
}; | |||
|
|||
class MockApplication : IApplication | |||
class MockApplication : mock::EmptyApplication |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: accounts, highlights [cppcoreguidelines-pro-type-member-init]
benchmarks/src/Highlights.cpp:60:
- AccountController accounts;
- HighlightController highlights;
+ AccountController accounts{};
+ HighlightController highlights{};
@@ -0,0 +1,81 @@ | |||
#pragma once | |||
|
|||
#include "Application.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'Application.hpp' file not found [clang-diagnostic-error]
#include "Application.hpp"
^
|
||
#include <vector> | ||
|
||
namespace chatterino::mock { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: modification of 'std' namespace can result in undefined behavior [cert-dcl58-cpp]
namespace chatterino::mock {
^
Additional context
/usr/include/c++/11/bits/unique_ptr.h:44: 'std' namespace opened here
namespace std _GLIBCXX_VISIBILITY(default)
^
public: | ||
virtual ~Helix() = default; | ||
|
||
MOCK_METHOD(void, fetchUsers, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: invalid case style for function 'MOCK_METHOD' [readability-identifier-naming]
MOCK_METHOD(void, fetchUsers, | |
mockMethod(void, fetchUsers, |
HelixFailureCallback failureCallback), | ||
(override)); | ||
|
||
MOCK_METHOD(void, unblockUser, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: invalid case style for function 'MOCK_METHOD' [readability-identifier-naming]
MOCK_METHOD(void, unblockUser, | |
mockMethod(void, unblockUser, |
HelixFailureCallback failureCallback), | ||
(override)); | ||
|
||
MOCK_METHOD(void, updateChannel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: invalid case style for function 'MOCK_METHOD' [readability-identifier-naming]
MOCK_METHOD(void, updateChannel, | |
mockMethod(void, updateChannel, |
HelixFailureCallback failureCallback), | ||
(override)); | ||
|
||
MOCK_METHOD(void, manageAutoModMessages, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: invalid case style for function 'MOCK_METHOD' [readability-identifier-naming]
MOCK_METHOD(void, manageAutoModMessages, | |
mockMethod(void, manageAutoModMessages, |
std::function<void(HelixAutoModMessageError)> failureCallback), | ||
(override)); | ||
|
||
MOCK_METHOD(void, getCheermotes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: invalid case style for function 'MOCK_METHOD' [readability-identifier-naming]
MOCK_METHOD(void, getCheermotes, | |
mockMethod(void, getCheermotes, |
HelixFailureCallback failureCallback), | ||
(override)); | ||
|
||
MOCK_METHOD(void, getEmoteSetData, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: invalid case style for function 'MOCK_METHOD' [readability-identifier-naming]
MOCK_METHOD(void, getEmoteSetData, | |
mockMethod(void, getEmoteSetData, |
Description
Code mostly taken from https://github.com/Chatterino/chatterino2/pull/4644/files
This allows us to share mocks between multiple projects (i.e. tests & benchmarks)