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 dawagner commented Jan 6, 2016

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.

  

@dawagner dawagner force-pushed the xmlgeneration-check-conflicting-elements branch from 74ca17a to 37f085b Compare January 8, 2016 09:52
@dawagner dawagner changed the title Xmlgeneration check conflicting elements [review] Xml generation: check conflicting elements Jan 8, 2016
@dawagner
Copy link
Contributor Author

dawagner commented Jan 8, 2016

@krocard please review.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@krocard
Copy link
Contributor

krocard commented Jan 8, 2016

👎

@dawagner dawagner force-pushed the xmlgeneration-check-conflicting-elements branch 2 times, most recently from b9546ba to fab7ae8 Compare January 11, 2016 17:05
@dawagner dawagner mentioned this pull request Jan 11, 2016
1 task
@tcahuzax
Copy link
Contributor

👎

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>
@dawagner dawagner force-pushed the xmlgeneration-check-conflicting-elements branch from fab7ae8 to 576f444 Compare January 12, 2016 12:55
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 2 long

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

krocard added a commit that referenced this pull request Jan 12, 2016
…-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.
@krocard krocard merged commit 7ab5e95 into intel:master Jan 12, 2016
@krocard krocard changed the title [review] Xml generation: check conflicting elements Xml generation: check conflicting elements Jan 12, 2016
@dawagner dawagner deleted the xmlgeneration-check-conflicting-elements branch January 12, 2016 14:54
@krocard
Copy link
Contributor

krocard commented Jan 12, 2016

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants