diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/auto.pro | 4 | ||||
-rw-r--r-- | tests/auto/xmlpatternsvalidator/files/fractiondigits.xml | 4 | ||||
-rw-r--r-- | tests/auto/xmlpatternsvalidator/files/fractiondigits.xsd | 15 | ||||
-rw-r--r-- | tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp | 5 |
4 files changed, 26 insertions, 2 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index df80f80..aba49b6 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -1,4 +1,5 @@ TEMPLATE=subdirs +QT_FOR_CONFIG += xmlpatterns-private SUBDIRS=\ checkxmlfiles \ cmake \ @@ -30,8 +31,7 @@ SUBDIRS=\ xmlpatternsxqts \ xmlpatternsxslts \ -load(qfeatures) -!contains(QT_DISABLED_FEATURES, xmlschema) { +qtConfig(xml-schema) { SUBDIRS += qxmlschema \ qxmlschemavalidator \ xmlpatternsschema \ diff --git a/tests/auto/xmlpatternsvalidator/files/fractiondigits.xml b/tests/auto/xmlpatternsvalidator/files/fractiondigits.xml new file mode 100644 index 0000000..55c2ee8 --- /dev/null +++ b/tests/auto/xmlpatternsvalidator/files/fractiondigits.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<tns:number xmlns:tns="http://www.example.org/FractionDigitsTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/FractionDigitsTest FractionDigitsTest.xsd"> + <tns:value>1234.560000</tns:value> +</tns:number> diff --git a/tests/auto/xmlpatternsvalidator/files/fractiondigits.xsd b/tests/auto/xmlpatternsvalidator/files/fractiondigits.xsd new file mode 100644 index 0000000..b8f266a --- /dev/null +++ b/tests/auto/xmlpatternsvalidator/files/fractiondigits.xsd @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/FractionDigitsTest" xmlns:tns="http://www.example.org/FractionDigitsTest" elementFormDefault="qualified"> + <element name="number" type="tns:NumberType" /> + <complexType name="NumberType"> + <sequence> + <element name="value"> + <simpleType> + <restriction base="decimal"> + <fractionDigits value="2"/> + </restriction> + </simpleType> + </element> + </sequence> + </complexType> +</schema> diff --git a/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp b/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp index 8e86dd9..8a11418 100644 --- a/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp +++ b/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp @@ -227,6 +227,11 @@ void tst_XmlPatternsValidator::xsdSupport_data() const << (QStringList() << path + QLatin1String("substitution-group-invalid.xml") << path + QLatin1String("substitution-group.xsd")) << QString(); + QTest::newRow("QTBUG-58245 fraction digits shouldn't take trailing 0 into account") + << 0 + << (QStringList() << path + QLatin1String("fractiondigits.xml") + << path + QLatin1String("fractiondigits.xsd")) + << QString(); } QTEST_MAIN(tst_XmlPatternsValidator) |