-
Notifications
You must be signed in to change notification settings - Fork 0
Resolve clang-tidy warnings in test files #1
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
base: main
Are you sure you want to change the base?
Conversation
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
| void setMockTransportClient( | ||
| const std::shared_ptr<uprotocol::test::UTransportMock>& client) { | ||
| mockTransportClient_ = client; | ||
| } | ||
| void setMockTransportServer( | ||
| const std::shared_ptr<uprotocol::test::UTransportMock>& server) { | ||
| mockTransportClient_ = server; | ||
| } | ||
| void setClientUUri(const uprotocol::v1::UUri& uuri) { client_uuri = uuri; } | ||
| void setServerUUri(const uprotocol::v1::UUri& uuri) { server_uuri = uuri; } | ||
| void setSubcriptionUUri(const uprotocol::v1::UUri& uuri) { | ||
| subcription_uuri = uuri; | ||
| } |
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.
Why implement all these setters?
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.
That´s a point. I was no quiet sure if the setter might be needed later. Just a matter if habit...
@lammjo shall I remove all setters from this PR?
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.
Yes, please :) I would favor YAGNI here.
|
|
||
| public: | ||
| ~ConsumerTest() override = default; |
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.
Why move the destructor down here? Did the linter complain about a protected destructor?
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.
Yes! Destructor of '...' is protected and virtual (clang-tidycppcoreguidelines-virtual-class-destructor)
@lammjo is there any other way to mitigate this problem?
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.
Thanks for the explanation :)
| auto subscribe_request_ttl = std::chrono::milliseconds(1000); | ||
| TEST_F(ConsumerTest, ConstructorTestSuccess) { // NOLINT | ||
| constexpr int REQUEST_TTL_TIME = 0x8000; | ||
| auto subcription_callback = someCallBack; |
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.
Typo
| // namespace { | ||
| // using namespace uprotocol::datamodel::builder; |
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.
Remove commented code.
| uprotocol::v1::UUri uri; | ||
| static v1::UUri methodUri(const std::string& auth = "TestAuth", | ||
| uint16_t ue_id = 0x8000, | ||
| uint16_t ue_instance = 1, // NOLINT |
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.
Nice hack! :D
|
Code coverage report is ready! 📈
|
lammjo
left a comment
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.
Thanks, Lennart! Great work! After you've addressed my comments (if applicable) feel free to open a PR into up-cpp/main.
|
|
||
| EXPECT_TRUE(invoke_future.valid()); | ||
| auto is_ready = invoke_future.wait_for(0ms); | ||
| auto is_ready = invoke_future.wait_for(std::chrono::milliseconds(0)); |
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.
I suggest turning 0ms also into a constant just to be consistent with 10ms and 150ms.
| TEST(UuidBuilderTest, CustomTimeAndRandomSource) { | ||
| TEST(UuidBuilderTest, CustomTimeAndRandomSource) { // NOLINT | ||
| constexpr std::time_t FIXED_TIME_T = 1623456789; | ||
| constexpr uint64_t FIXED_RANDOM_T = 0x1234567890ABCDEF; |
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.
| constexpr uint64_t FIXED_RANDOM_T = 0x1234567890ABCDEF; | |
| constexpr uint64_t FIXED_RANDOM_UINT = 0x1234567890ABCDEF; |
| // TODO(unknown) | ||
| TEST_F(TestFixture, SomeTestName) {} // NOLINT |
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.
Oh noez... 🙈 This is not your job right now, but we should keep in mind to implement all missing tests at some point.
| } // namespace | ||
| } // namespace uprotocol::v1 |
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.
Mhmm, me gusta!
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
No description provided.