-
-
Notifications
You must be signed in to change notification settings - Fork 56
Pj/task collision test #79
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
| - name: test platforms | ||
| #run: python3 ci/build_platform.py main_platforms | ||
| run: python3 ci/build_platform.py main_platforms esp32 esp8266 | ||
| run: python3 ci/build_platform.py main_platforms |
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.
main_platforms now support/check esp32 and esp8266.
| { | ||
| struct task * const t = static_cast<struct task * const>(task); | ||
|
|
||
| if (t) { |
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.
Sanitize inputs: t is never 0 now, and check t is in tasks[] bounds
|
I was concerned that this test would take a lot of time. It is not as bad as I thought.
|
| Timer<0x2, CLOCK::millis, Task *> timer; | ||
|
|
||
| assertEqual(timer.size(), 0UL); | ||
| assertEqual((unsigned long) timer.size(), 0UL); |
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 run my test on an Arduino Nano. I got an error because size_t is NOT unsigned long. This cast should make the test work on all platforms.
|
Looks good - can we consolidate the commits into fewer, more concise chunks? |
I will see what I can do. Part of the reason for the smaller commits is that I usually write code using a Windows computer, so it is more difficult to test how the EpoxyDuino platform will behave without trying it out with the GitHub Action -- I had to use a commit to test remotely. BUT I can squash these changes to another branch before setting up a pull request for you to review. |
see if redundant task IDs allocated see if NULL task ID created see if a double cancel() kills another task makefile rule for timerMultiCancelTest EpoxyDuino doesn't support serial print HEX.
cancel() returns success only if it removed a task check cancel with stale pointer fails cancelling a removed task should fail add range check for cancel() arg
63c4d30 to
a4c075b
Compare
|
I consolidated the PR into 4 commits total (rebased to 3 commits, plus a new commit for your parenthesis suggestion). This is the first time I have used |
I decided to create a pull request for my regression test of timer ID collisions, cancel() etc.
... and, I think I discovered a regression.
Now that
timer.cancel(anId)returns abool, AND timers no longer use a counter to randomize Task values, timer.cancel() will always find a Task to cancel, even if it is an empty task.So...
timer.cancel(anId)always returnstrue... even if anId is cancelled twice in a row.