Skip to content

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

Merged
merged 1 commit into from
Sep 5, 2017

Conversation

maciejbocianski
Copy link
Contributor

@maciejbocianski maciejbocianski commented Aug 21, 2017

Description

New test suite for mail class

Status

READY

Requires

To pass Mail test following fix should be merged first: #4941

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 21, 2017

retest uvisor

3 similar comments
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 22, 2017

retest uvisor

@bulislaw
Copy link
Member

retest uvisor

@bulislaw
Copy link
Member

retest uvisor

@bulislaw
Copy link
Member

@mazimkhan the uvisor seem to be stuck

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 22, 2017

retest uvisor

{
Mail<uint32_t, 4> mail_box;

uint32_t start = us_ticker_read();
Copy link
Contributor

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

Copy link
Contributor Author

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)
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

const uint8_t id = mail->thread_id;

// verify thread id
result = result && (id == THREAD_1_ID);
Copy link
Member

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.

Copy link
Contributor Author

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) {
Copy link
Member

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)
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should be error

@maciejbocianski maciejbocianski force-pushed the mail_tests branch 3 times, most recently from 70c12f2 to dde0d55 Compare August 24, 2017 15:40
@maciejbocianski
Copy link
Contributor Author

some improvements added
@0xc0170
@bulislaw

Copy link
Member

@bulislaw bulislaw left a 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

@bulislaw
Copy link
Member

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1117

Build failed!

@maciejbocianski
Copy link
Contributor Author

@bulislaw can you check morph fail. Looks like some problem when building "startup_efm32wg.S"
...
[DEBUG] Return: -11
Failed to build library
...

@bulislaw
Copy link
Member

/morph test

@maciejbocianski
Copy link
Contributor Author

@bulislaw
morph seems to be hanged

Started by remote host 127.0.0.1
[Pipeline] node
Still waiting to schedule task
Waiting for next available executor on master

@bulislaw
Copy link
Member

You're in the queue, it'll take another couple of hours.

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1136

All builds and test passed!

#include "rtos.h"
#include "us_ticker_api.h"
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK typo

Copy link
Contributor Author

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

@studavekar
Copy link
Contributor

/morph test

@mbed-bot
Copy link

mbed-bot commented Sep 3, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1186

All builds and test passed!

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 4, 2017

@tommikas Can you please restart jenkis CI (there is no link here) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants