-
Notifications
You must be signed in to change notification settings - Fork 79
Add missing functions for timer #1108
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
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.
Pull Request Overview
This PR adds missing timer functions and corresponding tests to supplement the timer API.
- Added tests in test-timer.js for timerPeriod, changeTimerPeriod, and callTimerWithInfo.
- Extended native bindings in src/rcl_timer_bindings.cpp to support new timer functions.
- Updated the Timer class in lib/timer.js to expose changeTimerPeriod, timerPeriod getter, and callTimerWithInfo methods.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/test-timer.js | Introduces tests for the new timer functions to verify their behavior. |
| src/rcl_timer_bindings.cpp | Implements the native bindings for changing and retrieving timer period and call info. |
| lib/timer.js | Exposes newly added timer functions through the Timer class API. |
Comments suppressed due to low confidence (1)
src/rcl_timer_bindings.cpp:209
- The property name 'expectetCallTime' is misspelled; consider renaming it to 'expectedCallTime' for clarity and consistency.
timer_info.Set("expectetCallTime", Napi::BigInt::New(env, call_info.expected_call_time));
test/test-timer.js
Outdated
| it('timer.callTimerWithInfo', function (done) { | ||
| const timer = node.createTimer(BigInt('100000000'), () => {}); | ||
| const info = timer.callTimerWithInfo(); | ||
| assert.deepStrictEqual(typeof info.expectetCallTime, 'bigint'); |
Copilot
AI
Apr 30, 2025
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.
There is a spelling mistake in the property name 'expectetCallTime'; it should be 'expectedCallTime'.
| assert.deepStrictEqual(typeof info.expectetCallTime, 'bigint'); | |
| assert.deepStrictEqual(typeof info.expectedCallTime, 'bigint'); |
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.
Pull Request Overview
This PR adds missing timer functionalities and their corresponding unit tests. The key changes include:
- New unit tests for timer operations in test/test-timer.js.
- New timer binding functions in src/rcl_timer_bindings.cpp to support period retrieval, timer period change, and timer call information.
- New Timer class methods and getter in lib/timer.js to expose the newly added timer functionalities.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/test-timer.js | Added tests for timerPeriod, changeTimerPeriod, and callTimerWithInfo |
| src/rcl_timer_bindings.cpp | Added native bindings for timer period manipulation and info retrieval |
| lib/timer.js | Introduced Timer methods for period change, retrieval, and call with info |
This PR adds missing timer functionalities and their corresponding unit tests. The key changes include: - New unit tests for timer operations in test/test-timer.js. - New timer binding functions in src/rcl_timer_bindings.cpp to support period retrieval, timer period change, and timer call information. - New Timer class methods and getter in lib/timer.js to expose the newly added timer functionalities. Fix: #1109
This PR adds missing timer functionalities and their corresponding unit tests. The key changes include:
Fix: #1109