todo_wineok(hr==S_OK,"AddNamespace failed with %08x\n",hr);
/* Check the returned structure */
todo_wineok(ns1!=NULL,"ns1 == NULL\n");
if(ns1!=NULL)
{
ok(lstrcmpW(ns1->Uri,ns1Uri)==0,"URI returned by AddNamespace is not as expected (%s)\n",wine_dbgstr_w(ns1->Uri));
ok(lstrcmpW(ns1->PreferredPrefix,prefix1)==0,"PreferredPrefix returned by AddNamespace is not as expected (%s)\n",wine_dbgstr_w(ns1->PreferredPrefix));
ok(ns1->Names==NULL,"Names array is not empty\n");
ok(ns1->NamesCount==0,"NamesCount is not 0 (value = %d)\n",ns1->NamesCount);
ok(ns1->Uri!=ns1Uri,"URI has not been cloned\n");
ok(ns1->PreferredPrefix!=prefix1,"URI has not been cloned\n");
}
/* Test calling AddNamespace with parameters that are too large */
todo_wineok(hr==S_OK,"AddNamespace failed with %08x\n",hr);
/* Check the returned structure */
todo_wineok(ns2!=NULL,"ns2 == NULL\n");
if(ns2!=NULL)
{
ok(lstrcmpW(ns2->Uri,ns2Uri)==0,"URI returned by AddNamespace is not as expected (%s)\n",wine_dbgstr_w(ns2->Uri));
ok(lstrcmpW(ns2->PreferredPrefix,unPrefix0)==0,"PreferredPrefix returned by AddNamespace is not as expected (%s)\n",wine_dbgstr_w(ns2->PreferredPrefix));
ok(ns2->Names==NULL,"Names array is not empty\n");
ok(ns2->NamesCount==0,"NamesCount is not 0 (value = %d)\n",ns2->NamesCount);
ok(ns2->Uri!=ns2Uri,"URI has not been cloned\n");
ok(ns2->PreferredPrefix!=prefix2,"URI has not been cloned\n");
}
WSDFreeLinkedMemory(ns1);
WSDFreeLinkedMemory(ns2);
/* Try explicitly creating a prefix called 'un1' */
todo_wineok(hr==S_OK,"AddNamespace failed with %08x\n",hr);
/* Check the returned structure */
todo_wineok(ns2!=NULL,"ns2 == NULL\n");
if(ns2!=NULL)
{
ok(lstrcmpW(ns2->PreferredPrefix,unPrefix1)==0,"PreferredPrefix returned by AddNamespace is not as expected (%s)\n",wine_dbgstr_w(ns2->PreferredPrefix));
todo_wineok(hr==S_OK,"AddNamespace failed with %08x\n",hr);
/* Check the returned structure */
todo_wineok(ns2!=NULL,"ns2 == NULL\n");
if(ns2!=NULL)
{
ok(lstrcmpW(ns2->PreferredPrefix,unPrefix2)==0,"PreferredPrefix returned by AddNamespace is not as expected (%s)\n",wine_dbgstr_w(ns2->PreferredPrefix));
todo_wineok(hr==S_OK,"AddNamespace failed with %08x\n",hr);
/* Check the returned structure */
todo_wineok(ns2!=NULL,"ns2 == NULL\n");
if(ns2!=NULL)
{
ok(lstrcmpW(ns2->Uri,ns3Uri)==0,"Uri returned by AddNamespace is not as expected (%s)\n",wine_dbgstr_w(ns2->Uri));
ok(lstrcmpW(ns2->PreferredPrefix,prefix2)==0,"PreferredPrefix returned by AddNamespace is not as expected (%s)\n",wine_dbgstr_w(ns2->PreferredPrefix));
}
WSDFreeLinkedMemory(ns2);
IWSDXMLContext_Release(context);
}
START_TEST(xml)
{
/* Allocate a large text buffer for use in tests */