mirror of
https://github.com/reactos/wine.git
synced 2025-03-03 18:28:58 +00:00
webservices: Add a stub implementation of WsGetXmlAttribute.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ce71c50f30
commit
9eee37f53f
@ -565,6 +565,16 @@ HRESULT WINAPI WsGetReaderProperty( WS_XML_READER *handle, WS_XML_READER_PROPERT
|
||||
return get_reader_prop( reader, id, buf, size );
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* WsGetXmlAttribute [webservices.@]
|
||||
*/
|
||||
HRESULT WINAPI WsGetXmlAttribute( WS_XML_READER *handle, const WS_XML_STRING *attr,
|
||||
WS_HEAP *heap, WCHAR **str, ULONG *len, WS_ERROR *error )
|
||||
{
|
||||
FIXME( "%p %p %p %p %p %p: stub\n", handle, debugstr_xmlstr(attr), heap, str, len, error );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static WS_XML_STRING *alloc_xml_string( const char *data, ULONG len )
|
||||
{
|
||||
WS_XML_STRING *ret;
|
||||
|
@ -58,6 +58,9 @@ static const char data7[] =
|
||||
static const char data8[] =
|
||||
"<node1><node2>test</node2></node1>";
|
||||
|
||||
static const char data9[] =
|
||||
"<text xml:attr=\"value\">test</text>";
|
||||
|
||||
static void test_WsCreateError(void)
|
||||
{
|
||||
HRESULT hr;
|
||||
@ -1286,6 +1289,62 @@ static void test_WsReadType(void)
|
||||
WsFreeHeap( heap );
|
||||
}
|
||||
|
||||
static void test_WsGetXmlAttribute(void)
|
||||
{
|
||||
static const WCHAR valueW[] = {'v','a','l','u','e',0};
|
||||
HRESULT hr;
|
||||
WS_XML_READER *reader;
|
||||
WS_XML_STRING xmlstr;
|
||||
WS_HEAP *heap;
|
||||
WCHAR *str;
|
||||
ULONG count;
|
||||
int found;
|
||||
|
||||
hr = WsCreateHeap( 1 << 16, 0, NULL, 0, &heap, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
|
||||
hr = WsCreateReader( NULL, 0, &reader, NULL ) ;
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
|
||||
hr = set_input( reader, data9, sizeof(data9) - 1 );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
|
||||
hr = WsFillReader( reader, sizeof(data9) - 1, NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
|
||||
found = -1;
|
||||
hr = WsReadToStartElement( reader, NULL, NULL, &found, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( found == TRUE, "got %d\n", found );
|
||||
|
||||
xmlstr.bytes = (BYTE *)"attr";
|
||||
xmlstr.length = sizeof("attr") - 1;
|
||||
xmlstr.dictionary = NULL;
|
||||
xmlstr.id = 0;
|
||||
str = NULL;
|
||||
count = 0;
|
||||
hr = WsGetXmlAttribute( reader, &xmlstr, heap, &str, &count, NULL );
|
||||
todo_wine ok( hr == S_OK, "got %08x\n", hr );
|
||||
todo_wine ok( str != NULL, "str not set\n" );
|
||||
todo_wine ok( count == 5, "got %u\n", count );
|
||||
/* string is not null-terminated */
|
||||
if (str) ok( !memcmp( str, valueW, count * sizeof(WCHAR) ), "wrong data\n" );
|
||||
|
||||
xmlstr.bytes = (BYTE *)"none";
|
||||
xmlstr.length = sizeof("none") - 1;
|
||||
xmlstr.dictionary = NULL;
|
||||
xmlstr.id = 0;
|
||||
str = (WCHAR *)0xdeadbeef;
|
||||
count = 0xdeadbeef;
|
||||
hr = WsGetXmlAttribute( reader, &xmlstr, heap, &str, &count, NULL );
|
||||
todo_wine ok( hr == S_FALSE, "got %08x\n", hr );
|
||||
todo_wine ok( str == NULL, "str not set\n" );
|
||||
todo_wine ok( !count, "got %u\n", count );
|
||||
|
||||
WsFreeReader( reader );
|
||||
WsFreeHeap( heap );
|
||||
}
|
||||
|
||||
START_TEST(reader)
|
||||
{
|
||||
test_WsCreateError();
|
||||
@ -1298,4 +1357,5 @@ START_TEST(reader)
|
||||
test_WsReadEndElement();
|
||||
test_WsReadNode();
|
||||
test_WsReadType();
|
||||
test_WsGetXmlAttribute();
|
||||
}
|
||||
|
@ -89,7 +89,7 @@
|
||||
@ stub WsGetServiceProxyProperty
|
||||
@ stub WsGetWriterPosition
|
||||
@ stdcall WsGetWriterProperty(ptr long ptr long ptr)
|
||||
@ stub WsGetXmlAttribute
|
||||
@ stdcall WsGetXmlAttribute(ptr ptr ptr ptr ptr ptr)
|
||||
@ stub WsInitializeMessage
|
||||
@ stub WsMarkHeaderAsUnderstood
|
||||
@ stub WsMatchPolicyAlternative
|
||||
|
Loading…
x
Reference in New Issue
Block a user