webservices/tests: Add some tests for WsSetWriterPosition.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
af02e10828
commit
9c5b9399fc
|
@ -1576,6 +1576,7 @@ static void test_WsGetWriterPosition(void)
|
||||||
|
|
||||||
static void test_WsSetWriterPosition(void)
|
static void test_WsSetWriterPosition(void)
|
||||||
{
|
{
|
||||||
|
WS_XML_STRING localname = {1, (BYTE *)"t"}, ns = {0, NULL};
|
||||||
WS_HEAP *heap;
|
WS_HEAP *heap;
|
||||||
WS_XML_WRITER *writer;
|
WS_XML_WRITER *writer;
|
||||||
WS_XML_BUFFER *buf1, *buf2;
|
WS_XML_BUFFER *buf1, *buf2;
|
||||||
|
@ -1617,6 +1618,29 @@ static void test_WsSetWriterPosition(void)
|
||||||
hr = WsSetWriterPosition( writer, &pos, NULL );
|
hr = WsSetWriterPosition( writer, &pos, NULL );
|
||||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||||
|
|
||||||
|
hr = WsSetOutputToBuffer( writer, buf1, NULL, 0, NULL );
|
||||||
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
|
||||||
|
/* try to write at non-final position */
|
||||||
|
hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL );
|
||||||
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
|
||||||
|
pos.buffer = pos.node = NULL;
|
||||||
|
hr = WsGetWriterPosition( writer, &pos, NULL );
|
||||||
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
ok( pos.buffer == buf1, "wrong buffer\n" );
|
||||||
|
ok( pos.node != NULL, "node not set\n" );
|
||||||
|
|
||||||
|
hr = WsWriteEndElement( writer, NULL );
|
||||||
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
check_output_buffer( buf1, "<t/>", __LINE__ );
|
||||||
|
|
||||||
|
hr = WsSetWriterPosition( writer, &pos, NULL );
|
||||||
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
|
||||||
|
hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL );
|
||||||
|
todo_wine ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr );
|
||||||
|
|
||||||
WsFreeWriter( writer );
|
WsFreeWriter( writer );
|
||||||
WsFreeHeap( heap );
|
WsFreeHeap( heap );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue