Commit ff644cb1 authored by Adam Martinson's avatar Adam Martinson Committed by Alexandre Julliard

msxml3: Partial stub domdoc_validate().

parent 6e637534
...@@ -2302,8 +2302,35 @@ static HRESULT WINAPI domdoc_validate( ...@@ -2302,8 +2302,35 @@ static HRESULT WINAPI domdoc_validate(
IXMLDOMParseError** err) IXMLDOMParseError** err)
{ {
domdoc *This = impl_from_IXMLDOMDocument3( iface ); domdoc *This = impl_from_IXMLDOMDocument3( iface );
FIXME("(%p)->(%p)\n", This, err); LONG state;
return E_NOTIMPL; xmlValidCtxtPtr vctx;
TRACE("(%p)->(%p)\n", This, err);
domdoc_get_readyState(iface, &state);
if (state != READYSTATE_COMPLETE)
{
if (err)
*err = create_parseError(0, NULL, NULL, NULL, 0, 0, 0);
return E_PENDING;
}
vctx = xmlNewValidCtxt();
vctx->error = NULL; /* TODO: error callback */
vctx->warning = NULL; /* TODO: warning callback */
if (xmlValidateDocument(vctx, get_doc(This)))
{
if (err)
*err = create_parseError(0, NULL, NULL, NULL, 0, 0, 0);
xmlFreeValidCtxt(vctx);
return S_OK;
}
FIXME("partial stub!\n");
if (err)
*err = create_parseError(0xC00CE223, NULL, NULL, NULL, 0, 0, 0);
xmlFreeValidCtxt(vctx);
return S_FALSE;
} }
static HRESULT WINAPI domdoc_setProperty( static HRESULT WINAPI domdoc_setProperty(
......
...@@ -3236,15 +3236,15 @@ static void test_IXMLDOMDocument2(void) ...@@ -3236,15 +3236,15 @@ static void test_IXMLDOMDocument2(void)
ok(res == READYSTATE_COMPLETE, "expected READYSTATE_COMPLETE (4), got %i\n", res); ok(res == READYSTATE_COMPLETE, "expected READYSTATE_COMPLETE (4), got %i\n", res);
err = NULL; err = NULL;
todo_wine ole_expect(IXMLDOMDocument2_validate(doc2, NULL), S_FALSE); ole_expect(IXMLDOMDocument2_validate(doc2, NULL), S_FALSE);
todo_wine ole_expect(IXMLDOMDocument2_validate(doc2, &err), S_FALSE); ole_expect(IXMLDOMDocument2_validate(doc2, &err), S_FALSE);
todo_wine ok(err != NULL, "expected a pointer\n"); ok(err != NULL, "expected a pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_check(IXMLDOMParseError_get_errorCode(err, &res)); ole_check(IXMLDOMParseError_get_errorCode(err, &res));
/* XML_E_NOTWF */ /* XML_E_NOTWF */
todo_wine ok(res == 0xC00CE223, "got %08x\n", res); ok(res == 0xC00CE223, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
} }
...@@ -3258,12 +3258,12 @@ static void test_IXMLDOMDocument2(void) ...@@ -3258,12 +3258,12 @@ static void test_IXMLDOMDocument2(void)
ok(res == READYSTATE_COMPLETE, "expected READYSTATE_COMPLETE (4), got %i\n", res); ok(res == READYSTATE_COMPLETE, "expected READYSTATE_COMPLETE (4), got %i\n", res);
err = NULL; err = NULL;
todo_wine ole_expect(IXMLDOMDocument2_validate(doc2, &err), S_FALSE); ole_expect(IXMLDOMDocument2_validate(doc2, &err), S_FALSE);
todo_wine ok(err != NULL, "expected a pointer\n"); ok(err != NULL, "expected a pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_check(IXMLDOMParseError_get_errorCode(err, &res)); ole_check(IXMLDOMParseError_get_errorCode(err, &res));
/* XML_E_NODTD */ /* XML_E_NODTD */
todo_wine ok(res == 0xC00CE224, "got %08x\n", res); todo_wine ok(res == 0xC00CE224, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
...@@ -3328,25 +3328,25 @@ static void test_IXMLDOMDocument2(void) ...@@ -3328,25 +3328,25 @@ static void test_IXMLDOMDocument2(void)
ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML), &b)); ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML), &b));
ok( b == VARIANT_TRUE, "failed to load XML string\n"); ok( b == VARIANT_TRUE, "failed to load XML string\n");
err = NULL; err = NULL;
todo_wine ole_check(IXMLDOMDocument2_validate(dtddoc2, &err)); ole_check(IXMLDOMDocument2_validate(dtddoc2, &err));
todo_wine ok(err != NULL, "expected pointer\n"); ok(err != NULL, "expected pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_expect(IXMLDOMParseError_get_errorCode(err, &res), S_FALSE); ole_expect(IXMLDOMParseError_get_errorCode(err, &res), S_FALSE);
todo_wine ok(res == 0, "got %08x\n", res); ok(res == 0, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
} }
ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_0D), &b)); ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_0D), &b));
ok( b == VARIANT_TRUE, "failed to load XML string\n"); ok( b == VARIANT_TRUE, "failed to load XML string\n");
err = NULL; err = NULL;
todo_wine ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE); ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE);
todo_wine ok(err != NULL, "expected pointer\n"); ok(err != NULL, "expected pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_check(IXMLDOMParseError_get_errorCode(err, &res)); ole_check(IXMLDOMParseError_get_errorCode(err, &res));
/* XML_ELEMENT_UNDECLARED */ /* XML_ELEMENT_UNDECLARED */
todo_wine ok(res == 0xC00CE00D, "got %08x\n", res); todo_wine ok(res == 0xC00CE00D, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
...@@ -3355,12 +3355,12 @@ static void test_IXMLDOMDocument2(void) ...@@ -3355,12 +3355,12 @@ static void test_IXMLDOMDocument2(void)
ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_0E), &b)); ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_0E), &b));
ok( b == VARIANT_TRUE, "failed to load XML string\n"); ok( b == VARIANT_TRUE, "failed to load XML string\n");
err = NULL; err = NULL;
todo_wine ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE); ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE);
todo_wine ok(err != NULL, "expected pointer\n"); ok(err != NULL, "expected pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_check(IXMLDOMParseError_get_errorCode(err, &res)); ole_check(IXMLDOMParseError_get_errorCode(err, &res));
/* XML_ELEMENT_ID_NOT_FOUND */ /* XML_ELEMENT_ID_NOT_FOUND */
todo_wine ok(res == 0xC00CE00E, "got %08x\n", res); todo_wine ok(res == 0xC00CE00E, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
...@@ -3369,12 +3369,12 @@ static void test_IXMLDOMDocument2(void) ...@@ -3369,12 +3369,12 @@ static void test_IXMLDOMDocument2(void)
ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_11), &b)); ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_11), &b));
ok( b == VARIANT_TRUE, "failed to load XML string\n"); ok( b == VARIANT_TRUE, "failed to load XML string\n");
err = NULL; err = NULL;
todo_wine ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE); ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE);
todo_wine ok(err != NULL, "expected pointer\n"); ok(err != NULL, "expected pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_check(IXMLDOMParseError_get_errorCode(err, &res)); ole_check(IXMLDOMParseError_get_errorCode(err, &res));
/* XML_EMPTY_NOT_ALLOWED */ /* XML_EMPTY_NOT_ALLOWED */
todo_wine ok(res == 0xC00CE011, "got %08x\n", res); todo_wine ok(res == 0xC00CE011, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
...@@ -3383,12 +3383,12 @@ static void test_IXMLDOMDocument2(void) ...@@ -3383,12 +3383,12 @@ static void test_IXMLDOMDocument2(void)
ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_13), &b)); ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_13), &b));
ok( b == VARIANT_TRUE, "failed to load XML string\n"); ok( b == VARIANT_TRUE, "failed to load XML string\n");
err = NULL; err = NULL;
todo_wine ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE); ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE);
todo_wine ok(err != NULL, "expected pointer\n"); ok(err != NULL, "expected pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_check(IXMLDOMParseError_get_errorCode(err, &res)); ole_check(IXMLDOMParseError_get_errorCode(err, &res));
/* XML_ROOT_NAME_MISMATCH */ /* XML_ROOT_NAME_MISMATCH */
todo_wine ok(res == 0xC00CE013, "got %08x\n", res); todo_wine ok(res == 0xC00CE013, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
...@@ -3397,12 +3397,12 @@ static void test_IXMLDOMDocument2(void) ...@@ -3397,12 +3397,12 @@ static void test_IXMLDOMDocument2(void)
ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_14), &b)); ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_14), &b));
ok( b == VARIANT_TRUE, "failed to load XML string\n"); ok( b == VARIANT_TRUE, "failed to load XML string\n");
err = NULL; err = NULL;
todo_wine ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE); ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE);
todo_wine ok(err != NULL, "expected pointer\n"); ok(err != NULL, "expected pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_check(IXMLDOMParseError_get_errorCode(err, &res)); ole_check(IXMLDOMParseError_get_errorCode(err, &res));
/* XML_INVALID_CONTENT */ /* XML_INVALID_CONTENT */
todo_wine ok(res == 0xC00CE014, "got %08x\n", res); todo_wine ok(res == 0xC00CE014, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
...@@ -3411,12 +3411,12 @@ static void test_IXMLDOMDocument2(void) ...@@ -3411,12 +3411,12 @@ static void test_IXMLDOMDocument2(void)
ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_15), &b)); ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_15), &b));
ok( b == VARIANT_TRUE, "failed to load XML string\n"); ok( b == VARIANT_TRUE, "failed to load XML string\n");
err = NULL; err = NULL;
todo_wine ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE); ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE);
todo_wine ok(err != NULL, "expected pointer\n"); ok(err != NULL, "expected pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_check(IXMLDOMParseError_get_errorCode(err, &res)); ole_check(IXMLDOMParseError_get_errorCode(err, &res));
/* XML_ATTRIBUTE_NOT_DEFINED */ /* XML_ATTRIBUTE_NOT_DEFINED */
todo_wine ok(res == 0xC00CE015, "got %08x\n", res); todo_wine ok(res == 0xC00CE015, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
...@@ -3425,12 +3425,12 @@ static void test_IXMLDOMDocument2(void) ...@@ -3425,12 +3425,12 @@ static void test_IXMLDOMDocument2(void)
ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_16), &b)); ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_16), &b));
ok( b == VARIANT_TRUE, "failed to load XML string\n"); ok( b == VARIANT_TRUE, "failed to load XML string\n");
err = NULL; err = NULL;
todo_wine ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE); ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE);
todo_wine ok(err != NULL, "expected pointer\n"); ok(err != NULL, "expected pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_check(IXMLDOMParseError_get_errorCode(err, &res)); ole_check(IXMLDOMParseError_get_errorCode(err, &res));
/* XML_ATTRIBUTE_FIXED */ /* XML_ATTRIBUTE_FIXED */
todo_wine ok(res == 0xC00CE016, "got %08x\n", res); todo_wine ok(res == 0xC00CE016, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
...@@ -3439,12 +3439,12 @@ static void test_IXMLDOMDocument2(void) ...@@ -3439,12 +3439,12 @@ static void test_IXMLDOMDocument2(void)
ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_17), &b)); ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_17), &b));
ok( b == VARIANT_TRUE, "failed to load XML string\n"); ok( b == VARIANT_TRUE, "failed to load XML string\n");
err = NULL; err = NULL;
todo_wine ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE); ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE);
todo_wine ok(err != NULL, "expected pointer\n"); ok(err != NULL, "expected pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_check(IXMLDOMParseError_get_errorCode(err, &res)); ole_check(IXMLDOMParseError_get_errorCode(err, &res));
/* XML_ATTRIBUTE_VALUE */ /* XML_ATTRIBUTE_VALUE */
todo_wine ok(res == 0xC00CE017, "got %08x\n", res); todo_wine ok(res == 0xC00CE017, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
...@@ -3453,12 +3453,12 @@ static void test_IXMLDOMDocument2(void) ...@@ -3453,12 +3453,12 @@ static void test_IXMLDOMDocument2(void)
ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_18), &b)); ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_18), &b));
ok( b == VARIANT_TRUE, "failed to load XML string\n"); ok( b == VARIANT_TRUE, "failed to load XML string\n");
err = NULL; err = NULL;
todo_wine ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE); ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE);
todo_wine ok(err != NULL, "expected pointer\n"); ok(err != NULL, "expected pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_check(IXMLDOMParseError_get_errorCode(err, &res)); ole_check(IXMLDOMParseError_get_errorCode(err, &res));
/* XML_ILLEGAL_TEXT */ /* XML_ILLEGAL_TEXT */
todo_wine ok(res == 0xC00CE018, "got %08x\n", res); todo_wine ok(res == 0xC00CE018, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
...@@ -3467,12 +3467,12 @@ static void test_IXMLDOMDocument2(void) ...@@ -3467,12 +3467,12 @@ static void test_IXMLDOMDocument2(void)
ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_20), &b)); ole_check(IXMLDOMDocument2_loadXML(dtddoc2, _bstr_(szEmailXML_20), &b));
ok( b == VARIANT_TRUE, "failed to load XML string\n"); ok( b == VARIANT_TRUE, "failed to load XML string\n");
err = NULL; err = NULL;
todo_wine ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE); ole_expect(IXMLDOMDocument2_validate(dtddoc2, &err), S_FALSE);
todo_wine ok(err != NULL, "expected pointer\n"); ok(err != NULL, "expected pointer\n");
if (err) if (err)
{ {
res = 0; res = 0;
todo_wine ole_check(IXMLDOMParseError_get_errorCode(err, &res)); ole_check(IXMLDOMParseError_get_errorCode(err, &res));
/* XML_REQUIRED_ATTRIBUTE_MISSING */ /* XML_REQUIRED_ATTRIBUTE_MISSING */
todo_wine ok(res == 0xC00CE020, "got %08x\n", res); todo_wine ok(res == 0xC00CE020, "got %08x\n", res);
IXMLDOMParseError_Release(err); IXMLDOMParseError_Release(err);
......
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