-
Notifications
You must be signed in to change notification settings - Fork 68
Xml generation: check conflicting elements #329
Xml generation: check conflicting elements #329
Conversation
74ca17a to
37f085b
Compare
|
@krocard please review. |
test/xml-generator/test.py
Outdated
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.
- deep copy ?
- Would it not be better to have nominal_pfconfig a NON static variable to avoid all those copy.
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.
|
👎 |
b9546ba to
fab7ae8
Compare
|
👎 |
There was only one user of this method and it was better off using split(). This simplifies the tokenizer. Signed-off-by: David Wagner <david.wagner@intel.com>
- Use C++11's initializer lists. - Use catch's "THEN" clauses to describe the expected behaviour more accurately. Signed-off-by: David Wagner <david.wagner@intel.com>
The tokenizer was ignoring leading and trailing delimiters and also considering multiple consecutive delimiters as one. This behaviour made it behave similarly to a shell tokenizer but made it impossible to produce empty tokens. Another, optional, behaviour is introduced that will produce no token if the string is empty or N+1 tokens if there are N delimiters. Signed-off-by: David Wagner <david.wagner@intel.com>
The domain generator was using the "merge delimiters" behaviour of the tokenizer which made it impossible to have empty tokens; e.g.: - empty rules; - empty config/domain names (even though this is forbidden, this is not for the generator to decide); - empty string parameter value; - ... It now uses the new "don't merge delimiters" behaviour. Signed-off-by: David Wagner <david.wagner@intel.com>
Signed-off-by: David Wagner <david.wagner@intel.com>
They don't make much sense and make it harder to be parsed. Even though user-oriented output is not meant to be parsed, it is very common to have user-oriented output be more or less machine-friendly. It actually is the case of the Parameter Framework's remote commands, except for these leading newlines. Signed-off-by: David Wagner <david.wagner@intel.com>
Conflicting elements are elements belonging to more than one domain. The behaviour in such a case is unspecified. In the context of XML generation from user input, this denotes a mistake from the user. We now warn him and fail the generation. This commit includes testing. Signed-off-by: David Wagner <david.wagner@intel.com>
A criteria cannot have duplicated allowed values. When the user provides such a criterion, the generation should fail. Signed-off-by: David Wagner <david.wagner@intel.com>
fab7ae8 to
576f444
Compare
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.
line 2 long
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.
nope: it is 98 chars long.
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.
👍
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.
…-elements Xml generation: check conflicting elements Conflicting elements are elements belonging to more than one domain. The behaviour in such a case is unspecified. In the context of XML generation from user input, this denotes a mistake from the user. We now warn him and fail the generation.
Conflicting elements are elements belonging to more than one domain. The behaviour in such a case is unspecified.
In the context of XML generation from user input, this denotes a mistake from the user. We now warn him and fail the generation.
