[PATCH] msxml/tests: Add test for \u escape sequences in regular expressions.

Zebediah Figura zfigura at codeweavers.com
Thu Oct 12 14:37:53 CDT 2017


For bug #43581.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/msxml3/tests/schema.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/dlls/msxml3/tests/schema.c b/dlls/msxml3/tests/schema.c
index ee84b92158..dc65811adb 100644
--- a/dlls/msxml3/tests/schema.c
+++ b/dlls/msxml3/tests/schema.c
@@ -407,6 +407,15 @@ static const CHAR szOpenSeqXML2[] = "<test><x/><x/><y/><z/><z/><w/></test>";
 static const CHAR szOpenSeqXML3[] = "<test><w/><x/><x/><y/><z/><z/></test>";
 static const CHAR szOpenSeqXML4[] = "<test><x/><x/><y/><z/><z/><v/></test>";
 
+static const CHAR szUnicodeEscapeXDR[] =
+"<schema xmlns='http://www.w3.org/2001/XMLSchema'>"
+"  <simpleType name='type1'>"
+"    <restriction base='string'>"
+"      <pattern value='\\u0020'/>"
+"    </restriction>"
+"  </simpleType>"
+"</schema>";
+
 #define check_ref_expr(expr, n) { \
     LONG ref = expr; \
     ok(ref == n, "expected %i refs, got %i\n", n, ref); \
@@ -1154,6 +1163,23 @@ static void test_XDR_schemas(void)
     IXMLDOMDocument2_Release(schema);
     IXMLDOMSchemaCollection_Release(cache);
 
+    /* test for \u escapes */
+    schema = create_document_version(60, &IID_IXMLDOMDocument2);
+    cache = create_cache_version(60, &IID_IXMLDOMSchemaCollection);
+    if (!schema || !cache)
+    {
+        if (schema) IXMLDOMDocument2_Release(schema);
+        if (cache)  IXMLDOMSchemaCollection_Release(cache);
+        return;
+    }
+
+    ole_check(IXMLDOMDocument2_loadXML(schema, _bstr_(szUnicodeEscapeXDR), &b));
+    ok(b == VARIANT_TRUE, "failed to load XML string\n");
+    todo_wine ole_check(IXMLDOMSchemaCollection_add(cache, _bstr_(""), _variantdoc_(schema)));
+
+    IXMLDOMDocument2_Release(schema);
+    IXMLDOMSchemaCollection_Release(cache);
+
     free_bstrs();
 }
 
-- 
2.14.1




More information about the wine-patches mailing list