-
Notifications
You must be signed in to change notification settings - Fork 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
Add unit tests for _get_type_id #9
Conversation
WalkthroughThis pull request introduces a new Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (1)
tests/test_olg_scheduler.cpp (1)
89-90
: Document the significance of the type ID valueThe hardcoded type ID array lacks documentation explaining its significance. What does this value represent? Is it a hash? UUID? How was it generated? This context is crucial for maintainability.
tests/test_olg_scheduler.cpp
Outdated
// Check the type ID. | ||
constexpr std::array<std::uint8_t, 16> expected_type_id = | ||
{0xB6, 0x87, 0x48, 0xA6, 0x7A, 0xDB, 0x4D, 0xF1, 0xB3, 0x1D, 0xA9, 0x8D, 0x50, 0xA7, 0x82, 0x47}; | ||
const auto actual_type_id = Event<Loop::time_point>::_get_type_id_(); |
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.
💡 Codebase verification
Based on the search results, I can generate the final response:
Method naming convention appears to be inconsistent with the codebase
The codebase consistently uses camelCase for method names (e.g., getDeadline()
, getTree()
, getParentNode()
), while _get_type_id_()
is the only method using underscores. This method appears in only two places:
include/olg_scheduler/olg_scheduler.hpp
(definition)tests/test_olg_scheduler.cpp
(usage)
🔗 Analysis chain
Verify method naming convention
The method _get_type_id_()
uses double underscores which is an unconventional naming pattern. Consider verifying if this aligns with the project's naming conventions.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for similar method naming patterns in the codebase
# Search for methods with double underscores
rg -g '*.{cpp,hpp,h}' '_\w+_\(\)'
# Search for other get methods to verify naming convention
rg -g '*.{cpp,hpp,h}' 'get[A-Z]\w+\(\)'
Length of output: 6155
8b4a8d1
to
58f71c1
Compare
58f71c1
to
3197240
Compare
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.
ElementsAreArray
is needed if C arrays are compared. For c++ collections you can use ElementsAre
(there is already using testing::ElementsAre;
BTW).
Summary by CodeRabbit
repeat()
,poll()
, anddefer()
methods in the event loop testing suite.