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

Commit 719ae7c

Browse files
committed
EDD test: Add complex use case
Test: - sequenceAware domainGroups - empty confGroup - multiple confType with the same name - composant empty and nested - complex rules Signed-off-by: Kevin Rocard <[email protected]>
1 parent 459ef06 commit 719ae7c

File tree

4 files changed

+93
-2
lines changed

4 files changed

+93
-2
lines changed

test/xml-generator/PFConfig/structure.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<ParameterBlock Name="block" ArrayLength="5">
1515
<FixedPointParameter Name="q2.5" Size="8" Integral="2" Fractional="5"/>
1616
<IntegerParameter Name="uint8" Signed="false" Size="8"/>
17-
<StringParameter Name="string" MaxLength="20"/>
17+
<StringParameter Name="string" MaxLength="50"/>
1818
</ParameterBlock>
1919

2020
</InstanceDefinition>

test/xml-generator/test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ class TestCase(unittest.TestCase):
9696
os.path.join(basedir, "../../schemas"))
9797
nominal_vector = TestVector(os.path.join(vector_dir, "initialSettings.xml"),
9898
[os.path.join(vector_dir, "first.pfw"),
99-
os.path.join(vector_dir, "second.pfw")],
99+
os.path.join(vector_dir, "second.pfw"),
100+
os.path.join(vector_dir, "complex.pfw")],
100101
[os.path.join(vector_dir, "third.xml"),
101102
os.path.join(vector_dir, "fourth.xml")])
102103

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
domain: sequenceAware sequenceAware
2+
3+
domainGroup: Red sequenceAware
4+
Colors Includes Red
5+
confType: On
6+
ANY
7+
Switch Is On
8+
# Expecting a empty tree of all (except for the last `Switch Is On` rule)
9+
ALL
10+
ALL
11+
ALL
12+
ALL
13+
ANY
14+
Switch Is On
15+
confType: On
16+
Switch Is On
17+
18+
domain: Black
19+
Colors Includes Green
20+
confGroup: green.confGroup
21+
# Should add a `.` in the conf name
22+
# Ie an empty confGroup in a legal name
23+
confGroup:
24+
25+
confType: On
26+
Switch Is On
27+
28+
# confGroups with the same name should not overwrite one another
29+
confGroup: On
30+
Colors Includes Green
31+
32+
conf: Blue.dot
33+
Colors Includes Blue
34+
35+
component: /Test/test
36+
component: block/3
37+
q2.5 = 1.18750
38+
string = 12 ab @ <![CDATA[ < > \n \0 ✔ "'\
39+
component: included
40+
bool = 1

test/xml-generator/testVector/reference.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,54 @@
168168
</Configuration>
169169
</Settings>
170170
</ConfigurableDomain>
171+
<ConfigurableDomain Name="sequenceAware" SequenceAware="true">
172+
<Configurations/>
173+
<ConfigurableElements/>
174+
<Settings/>
175+
</ConfigurableDomain>
176+
<ConfigurableDomain Name="Red.Black" SequenceAware="true">
177+
<Configurations>
178+
<Configuration Name="green.confGroup..On.Blue.dot">
179+
<CompoundRule Type="All">
180+
<SelectionCriterionRule SelectionCriterion="Colors" MatchesWhen="Includes" Value="Red"/>
181+
<SelectionCriterionRule SelectionCriterion="Colors" MatchesWhen="Includes" Value="Green"/>
182+
<CompoundRule Type="Any">
183+
<SelectionCriterionRule SelectionCriterion="Switch" MatchesWhen="Is" Value="On"/>
184+
<CompoundRule Type="All">
185+
<CompoundRule Type="All">
186+
<CompoundRule Type="All"/>
187+
</CompoundRule>
188+
<CompoundRule Type="All">
189+
<CompoundRule Type="Any">
190+
<SelectionCriterionRule SelectionCriterion="Switch" MatchesWhen="Is" Value="On"/>
191+
</CompoundRule>
192+
</CompoundRule>
193+
</CompoundRule>
194+
</CompoundRule>
195+
<SelectionCriterionRule SelectionCriterion="Switch" MatchesWhen="Is" Value="On"/>
196+
<SelectionCriterionRule SelectionCriterion="Switch" MatchesWhen="Is" Value="On"/>
197+
<SelectionCriterionRule SelectionCriterion="Colors" MatchesWhen="Includes" Value="Green"/>
198+
<SelectionCriterionRule SelectionCriterion="Colors" MatchesWhen="Includes" Value="Blue"/>
199+
</CompoundRule>
200+
</Configuration>
201+
</Configurations>
202+
<ConfigurableElements>
203+
<ConfigurableElement Path="/Test/test/block/3/q2.5"/>
204+
<ConfigurableElement Path="/Test/test/block/3/string"/>
205+
<ConfigurableElement Path="/Test/test/included/bool"/>
206+
</ConfigurableElements>
207+
<Settings>
208+
<Configuration Name="green.confGroup..On.Blue.dot">
209+
<ConfigurableElement Path="/Test/test/block/3/q2.5">
210+
<FixedPointParameter Name="q2.5">1.18750</FixedPointParameter>
211+
</ConfigurableElement>
212+
<ConfigurableElement Path="/Test/test/block/3/string">
213+
<StringParameter Name="string">12 ab @ &lt;![CDATA[ &lt; &gt; \n \0 ✔ "'\</StringParameter>
214+
</ConfigurableElement>
215+
<ConfigurableElement Path="/Test/test/included/bool">
216+
<BooleanParameter Name="bool">1</BooleanParameter>
217+
</ConfigurableElement>
218+
</Configuration>
219+
</Settings>
220+
</ConfigurableDomain>
171221
</ConfigurableDomains>

0 commit comments

Comments
 (0)