[1/2] msxml3/tests: Reduce code duplication for the namespace change tests.
udickow at gmail.com
Tue Jun 12 05:33:54 CDT 2012
Den 12-06-2012 13:11, Nikolay Sivov skrev:
> On 6/12/2012 11:52, Ulrik Dickow wrote:
>> + /* create on element and try to alter namespace after that */
>> + doc = (doc_version == 0 ?
>> + create_document(&IID_IXMLDOMDocument) :
>> + create_document_version(60, &IID_IXMLDOMDocument));
>> + if (!doc) return;
> Please use something like CLSID array with every available Document
> CLSID, instead of only testing 2 of them. There's a lot of examples for
> that in saxreader.c.
Yes, that would be a good idea later on. But note that I didn't invent
this "only test 2 of them" thing. This first patch was meant as a tiny
structural improvement to the code, without changing _any_ functionality
at all (except that the line number info becomes a bit less useful).
>> + test_namespaces_change(0);
>> + test_namespaces_change(60);
> It's better to avoid nested test calls like that imho, you could just
> add another call in main test list.
Yes, I considered that, but again would make this patch change as little
as possible, except for simplifying existing code.
Ok, since I have to redo patch 2 anyway, I'll also make this improvement
to patch 1.
>> +static void test_namespaces_change(int doc_version)
>> + IXMLDOMDocument *doc;
>> + IXMLDOMElement *elem;
>> + IXMLDOMNode *node;
>> + IXMLDOMElement_Release(elem);
>> + IXMLDOMDocument_Release(doc);
> When this is running on all CLSIDs please add free_bstrs() here.
Sure, already done in my second patch, where I began slurping up a lot
more bstrs in the function.
More information about the wine-devel