On 10/27/2011 03:07 PM, Stefan Berger wrote:
This patch adds test cases for parsing of parameters with
multiple occurrances of the same name.
Signed-off-by: Stefan Berger<stefanb(a)linux.vnet.ibm.com>
---
tests/nwfilterxml2xmlin/attr-value-test.xml | 23 +++++++++++++++++++++++
tests/nwfilterxml2xmlout/attr-value-test.xml | 18 ++++++++++++++++++
tests/nwfilterxml2xmltest.c | 2 ++
3 files changed, 43 insertions(+)
Index: libvirt-acl/tests/nwfilterxml2xmlin/attr-value-test.xml
===================================================================
--- /dev/null
+++ libvirt-acl/tests/nwfilterxml2xmlin/attr-value-test.xml
@@ -0,0 +1,23 @@
+<filter name='testcase'>
+<uuid>83011800-f663-96d6-8841-fd836b4318c6</uuid>
+<filterref filter='clean-traffic'>
+<parameter name='a' value='1.2.3.4'/>
+<parameter name='a' value='10.1.2.3'/>
+<parameter name='a' value='10.3.3.3'/>
+<parameter name='b' value='1.2.3.4'/>
It's okay that the key (name) gets sorted when it appears multiple
times, but we need to make sure the value doesn't get reordered. Can we
mix it up just a bit more to make it obvious that no sorting on value is
happening, such as:
+<parameter name='a' value='1.2.3.4'/>
+<parameter name='a' value='1.2.3.6'/>
+<parameter name='a' value='1.2.3.5'/>
Also, since we have a separate input from output, it might be worth
intentionally putting name='b' out of order on the input, to show how it
gets sorted into the output.
But definitely a good idea to add tests.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org