amiq-consulting / fc4sc

A header only C++11 library for functional coverage
Apache License 2.0
36 stars 15 forks source link

Expressions in Coverage XML files are not escaped #13

Closed nrother closed 5 years ago

nrother commented 5 years ago

The following coverpoint will cause an invalid XML file to be created:

COVERPOINT(int, result_cvp, opA & opB) {
    bin<int>("zero", 0),
    bin<int>("not_zero", interval(1,INT_MAX))
};

This is a snipped from the XML file:

<ucis:coverpoint name="result_cvp" key="KEY" exprString="opA & opB">
<ucis:options weight="1" goal="100" comment="" at_least="1" auto_bin_max="10" detect_overlap="0" />
<ucis:coverpointBin name="zero" 
type="default" alias="0">
<ucis:range 
from="0" 
to ="0"
>
<ucis:contents coverageCount="0"></ucis:contents>
</ucis:range>

Please note the invalid usage of a unescaped ampersand.

nrother commented 5 years ago

Unfortunately, not even resorting to C++ digraphs helps :frowning_face:

COVERPOINT(int, result_cvp, opA bitand opB) {
amiq-consulting commented 5 years ago

Hi nrother,

Thank you for posting this issue. I have fixed the problem in commit https://github.com/amiq-consulting/fc4sc/commit/e38090e88b79e13affbdc257040f43cda9456856. I have tested it with your example and it should now be working.

Best Regards.