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-#1613 Remove EXPECT_DEATH #2019

Merged

Conversation

elBoberido
Copy link
Member

@elBoberido elBoberido commented Sep 5, 2023

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. Changelog updated in the unreleased section including API breaking changes
  4. Branch follows the naming format (iox-123-this-is-a-branch)
  5. Commits messages are according to this guideline
  6. Update the PR title
    • Follow the same conventions as for commit messages
    • Link to the relevant issue
  7. Relevant issues are linked
  8. Add sensible notes for the reviewer
  9. All checks have passed (except task-list-completed)
  10. All touched (C/C++) source code files from iceoryx_hoofs are added to ./clang-tidy-diff-scans.txt
  11. Assign PR to reviewer

Notes for Reviewer

This PR replaces the last remaining EXPECT_DEATH with IOX_EXPECT_FATAL_FAILURE where feasible. There are a few remaining occurrences which cannot be replaced, e.g. tests for PoshRuntime which has a singleton. These tests now use GTEST_FLAG(death_test_style) = "threadsafe"; to prevent stucking threads.

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
  • All touched (C/C++) source code files from iceoryx_hoofs have been added to ./clang-tidy-diff-scans.txt
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

@@ -62,7 +62,8 @@ MemPool::MemPool(const greater_or_equal<uint32_t, CHUNK_MEMORY_ALIGNMENT> chunkS
else
{
IOX_LOG(FATAL) << "Chunk size must be multiple of '" << CHUNK_MEMORY_ALIGNMENT << "'! Requested size is "
<< chunkSize << " for " << numberOfChunks << " chunks!";
<< static_cast<uint32_t>(chunkSize) << " for " << static_cast<uint32_t>(numberOfChunks)
Copy link
Member Author

Choose a reason for hiding this comment

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

I just discovered that the logger currently does not invoke implicit conversion of greater_or_equal<T> to T correctly due to SFINEA on LogStream& operator<<(const T value) for arithmetic typs. LogStream& operator<<(const bool value) does not have SFINEA so greater_or_equal<uint32> gets implicitly converted into bool. I guess we should replace the SFINEA implementation for arithmetic types with explicit methods.

Copy link
Contributor

Choose a reason for hiding this comment

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

@elBoberido Can you please open an issue for this?

Copy link
Member Author

@elBoberido elBoberido Sep 6, 2023

Choose a reason for hiding this comment

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

@FerdinandSpitzschnueffler I added a task to #1755

@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Merging #2019 (5aae57e) into master (e70767a) will increase coverage by 0.08%.
Report is 10 commits behind head on master.
The diff coverage is 64.73%.

❗ Current head 5aae57e differs from pull request most recent head 4ea848e. Consider uploading reports for the commit 4ea848e to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2019      +/-   ##
==========================================
+ Coverage   74.17%   74.26%   +0.08%     
==========================================
  Files         415      413       -2     
  Lines       16102    16055      -47     
  Branches     2254     2246       -8     
==========================================
- Hits        11944    11923      -21     
+ Misses       3435     3411      -24     
+ Partials      723      721       -2     
Flag Coverage Δ
unittests 74.05% <64.73%> (+0.08%) ⬆️
unittests_timing 15.25% <27.80%> (+0.34%) ⬆️

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

Files Changed Coverage Δ
...include/iceoryx_dust/internal/cxx/forward_list.inl 0.00% <0.00%> (ø)
...ude/iceoryx_hoofs/internal/posix_wrapper/mutex.hpp 100.00% <ø> (ø)
iceoryx_hoofs/source/posix_wrapper/mutex.cpp 41.35% <ø> (-4.18%) ⬇️
.../posix_wrapper/shared_memory_object/memory_map.cpp 30.18% <ø> (+0.55%) ⬆️
...ude/iceoryx_posh/internal/mepoo/shared_pointer.hpp 100.00% <ø> (ø)
...ude/iceoryx_posh/internal/mepoo/typed_mem_pool.inl 82.85% <ø> (ø)
...ceoryx_dust/source/posix_wrapper/message_queue.cpp 61.90% <28.57%> (-1.37%) ⬇️
iceoryx_dust/source/posix_wrapper/named_pipe.cpp 49.43% <57.97%> (+0.40%) ⬆️
..._hoofs/source/posix_wrapper/unix_domain_socket.cpp 59.75% <63.10%> (+1.00%) ⬆️
...ude/iceoryx_posh/internal/mepoo/shared_pointer.inl 90.00% <71.42%> (+1.90%) ⬆️
... and 8 more

... and 2 files with indirect coverage changes

@elBoberido elBoberido self-assigned this Sep 5, 2023
@elBoberido elBoberido added bugfix Solves a bug technical debt unclean code and design flaws labels Sep 5, 2023
@elBoberido elBoberido force-pushed the iox-1613-remove-expect-death branch from 5aae57e to 4ea848e Compare September 5, 2023 14:35
@elBoberido elBoberido marked this pull request as ready for review September 5, 2023 14:35
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.

LGTM, thanks for the PR! If you create the follow-up issue for the SFINAE thingy we can merge this.

@elBoberido
Copy link
Member Author

@mossmaurice I added a task to #1755

@elBoberido elBoberido merged commit c5d1340 into eclipse-iceoryx:master Sep 6, 2023
16 checks passed
@elBoberido elBoberido deleted the iox-1613-remove-expect-death branch September 6, 2023 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Solves a bug technical debt unclean code and design flaws
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove EXPECT_DEATH MacOS tests that use EXPECT_DEATH stuck
4 participants