-
Notifications
You must be signed in to change notification settings - Fork 388
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 #408 rename publisher and subscriber #561
Iox #408 rename publisher and subscriber #561
Conversation
… typed and untyped variant Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
…criber` Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
…typed and untyped variant Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
…sher` Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
2b8c192
to
c68ebbb
Compare
// anonymous namespace to prevent linker issues or sanitizer false positives | ||
// if a struct with the same name is used in other tests | ||
namespace | ||
{ | ||
struct DummyData | ||
{ | ||
uint64_t val = 42; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
struct DummyData | ||
{ | ||
DummyData() = default; | ||
int val = 42; | ||
uint32_t val = 42; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐙 <- @dkroenke
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw. that was the reason for the address sanitizer issue. There were 4 structs with the same name, three with uint64_t and one with int all in the same binary. Somehow the address sanitizer mixed them up.
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
c68ebbb
to
5ae8fd4
Compare
@@ -31,10 +31,15 @@ | |||
using namespace ::testing; | |||
using ::testing::_; | |||
|
|||
// anonymous namespace to prevent linker issues or sanitizer false positives |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was aware of this and always have all my tests in a local anonymous namespace. This should be in the test recommendation file as well, if if is not already mentioned there.
Avoid weird linker issues, some of them seemingly silent...
struct DummyData | ||
{ | ||
uint64_t val = 42; | ||
}; | ||
} // namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would extend this to the test fixture or even the tests themselves. Test fixture names can also cause conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in #563
I would recommend adding or extending anonymous namespaces to all tests in a separate PR to avoid future linker/address sanitizer issues. The should cover all definitions in the corresponding test_xyz.cpp file. |
Pre-Review Checklist for the PR Author
iox-#123-this-is-a-branch
)iox-#123 commit text
)git commit -s
)task-list-completed
)Notes for Reviewer
This PR renames the the
TypedPublisher
andTypedSubscriber
to justPublisher
andSubscriber
as decided in #408. Renaming the untyped API will be done in a separate PR if it is still desired.The
typed_publisher.hpp
andtyped_subscirber.hpp
were renamed withgit mv
but since there was already apublisher.hpp
andsubscriber.hpp
git assumes those old files where changed.Checklist for the PR Reviewer
Post-review Checklist for the PR Author
Post-review Checklist for the Eclipse Committer
References