Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Conversation

dawagner
Copy link
Contributor



 

dawagner and others added 20 commits October 9, 2015 17:10
Signed-off-by: David Wagner <david.wagner@intel.com>
Travis/Coveralls: fix a syntax error preventing coveralls from running
asString was not returning it's result, leading to more
complicated usage.

Return the formated string instead of using an output parameter.

Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
When exporting an element's structure (via the C++ API or via the tuning
interface), a spurious "Name" attribute appears for EnumPair nodes, while
only "Literal" and "Numerical" attributes should be present. This is because
the XML import / export feature assummes the existence of a Name attribute
for all XML nodes. The Name default processing can however be skipped from the
toXml() methods by calling the base class' childrenToXml() method instead
of the toXml() one.

Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com>
This was a workaround of stlport issue.
No need anymore since stlport was dropped.

Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
This check was modified in a previous commit and was wrong since then. But it
is also rather useless as it only serves as returning early in case the
function is known to be a no-op.

Signed-off-by: David Wagner <david.wagner@intel.com>
Utility functions were not tested,
introduce unit tests for all functions in Utility.h.

Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Use `std::string::string(size_t, char)` to simplify the
construction of the help message.

Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Utility.h contain functions that were all part of
a CUtility class. Nevertheless this class had no invariant
nor asserting any invariant.

Thus this class was only used for its namespace aspect.

Use a real namespace instead.

Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Wrong XML "Name" attribute in enum value pairs
- asInteger can be replaced with convertTo
- asString can be replaced with std::to_string

Signed-off-by: David Wagner <david.wagner@intel.com>
The generic version was converting uint8 as it was a character
(uint8_t is an alias to unsigned char on most compiler).
Thus converting "1" would return 49 ie '1'.

As convertTo is thought as an _numerical_ conversion tool
(contrary to boost::lexical_cast for example),
forbid considering the input as a character and consider uint8_t
(aka unsigned char) as a number exclusively

Same for int8_t.

Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Signed-off-by: David Wagner <david.wagner@intel.com>
The error message is clearer than when triggering a generic compilation error.

Signed-off-by: David Wagner <david.wagner@intel.com>
Utility improvements:
 - asString now return the formated string leading to usage improvement
 - Fully unit test Utility.h
 - Simplify appendTitle implementation
 - CommandHandler: simplify the message formating
convertTo enhancements:
 - correctly handle uint8_t and int8_t (deserialize as numerics, not character)
 - display a nicer error message if conversion is not supported (static_assert)
 - remove workaround stlport bug, as it is no longer supported
Remove a useless and wrong check in makeEncodable
Remove useless utils static methods in SubsystemObject
Since we want the coverage report to show only the coverage of code that will
run in production, we don't want tests to artificially increase the coverage.

Signed-off-by: David Wagner <david.wagner@intel.com>
dawagner added a commit that referenced this pull request Oct 15, 2015
Merge 'master' into 'serialization_api'
@dawagner dawagner merged commit 5a25ce8 into serialization_api Oct 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants