Commit cd55a674 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

xmllite/writer: Close open tag on WriteRaw().

parent 57497d12
......@@ -1320,11 +1320,23 @@ static void test_WriteRaw(void)
hr = IXmlWriter_Flush(writer);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>a<:a<:<!--a<:-->a<:<a>a</a>");
IStream_Release(stream);
IXmlWriter_Release(writer);
/* With open element. */
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartElement(writer, NULL, L"w", NULL);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, L"text");
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, "<w>text");
IStream_Release(stream);
IXmlWriter_Release(writer);
}
static void test_writer_state(void)
......
......@@ -1563,6 +1563,9 @@ static HRESULT WINAPI xmlwriter_WriteRaw(IXmlWriter *iface, LPCWSTR data)
break;
case XmlWriterState_InvalidEncoding:
return MX_E_ENCODING;
case XmlWriterState_ElemStarted:
writer_close_starttag(This);
break;
default:
This->state = XmlWriterState_DocClosed;
return WR_E_INVALIDACTION;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment