Skip to content

issue #305, Resolve cppcheck warning ut_stubs#306

Merged
skliper merged 1 commit intonasa:merge-20191230from
avan989:cpp_check_12_11_2019
Dec 30, 2019
Merged

issue #305, Resolve cppcheck warning ut_stubs#306
skliper merged 1 commit intonasa:merge-20191230from
avan989:cpp_check_12_11_2019

Conversation

@avan989
Copy link
Contributor

@avan989 avan989 commented Dec 11, 2019

Describe the contribution
resolve cppcheck warning.

Testing performed
Steps taken to test the contribution:

  1. make ENABLE_UNIT_TESTS=TRUE SIMULATION=native prep
  2. make
  3. make install
  4. make test
  5. Verify passing unit-test
  6. cppcheck --force --inline-suppr --std=c99 --language=c --error-exitcode=1 enable=warning,performance,portability,style --suppress=variableScope --inconclusive osal/src 2>osal.txt

System(s) tested on:

  • Hardware
  • OS: Ubuntu 18.04
  • osal 5.03

Contributor Info
Anh Van, NASA Goddard

Copy link
Contributor

@jphickey jphickey left a comment

Choose a reason for hiding this comment

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

Just request one minor change to remove the unused counter where noted.

id = i;
UT_FIXUP_ID(id, UT_OBJTYPE_QUEUE);
UtAssert_Failed("UT_Queue %d left open. ID=%x\n", (int)i, (unsigned int)id);
++InUse;
Copy link
Contributor

Choose a reason for hiding this comment

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

Recommend just removing the InUse counter here. This was probably a remnant from a previous code structure that printed a single failure at the end of the loop, but then the assert was moved to show each ID that was left open. There isn't much value in just printing an increment counter.

@avan989
Copy link
Contributor Author

avan989 commented Dec 11, 2019

updated.

Copy link
Contributor

@jphickey jphickey left a comment

Choose a reason for hiding this comment

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

Looks good now

@skliper skliper added the CCB:Approved Indicates code review and approval by community CCB label Dec 18, 2019
@skliper skliper added this to the 5.1.0 milestone Dec 18, 2019
@skliper
Copy link
Contributor

skliper commented Dec 18, 2019

CCB 20191218 - Reviewed and approved for IC

@skliper skliper changed the base branch from master to merge-20191230 December 30, 2019 21:07
@skliper skliper merged commit 40c574f into nasa:merge-20191230 Dec 30, 2019
skliper pushed a commit that referenced this pull request Dec 30, 2019
Fix #295, #298, #305, #307, #308,
    #313, #314, #316, #321, #323
Reviewed and approved at 2019-12-18 CCB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CCB:Approved Indicates code review and approval by community CCB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants