[PATCH] msxml/tests: Add test for \u escape sequences in regular expressions.
Zebediah Figura
z.figura12 at gmail.com
Mon Oct 23 20:59:04 CDT 2017
On 10/15/2017 02:04 PM, Nikolay Sivov wrote:
> On 12.10.2017 22:37, Zebediah Figura wrote:
>> 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)
>
> Is it XDR "feature" only, that they didn't add to XSDs?
>
I don't know, and I don't know how to tell. I was just following the
existing code.
>> 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;
>> + }
>
> Is this really specific to msxml6? It's better to test on all of them to
> get a full picture, but probably all of them support this extension if
> 6th does. If you want to skip on unsupported class, just return after
> first failure, no need to check both pointers.
>
I was getting parse errors on everything else, so I would have to
presume so. I'll fix the logic at any rate.
>> +
>> + 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)));
>
> I think it's better to get rid of ole_check(), but it's up to you.
>
>> +
>> + IXMLDOMDocument2_Release(schema);
>> + IXMLDOMSchemaCollection_Release(cache);
>> +
>> free_bstrs();
>> }
>>
>>
>
>
>
More information about the wine-devel
mailing list