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

Iox #842 cleanup memory provider and memory block #843

Conversation

elBoberido
Copy link
Member

@elBoberido elBoberido commented Jun 9, 2021

Pre-Review Checklist for the PR Author

  1. Code follows the coding style of CONTRIBUTING.md
  2. Tests follow the best practice for testing
  3. Branch follows the naming format (iox-#123-this-is-a-branch)
  4. Commits messages are according to this guideline
    • Commit messages have the issue ID (iox-#123 commit text)
    • Commit messages are signed (git commit -s)
    • Commit author matches Eclipse Contributor Agreement (and ECA is signed)
  5. Update the PR title
    • Follow the same conventions as for commit messages
    • Link to the relevant issue
  6. Relevant issues are linked
  7. Add sensible notes for the reviewer
  8. All checks have passed (except task-list-completed)
  9. Assign PR to reviewer

Notes for Reviewer

This fixes some of the requests from #840

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Code according to our coding style and naming conventions
  • Unit tests have been written for new behavior
  • Public API changes are documented via doxygen
  • Copyright owner are updated in the changed files
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

@elBoberido elBoberido added the technical debt unclean code and design flaws label Jun 9, 2021
@elBoberido elBoberido self-assigned this Jun 9, 2021
@codecov
Copy link

codecov bot commented Jun 9, 2021

Codecov Report

Merging #843 (cf147f5) into master (ea6ea66) will increase coverage by 0.04%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #843      +/-   ##
==========================================
+ Coverage   75.01%   75.05%   +0.04%     
==========================================
  Files         328      332       +4     
  Lines       11705    11864     +159     
  Branches     1965     2001      +36     
==========================================
+ Hits         8780     8905     +125     
- Misses       2165     2191      +26     
- Partials      760      768       +8     
Flag Coverage Δ
unittests 73.92% <83.33%> (+0.06%) ⬆️
unittests_timing 30.56% <83.33%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...h/internal/roudi/memory/port_pool_memory_block.hpp 100.00% <ø> (ø)
...iceoryx_posh/roudi/memory/generic_memory_block.hpp 100.00% <ø> (ø)
...lude/iceoryx_posh/roudi/memory/memory_provider.hpp 100.00% <ø> (ø)
iceoryx_posh/source/roudi/memory/memory_block.cpp 66.66% <0.00%> (ø)
...include/iceoryx_posh/roudi/memory/memory_block.hpp 100.00% <100.00%> (ø)
...eoryx_posh/source/roudi/memory/memory_provider.cpp 94.25% <100.00%> (ø)
...e/roudi/memory/mempool_collection_memory_block.cpp 100.00% <100.00%> (ø)
...di/memory/mempool_segment_manager_memory_block.cpp 100.00% <100.00%> (ø)
...osh/source/roudi/memory/port_pool_memory_block.cpp 92.85% <100.00%> (ø)
...fs/internal/posix_wrapper/shared_memory_object.hpp 66.66% <0.00%> (-33.34%) ⬇️
... and 18 more

Copy link
Contributor

@mossmaurice mossmaurice left a comment

Choose a reason for hiding this comment

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

Please double check all the copyright headers, otherwise LGTM.

In general, should there be death tests added for methods that use not_null?

@elBoberido
Copy link
Member Author

Regarding the death test for not_null. In this specific case it's not really possible since it's a protected method and on the caller side this is only called if it's not a nullptr. I would have used a reference, but that's not possible with a void.

In general I also wouldn't do death tests for parameter with not_null since we also don't do death tests for methods with references as parameter and you could easily have something like this

int foo (int& i) {
    return i;
}
int bar(int* i) {
    return foo(*i);
}
int main() {
    return bar(nullptr); // crash will happen on `return i;` not `return foo(*i);`
}

As long as we already tested that not_null itself terminates, it is not necessary to test it again everywhere else it is used.

@elBoberido elBoberido requested a review from mossmaurice June 11, 2021 11:28
@elBoberido elBoberido requested a review from dkroenke June 11, 2021 12:34
mossmaurice
mossmaurice previously approved these changes Jun 12, 2021
@elBoberido elBoberido merged commit 0a87c0e into eclipse-iceoryx:master Jun 14, 2021
@elBoberido elBoberido deleted the iox-#842-cleanup-MemoryProvider-and-MemoryBlock branch June 14, 2021 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical debt unclean code and design flaws
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup MemoryProvider and MemoryBlock
3 participants