Skip to content
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

Replace TEST_ASSERT_INT_WITHIN usage in netsocket tests #11289

Merged
merged 1 commit into from Aug 23, 2019

Conversation

@michalpasztamobica
Copy link
Contributor

commented Aug 22, 2019

Description

IPCore's netsocket tests are expected to run all tests even if some of them fail. The TEST_ASSERT_INT_WITHIN macro sets a global variable Unity.CurrentTestFailed which prevents further checks and gives incorrect results and failure count. Other assertion macros in Unity do not do that.

We've considered updating the Unity test code, but other modules also use this macro and it's hard to judge whether they rely on the macro's behavior or not.

The latest version of Unity does not allow the test suite to run after the first assertion triggers.

Fixes #10941.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[x] Test update
[ ] Breaking change

Reviewers

@SeppoTakalo
@VVESTM
@jeromecoutant
@VeijoPesonen

IPCore's netsocket tests are expected to run all tests even if some of them fail. The TEST_ASSERT_INT_WITHIN macro sets a global variable Unity.CurrentTestFailed which prevents further checks and gives incorrect failure count. Other assertion macros in Unity do not do that.
@ciarmcom ciarmcom requested review from SeppoTakalo, VeijoPesonen and ARMmbed/mbed-os-maintainers Aug 22, 2019
@ciarmcom

This comment has been minimized.

Copy link
Member

commented Aug 22, 2019

@VVESTM

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

Tested OK on my side.
It may need a comment in unity.h to warn user in case he wants to use TEST_ASSERT_INT_WITHIN.

@VVESTM
VVESTM approved these changes Aug 23, 2019
@0xc0170 0xc0170 added needs: CI and removed needs: review labels Aug 23, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

commented Aug 23, 2019

CI started

@mbed-ci

This comment has been minimized.

Copy link

commented Aug 23, 2019

Test run: SUCCESS

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

@0xc0170 0xc0170 merged commit f1a8eec into ARMmbed:master Aug 23, 2019
18 checks passed
18 checks passed
continuous-integration/jenkins/pr-head This commit looks good
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/greentea-test Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8666 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8464B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details
@michalpasztamobica michalpasztamobica deleted the michalpasztamobica:unity_replace_macro branch Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.