-
Notifications
You must be signed in to change notification settings - Fork 3k
Extends test set for Mail class #4945
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
retest uvisor |
3 similar comments
retest uvisor |
retest uvisor |
retest uvisor |
@mazimkhan the uvisor seem to be stuck |
retest uvisor |
{ | ||
Mail<uint32_t, 4> mail_box; | ||
|
||
uint32_t start = us_ticker_read(); |
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.
Please use C++ API - there are tickers/timers etc, instead of using directly HAL
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.
done
When allocate/put/get/free memory block | ||
Then all operations should succeed | ||
*/ | ||
void test_uint32(void) |
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.
Can this duplication be avoided (template for instance) ? for uint_t 8,16,32 ?
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.
done
487887b
to
54bf5e1
Compare
const uint8_t id = mail->thread_id; | ||
|
||
// verify thread id | ||
result = result && (id == THREAD_1_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.
Can we assert these here? So if it fails we know what actually went wrong.
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.
done
mail_box.free(mail); | ||
|
||
if (result == false || ++result_counter == QUEUE_SIZE) { |
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 we have assert here?
When call @a get it returns previously put mails | ||
Then mails should be in the same order as put | ||
*/ | ||
void test_order(void) |
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.
Aren't we testing order in some other test?
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 is the only place where we test order intentionally
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.
+/** Test single thread Mail usage
+
+ Given mailbox and one additional thread
+ When messages are put in to the Mail box by this thread
+ Then messages are received in main thread in the same order as was sent and the data sent is valid
You're asserting the order here as well.
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.
done
uint32_t *mail3 = mail_box.alloc(); | ||
TEST_ASSERT_NOT_EQUAL(NULL, mail3); | ||
|
||
// 4 KO |
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 -> OK
uint32_t *mail4 = mail_box.alloc(); | ||
TEST_ASSERT_NOT_EQUAL(NULL, mail4); | ||
|
||
// 5 KO |
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 error
70c12f2
to
dde0d55
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.
@0xc0170 can you have a look
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
@bulislaw can you check morph fail. Looks like some problem when building "startup_efm32wg.S" |
/morph test |
@bulislaw
|
You're in the queue, it'll take another couple of hours. |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
#include "rtos.h" | ||
#include "us_ticker_api.h" |
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.
us ticker - not used anywhere?
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.
removed
uint32_t *mail4 = mail_box.alloc(); | ||
TEST_ASSERT_NOT_EQUAL(NULL, mail4); | ||
|
||
// 5 KO |
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.
OK typo
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.
fifth should fail so "KO" is ok
dde0d55
to
ae0b90f
Compare
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
@tommikas Can you please restart jenkis CI (there is no link here) ? |
Description
New test suite for mail class
Status
READY
Requires
To pass Mail test following fix should be merged first: #4941