-
Notifications
You must be signed in to change notification settings - Fork 3k
Disambiguate utest::v1 types and remove using statement #4071
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
Merged
theotherjimmy
merged 1 commit into
ARMmbed:mbed-os-workshop-17q2
from
mazimkhan:mbedtls-partner-workshop-17Q2
Apr 24, 2017
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 have moved this statement to line 41, instead of removing it, after all the header file includes. In this way, this specific .c file would still be using the namespace, but it won't affect all the header files.
The issue was that this statement was before the header files
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.
It is not a good idea to use the
using
statement as in future the test case might want to use the otherstatus_t
type. And it would be ambiguous.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 understand your point, but in our specific case, status_t was platform specific, so there won't be a use for an other
status_t
. My main concern is that if new tests will be introduced, one should also add the namsepcae prefix.My comment wasn't a request for change, it was more of an obeservation
Uh oh!
There was an error while loading. Please reload this page.
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.
If the other
status_t
was also in a namespace then usingusing
on one might be ok.using namespace utest::v1
statement may not be a problem now but can be in future. Hence a maintenance thing.Secondly, I didn't have partner code to verify the impact of moving the
using
. Hence I went for a more robust approach.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'm fine with your approach, I only add a statement that future functions\types should also include the
utest::v1
prefix.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 also discovered that
status_t
is also defined in couple of targets and through some include path already available in the test case.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.
Yes sure I agree.