xmllite/writer: Handle initial and ready states in the rest of tested Write* methods.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-03-24 10:41:23 +03:00 committed by Alexandre Julliard
parent 408251948e
commit e89c2df7c5
2 changed files with 96 additions and 11 deletions

View File

@ -63,18 +63,15 @@ static void check_writer_state(IXmlWriter *writer, HRESULT exp_hr)
/* FIXME: add WriteAttributes */
hr = IXmlWriter_WriteAttributeString(writer, NULL, aW, NULL, aW);
todo_wine
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteCData(writer, aW);
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteCharEntity(writer, aW[0]);
todo_wine
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteChars(writer, aW, 1);
todo_wine
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteComment(writer, aW);
@ -92,19 +89,17 @@ todo_wine
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteEntityRef(writer, aW);
todo_wine
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteFullEndElement(writer);
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
todo_wine {
hr = IXmlWriter_WriteName(writer, aW);
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteNmToken(writer, aW);
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
}
/* FIXME: add WriteNode */
/* FIXME: add WriteNodeShallow */
@ -112,14 +107,12 @@ todo_wine {
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteQualifiedName(writer, aW, NULL);
todo_wine
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteRaw(writer, aW);
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteRawChars(writer, aW, 1);
todo_wine
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
@ -129,7 +122,6 @@ todo_wine
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteString(writer, aW);
todo_wine
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
/* FIXME: add WriteSurrogateCharEntity */

View File

@ -587,6 +587,16 @@ static HRESULT WINAPI xmlwriter_WriteAttributeString(IXmlWriter *iface, LPCWSTR
FIXME("%p %s %s %s %s\n", This, wine_dbgstr_w(pwszPrefix), wine_dbgstr_w(pwszLocalName),
wine_dbgstr_w(pwszNamespaceUri), wine_dbgstr_w(pwszValue));
switch (This->state)
{
case XmlWriterState_Initial:
return E_UNEXPECTED;
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
}
return E_NOTIMPL;
}
@ -644,8 +654,22 @@ static HRESULT WINAPI xmlwriter_WriteCData(IXmlWriter *iface, LPCWSTR data)
return S_OK;
}
static HRESULT WINAPI xmlwriter_WriteCharEntity(IXmlWriter *iface, WCHAR wch)
static HRESULT WINAPI xmlwriter_WriteCharEntity(IXmlWriter *iface, WCHAR ch)
{
xmlwriter *This = impl_from_IXmlWriter(iface);
FIXME("%p %x\n", This, ch);
switch (This->state)
{
case XmlWriterState_Initial:
return E_UNEXPECTED;
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
}
return E_NOTIMPL;
}
@ -655,6 +679,16 @@ static HRESULT WINAPI xmlwriter_WriteChars(IXmlWriter *iface, const WCHAR *pwch,
FIXME("%p %s %d\n", This, wine_dbgstr_w(pwch), cwch);
switch (This->state)
{
case XmlWriterState_Initial:
return E_UNEXPECTED;
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
}
return E_NOTIMPL;
}
@ -821,6 +855,16 @@ static HRESULT WINAPI xmlwriter_WriteEntityRef(IXmlWriter *iface, LPCWSTR pwszNa
FIXME("%p %s\n", This, wine_dbgstr_w(pwszName));
switch (This->state)
{
case XmlWriterState_Initial:
return E_UNEXPECTED;
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
}
return E_NOTIMPL;
}
@ -862,6 +906,16 @@ static HRESULT WINAPI xmlwriter_WriteName(IXmlWriter *iface, LPCWSTR pwszName)
FIXME("%p %s\n", This, wine_dbgstr_w(pwszName));
switch (This->state)
{
case XmlWriterState_Initial:
return E_UNEXPECTED;
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
}
return E_NOTIMPL;
}
@ -871,6 +925,16 @@ static HRESULT WINAPI xmlwriter_WriteNmToken(IXmlWriter *iface, LPCWSTR pwszNmTo
FIXME("%p %s\n", This, wine_dbgstr_w(pwszNmToken));
switch (This->state)
{
case XmlWriterState_Initial:
return E_UNEXPECTED;
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
}
return E_NOTIMPL;
}
@ -938,6 +1002,16 @@ static HRESULT WINAPI xmlwriter_WriteQualifiedName(IXmlWriter *iface, LPCWSTR pw
FIXME("%p %s %s\n", This, wine_dbgstr_w(pwszLocalName), wine_dbgstr_w(pwszNamespaceUri));
switch (This->state)
{
case XmlWriterState_Initial:
return E_UNEXPECTED;
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
}
return E_NOTIMPL;
}
@ -975,10 +1049,19 @@ static HRESULT WINAPI xmlwriter_WriteRawChars(IXmlWriter *iface, const WCHAR *p
FIXME("%p %s %d\n", This, wine_dbgstr_w(pwch), cwch);
switch (This->state)
{
case XmlWriterState_Initial:
return E_UNEXPECTED;
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
}
return E_NOTIMPL;
}
static HRESULT WINAPI xmlwriter_WriteStartDocument(IXmlWriter *iface, XmlStandalone standalone)
{
xmlwriter *This = impl_from_IXmlWriter(iface);
@ -1047,6 +1130,16 @@ static HRESULT WINAPI xmlwriter_WriteString(IXmlWriter *iface, LPCWSTR pwszText)
FIXME("%p %s\n", This, wine_dbgstr_w(pwszText));
switch (This->state)
{
case XmlWriterState_Initial:
return E_UNEXPECTED;
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
}
return E_NOTIMPL;
}