-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Test set for LowPowerTicker class #5047
Conversation
#define TICKER_COUNT 16 | ||
|
||
Semaphore ticker_callback_sem(0, 1); | ||
bool ticker_callback_flag; |
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.
assume this is also candidate for volatile
?
TestTicker ticker[TICKER_COUNT]; | ||
|
||
multi_counter = 0; | ||
for(int i = 0; i < TICKER_COUNT; i++) { |
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.
a nit: for (
space there
ticker[i].detach(); | ||
} | ||
|
||
//TEST_ASSERT_EQUAL(TICKER_COUNT, multi_counter); |
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.
no dead code
Case("Test multi ticker", test_multi_ticker), | ||
}; | ||
|
||
utest::v1::status_t greentea_test_setup(const size_t number_of_cases) { |
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.
{
new line for function body
|
||
using namespace utest::v1; | ||
|
||
#define TestTicker LowPowerTicker |
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 don't like that, it's confusing. Is there a particular reason you are doing that?
} | ||
|
||
|
||
/** Test many tickers run simultaneously |
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.
This test case does something else than described here.
|
||
/** Test multi callback time | ||
|
||
Given an Ticker |
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.
just a nit: a Ticker
|
||
Given an Ticker | ||
When schedule callback | ||
Then ticker properly execute callback multiple time |
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.
time -> times
/** Test multi callback time | ||
|
||
Given an Ticker | ||
When schedule callback |
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.
It's not only once it's scheduled: When the callback is attached multiple times
/** Test if detach cancel scheduled callback event | ||
|
||
Given an Ticker with scheduled callback | ||
When schedule is cancelled |
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.
schedule is not really something that exists in Ticker terms, I know what you mean, but we could use something like:
Given a Ticker with callback attached
When the callback is detached
Then the callback is not being called
Also your test does more than described here.
|
||
/** Test single callback time via attach | ||
|
||
Given an Ticker |
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 should be rewritten, some examples in previous tests.
ticker.detach(); | ||
int time_diff = timer.read_us(); | ||
|
||
printf("TOLERANCE: %d\n", (uint32_t)TOLERANCE); |
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.
Lets not print anything if not needed.
|
||
/** Test single callback time via attach_us | ||
|
||
Given an Ticker |
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.
Could you rewrite this, examples in previous tests.
ticker.detach(); | ||
int time_diff = timer.read_us(); | ||
|
||
printf("TOLERANCE: %d\n", (uint32_t)TOLERANCE); |
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.
Lets not print if we don't have to.
228cf1a
to
92bca03
Compare
@theotherjimmy @studavekar To be aware, I found travis failing for some recent PR, with InsecurePlatformWarning. I restarted it here, please have a look once finished if it is still there. Has anything chagned again, or new module update somewhere causing this? |
Why is this being tested at the driver layer rather than the HAL layer? The HAL specification will require test cases that will make these redundant. |
I think that should be done on both layers, drivers and HAL (when we finish drafting the new specification). |
92bca03
to
459a801
Compare
459a801
to
bafe50e
Compare
@maciejbocianski @bulislaw What's the status of this PR? |
@theotherjimmy @bulislaw |
Is this the only failure that we should expect. This means this is waiting for the fix. cc @mmahadevan108 for visibility (already tagged in the issue) |
Yes, it was the only failure from tested pool k64f, nrf51_dk, nucleo_f070rb, nucleo_f429zi, |
bafe50e
to
cfc5121
Compare
Build : FAILUREBuild number : 113 |
cfc5121
to
9fb4fd0
Compare
Build : SUCCESSBuild number : 122 Triggering tests/test mbed-os |
K64F should be fixed via #5347 , what about the rest? |
@maciejbocianski what's the status here? |
I think it's ready and waiting for morph, |
/morph build |
Build : SUCCESSBuild number : 359 Triggering tests/morph test |
Build : SUCCESSBuild number : 361 Triggering tests/morph test |
/morph test |
Test : SUCCESSBuild number : 179 |
Description
New test suite for LowPowerTicker class
Status
READY
##Blocked
#5185 fixedy by #5347 (merged)
#5150 fixedy by #5347 (merged)