Skip to content

Conversation

@SeppoTakalo
Copy link
Contributor

Description

Summary of change

GoogleTest allows you to check whether certain function throws errors.
For example:

mbed_assert_throw_errors=true;
ASSERT_ANY_THROW(mbed::HeapBlockDevice one(3050, 100));

or

mbed_assert_throw_errors=true;
ASSERT_NO_THROW(bd.init());

As MBED_ERROR is now only function that can throw errors, there is
no need to check the type of thrown object.

Documentation


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@AnttiKauppila


Release Notes

Summary of changes

Impact of changes

Migration actions required

GoogleTest allows you to check whether certain function throws errors.
For example:
ASSERT_ANY_THROW(mbed::HeapBlockDevice one(3050, 100));
or
ASSERT_NO_THROW(bd.init());

As MBED_ERROR is now only function that can throw errors, there is
no need to check the type of thrown object.
@mbed-ci
Copy link

mbed-ci commented Nov 22, 2019

Test run: SUCCESS

Summary: 1 of 1 test jobs passed
Build number : 1
Build artifacts

@mbed-ci
Copy link

mbed-ci commented Nov 22, 2019

Test run: SUCCESS

Summary: 1 of 1 test jobs passed
Build number : 2
Build artifacts

@ciarmcom ciarmcom requested review from a team and AnttiKauppila November 22, 2019 12:00
@ciarmcom
Copy link
Member

@SeppoTakalo, thank you for your changes.
@AnttiKauppila @ARMmbed/mbed-os-core @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-wan @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 25, 2019

Please review.

I've noticed this one is in #11918 that shall go to 5.15 (in that case, this should be reviewed now).

@SeppoTakalo
Copy link
Contributor Author

Reviewed and CI passed.

Should be good to go.

@0xc0170 0xc0170 merged commit 7fbe0c6 into ARMmbed:master Nov 25, 2019
@SeppoTakalo SeppoTakalo deleted the assert_throw branch November 25, 2019 12:12
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.

5 participants