This repository was archived by the owner on Aug 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Templatize IntegerParameterType #376
Merged
Merged
Conversation
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
Remove convertValueFromString and replace it with converTo. Signed-off-by: David Wagner <david.wagner@intel.com>
Current coverage is 72.29% (diff: 74.82%)@@ master #376 diff @@
==========================================
Files 211 214 +3
Lines 6683 6674 -9
Methods 1438 1447 +9
Messages 0 0
Branches 857 845 -12
==========================================
+ Hits 4814 4825 +11
+ Misses 1397 1382 -15
+ Partials 472 467 -5
|
This simplifies some methods that used to contain if/else branches over the signedess. It also simplifies how different sizes are handled (gets rid of some bit-level tricks). As a result, it isn't possible anymore to set illegal Min/Max attributes. Signed-off-by: David Wagner <david@marvid.fr>
9cf536a
to
cba27ea
Compare
sguiriec
suggested changes
Oct 7, 2016
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.
Should add Min > Max error. Otherwise it is OK
@sguiriec yes, that's expected (cf. the commit message) - I intended to validate the first fix first. I'll send an additional patch for this soon. |
1ab294b
to
7a1d56c
Compare
sguiriec
reviewed
Oct 18, 2016
utility/PfError.hpp
Outdated
@@ -0,0 +1,37 @@ | |||
/* | |||
* Copyright (c) 2015, Intel Corporation |
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 guess should be 2016
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.
indeed
And catch the exception in CElement::fromXml. Signed-off-by: David Wagner <david.wagner@intel.com>
Otherwise, error out and inform the user that the range of allowed values is empty. Signed-off-by: David Wagner <david.wagner@intel.com>
Tests that Min and Max boudaries are correctly checked. Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com> Signed-off-by: David Wagner <david.wagner@intel.com>
7a1d56c
to
9199e04
Compare
4 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Make IntegerParameterType template over the size and signedness - simplifies the implementation and makes the code more robust.

min > max
error, which can be easily fixed afterward).