ReactOS  0.4.15-dev-1397-g19779b3
schema.c File Reference
#include <stdio.h>
#include <assert.h>
#include "initguid.h"
#include "windows.h"
#include "ole2.h"
#include "msxml2.h"
#include "msxml2did.h"
#include "dispex.h"
#include "wine/test.h"
Include dependency graph for schema.c:

Go to the source code of this file.

Classes

struct  xdr_datatypes
 

Macros

#define COBJMACROS
 
#define EXPECT_HR(hr, hr_exp)   ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
 
#define check_ref_expr(expr, n)
 
#define check_refs(iface, obj, n)
 
#define ole_check(expr)
 
#define ole_expect(expr, expect)
 
#define _expect64(expr, str, base, TYPE, CONV)
 
#define expect_int64(expr, x, base)   _expect64(expr, #x, base, LONG64, strtoll)
 
#define expect_uint64(expr, x, base)   _expect64(expr, #x, base, ULONG64, strtoull)
 
#define _create(cls)   cls, #cls
 
#define create_document(iid)   _create_object(&_create(CLSID_DOMDocument), iid, __LINE__)
 
#define create_document_version(v, iid)   _create_object(&_create(CLSID_DOMDocument ## v), iid, __LINE__)
 
#define create_cache(iid)   _create_object(&_create(CLSID_XMLSchemaCache), iid, __LINE__)
 
#define create_cache_version(v, iid)   _create_object(&_create(CLSID_XMLSchemaCache ## v), iid, __LINE__)
 

Functions

static BSTR alloc_str_from_narrow (const char *str)
 
static BSTR _bstr_ (const char *str)
 
static void free_bstrs (void)
 
static VARIANT _variantdoc_ (void *doc)
 
static void_create_object (const GUID *clsid, const char *name, const IID *iid, int line)
 
static void test_schema_refs (void)
 
static void test_collection_refs (void)
 
static void test_length (void)
 
static void test_collection_content (void)
 
static void test_XDR_schemas (void)
 
static void test_XDR_datatypes (void)
 
static void test_validate_on_load (void)
 
static void test_obj_dispex (IUnknown *obj)
 
static void test_dispex (void)
 
static void test_get (void)
 
static void test_remove (void)
 
static void test_ifaces (void)
 
 START_TEST (schema)
 

Variables

static const WCHAR xdr_schema_uri [] = {'x','-','s','c','h','e','m','a',':','t','e','s','t','.','x','m','l',0}
 
static const WCHAR xdr_schema_xml []
 
static const CHAR xdr_schema1_uri [] = "x-schema:test1.xdr"
 
static const CHAR xdr_schema1_xml []
 
static const CHAR xdr_schema2_uri [] = "x-schema:test2.xdr"
 
static const CHAR xdr_schema2_xml []
 
static const CHAR xdr_schema3_uri [] = "x-schema:test3.xdr"
 
static const CHAR xdr_schema3_xml []
 
static const CHAR xsd_schema1_uri [] = "x-schema:test1.xsd"
 
static const CHAR xsd_schema1_xml []
 
static const CHAR xsd_schema2_uri [] = "x-schema:test2.xsd"
 
static const CHAR xsd_schema2_xml []
 
static const CHAR xsd_schema3_uri [] = "x-schema:test3.xsd"
 
static const CHAR xsd_schema3_xml []
 
static const CHAR szDatatypeXDR []
 
static const CHAR szDatatypeXML []
 
static const CHAR szOpenSeqXDR []
 
static const CHAR szOpenSeqXML1 [] = "<test><x/><x/><y/><z/><z/></test>"
 
static const CHAR szOpenSeqXML2 [] = "<test><x/><x/><y/><z/><z/><w/></test>"
 
static const CHAR szOpenSeqXML3 [] = "<test><w/><x/><x/><y/><z/><z/></test>"
 
static const CHAR szOpenSeqXML4 [] = "<test><x/><x/><y/><z/><z/><v/></test>"
 
static BSTR alloced_bstrs [256]
 
static int alloced_bstrs_count
 
static const xdr_datatypes xdr_datatypes_data []
 

Macro Definition Documentation

◆ _create

#define _create (   cls)    cls, #cls

Definition at line 497 of file schema.c.

◆ _expect64

#define _expect64 (   expr,
  str,
  base,
  TYPE,
  CONV 
)
Value:
{ \
TYPE v1 = expr; \
TYPE v2 = CONV(str, NULL, base); \
ok(v1 == v2, #expr "returned %s, expected %s\n", \
}
LOCAL int expr(arg_t *ap, int *altp)
Definition: match.c:512
Definition: query.h:86
const WCHAR * str
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
#define NULL
Definition: types.h:112
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
GLfloat GLfloat v1
Definition: glext.h:6062

Definition at line 436 of file schema.c.

◆ check_ref_expr

#define check_ref_expr (   expr,
  n 
)
Value:
{ \
LONG ref = expr; \
ok(ref == n, "expected %i refs, got %i\n", n, ref); \
}
LOCAL int expr(arg_t *ap, int *altp)
Definition: match.c:512
GLdouble n
Definition: glext.h:7729
Definition: send.c:48

Definition at line 414 of file schema.c.

◆ check_refs

#define check_refs (   iface,
  obj,
  n 
)
Value:
{ \
LONG ref = iface ## _AddRef(obj); \
ok(ref == n+1, "expected %i refs, got %i\n", n+1, ref); \
ref = iface ## _Release(obj); \
ok(ref == n, "expected %i refs, got %i\n", n, ref); \
}
GLdouble n
Definition: glext.h:7729
Definition: send.c:48

Definition at line 419 of file schema.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file schema.c.

◆ create_cache

#define create_cache (   iid)    _create_object(&_create(CLSID_XMLSchemaCache), iid, __LINE__)

Definition at line 503 of file schema.c.

◆ create_cache_version

#define create_cache_version (   v,
  iid 
)    _create_object(&_create(CLSID_XMLSchemaCache ## v), iid, __LINE__)

Definition at line 505 of file schema.c.

◆ create_document

#define create_document (   iid)    _create_object(&_create(CLSID_DOMDocument), iid, __LINE__)

Definition at line 499 of file schema.c.

◆ create_document_version

#define create_document_version (   v,
  iid 
)    _create_object(&_create(CLSID_DOMDocument ## v), iid, __LINE__)

Definition at line 501 of file schema.c.

◆ EXPECT_HR

#define EXPECT_HR (   hr,
  hr_exp 
)    ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)

Definition at line 40 of file schema.c.

◆ expect_int64

#define expect_int64 (   expr,
  x,
  base 
)    _expect64(expr, #x, base, LONG64, strtoll)

Definition at line 447 of file schema.c.

◆ expect_uint64

#define expect_uint64 (   expr,
  x,
  base 
)    _expect64(expr, #x, base, ULONG64, strtoull)

Definition at line 448 of file schema.c.

◆ ole_check

#define ole_check (   expr)
Value:
{ \
HRESULT r = expr; \
ok(r == S_OK, #expr " returned %x\n", r); \
}
LOCAL int expr(arg_t *ap, int *altp)
Definition: match.c:512
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
Definition: query.h:86
#define S_OK
Definition: intsafe.h:51

Definition at line 426 of file schema.c.

◆ ole_expect

#define ole_expect (   expr,
  expect 
)
Value:
{ \
HRESULT r = expr; \
ok(r == (expect), #expr " returned %x, expected %x\n", r, expect); \
}
LOCAL int expr(arg_t *ap, int *altp)
Definition: match.c:512
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
Definition: query.h:86
#define expect(expected, got)
Definition: combo.c:36

Definition at line 431 of file schema.c.

Function Documentation

◆ _bstr_()

static BSTR _bstr_ ( const char str)
static

Definition at line 462 of file schema.c.

463 {
467 }
static BSTR alloc_str_from_narrow(const char *str)
Definition: schema.c:454
static int alloced_bstrs_count
Definition: schema.c:452
#define assert(x)
Definition: debug.h:53
const WCHAR * str
static BSTR alloced_bstrs[256]
Definition: schema.c:451
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by test_collection_content(), test_collection_refs(), test_get(), test_length(), test_remove(), test_XDR_datatypes(), and test_XDR_schemas().

◆ _create_object()

static void* _create_object ( const GUID clsid,
const char name,
const IID iid,
int  line 
)
static

Definition at line 485 of file schema.c.

486 {
487  void *obj = NULL;
488  HRESULT hr;
489 
490  hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, iid, &obj);
491  if (hr != S_OK)
492  win_skip_(__FILE__,line)("failed to create %s instance: 0x%08x\n", name, hr);
493 
494  return obj;
495 }
HRESULT hr
Definition: shlfolder.c:183
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
#define win_skip_(file, line)
Definition: test.h:144
Definition: parser.c:48
LONG HRESULT
Definition: typedefs.h:79
REFCLSID clsid
Definition: msctf.c:82
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:51
#define NULL
Definition: types.h:112
GLuint const GLchar * name
Definition: glext.h:6031

◆ _variantdoc_()

static VARIANT _variantdoc_ ( void doc)
static

Definition at line 477 of file schema.c.

478 {
479  VARIANT v;
480  V_VT(&v) = VT_DISPATCH;
481  V_DISPATCH(&v) = (IDispatch*)doc;
482  return v;
483 }
#define V_DISPATCH(A)
Definition: oleauto.h:239
#define V_VT(A)
Definition: oleauto.h:211
const GLdouble * v
Definition: gl.h:2040

Referenced by test_collection_content(), test_collection_refs(), test_length(), and test_schema_refs().

◆ alloc_str_from_narrow()

static BSTR alloc_str_from_narrow ( const char str)
static

Definition at line 454 of file schema.c.

455 {
456  int len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
457  BSTR ret = SysAllocStringLen(NULL, len - 1); /* NUL character added automatically */
458  MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
459  return ret;
460 }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define CP_ACP
Definition: compat.h:109
OLECHAR * BSTR
Definition: compat.h:2152
const WCHAR * str
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110

Referenced by _bstr_().

◆ free_bstrs()

static void free_bstrs ( void  )
static

Definition at line 469 of file schema.c.

470 {
471  int i;
472  for (i = 0; i < alloced_bstrs_count; i++)
475 }
static int alloced_bstrs_count
Definition: schema.c:452
static BSTR alloced_bstrs[256]
Definition: schema.c:451
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271

Referenced by test_collection_content(), test_collection_refs(), test_get(), test_length(), test_remove(), test_XDR_datatypes(), and test_XDR_schemas().

◆ START_TEST()

START_TEST ( schema  )

Definition at line 1678 of file schema.c.

1679 {
1680  HRESULT r;
1681 
1682  r = CoInitialize( NULL );
1683  ok( r == S_OK, "failed to init com\n");
1684 
1685  test_schema_refs();
1687  test_length();
1689  test_XDR_schemas();
1692  test_dispex();
1693  test_get();
1694  test_remove();
1695  test_ifaces();
1696 
1697  CoUninitialize();
1698 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void test_XDR_schemas(void)
Definition: schema.c:1030
static void test_XDR_datatypes(void)
Definition: schema.c:1208
static void test_schema_refs(void)
Definition: schema.c:507
static void test_remove(void)
Definition: schema.c:1568
LONG HRESULT
Definition: typedefs.h:79
static void test_collection_content(void)
Definition: schema.c:881
static void test_collection_refs(void)
Definition: schema.c:670
static void test_ifaces(void)
Definition: schema.c:1660
static void test_length(void)
Definition: schema.c:789
static void test_dispex(void)
Definition: schema.c:1493
#define S_OK
Definition: intsafe.h:51
static void test_validate_on_load(void)
Definition: schema.c:1419
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
static void test_get(void)
Definition: schema.c:1538

◆ test_collection_content()

static void test_collection_content ( void  )
static

Definition at line 881 of file schema.c.

882 {
883  IXMLDOMDocument2 *schema1, *schema2, *schema3, *schema4, *schema5;
884  BSTR content[5] = {NULL, NULL, NULL, NULL, NULL};
885  IXMLDOMSchemaCollection *cache1, *cache2;
886  VARIANT_BOOL b;
887  LONG length;
888  HRESULT hr;
889  BSTR bstr;
890  int i, j;
891 
892  schema1 = create_document_version(30, &IID_IXMLDOMDocument2);
893  schema2 = create_document_version(30, &IID_IXMLDOMDocument2);
894  schema3 = create_document_version(30, &IID_IXMLDOMDocument2);
895 
896  cache1 = create_cache_version(30, &IID_IXMLDOMSchemaCollection);
897  cache2 = create_cache_version(40, &IID_IXMLDOMSchemaCollection);
898 
899  if (!schema1 || !schema2 || !schema3 || !cache1)
900  {
901  if (schema1) IXMLDOMDocument2_Release(schema1);
902  if (schema2) IXMLDOMDocument2_Release(schema2);
903  if (schema3) IXMLDOMDocument2_Release(schema3);
904 
905  if (cache1) IXMLDOMSchemaCollection_Release(cache1);
906 
907  return;
908  }
909 
910  ole_check(IXMLDOMDocument2_loadXML(schema1, _bstr_(xdr_schema1_xml), &b));
911  ok(b == VARIANT_TRUE, "failed to load XML\n");
912 
913  ole_check(IXMLDOMDocument2_loadXML(schema2, _bstr_(xdr_schema2_xml), &b));
914  ok(b == VARIANT_TRUE, "failed to load XML\n");
915 
916  ole_check(IXMLDOMDocument2_loadXML(schema3, _bstr_(xdr_schema3_xml), &b));
917  ok(b == VARIANT_TRUE, "failed to load XML\n");
918 
919  ole_check(IXMLDOMSchemaCollection_add(cache1, _bstr_(xdr_schema1_uri), _variantdoc_(schema1)));
920  ole_check(IXMLDOMSchemaCollection_add(cache1, _bstr_(xdr_schema2_uri), _variantdoc_(schema2)));
921  ole_check(IXMLDOMSchemaCollection_add(cache1, _bstr_(xdr_schema3_uri), _variantdoc_(schema3)));
922 
923  length = -1;
924  ole_check(IXMLDOMSchemaCollection_get_length(cache1, &length));
925  ok(length == 3, "expected length 3, got %i\n", length);
926 
927  IXMLDOMDocument2_Release(schema1);
928  IXMLDOMDocument2_Release(schema2);
929  IXMLDOMDocument2_Release(schema3);
930 
931  if (cache2)
932  {
933  schema1 = create_document_version(40, &IID_IXMLDOMDocument2);
934  schema2 = create_document_version(40, &IID_IXMLDOMDocument2);
935  schema3 = create_document_version(40, &IID_IXMLDOMDocument2);
936  schema4 = create_document_version(40, &IID_IXMLDOMDocument2);
937  schema5 = create_document_version(40, &IID_IXMLDOMDocument2);
938  ole_check(IXMLDOMDocument2_loadXML(schema1, _bstr_(xdr_schema1_xml), &b));
939  ok(b == VARIANT_TRUE, "failed to load XML\n");
940  ole_check(IXMLDOMDocument2_loadXML(schema2, _bstr_(xdr_schema2_xml), &b));
941  ok(b == VARIANT_TRUE, "failed to load XML\n");
942  ole_check(IXMLDOMDocument2_loadXML(schema3, _bstr_(xsd_schema1_xml), &b));
943  ok(b == VARIANT_TRUE, "failed to load XML\n");
944  ole_check(IXMLDOMDocument2_loadXML(schema4, _bstr_(xsd_schema2_xml), &b));
945  ok(b == VARIANT_TRUE, "failed to load XML\n");
946  ole_check(IXMLDOMDocument2_loadXML(schema5, _bstr_(xsd_schema3_xml), &b));
947  ok(b == VARIANT_TRUE, "failed to load XML\n");
948 
949  /* combining XDR and XSD schemas in the same cache is fine */
950  ole_check(IXMLDOMSchemaCollection_add(cache2, _bstr_(xdr_schema1_uri), _variantdoc_(schema1)));
951  ole_check(IXMLDOMSchemaCollection_add(cache2, _bstr_(xdr_schema2_uri), _variantdoc_(schema2)));
952  ole_check(IXMLDOMSchemaCollection_add(cache2, _bstr_(xsd_schema1_uri), _variantdoc_(schema3)));
953  ole_check(IXMLDOMSchemaCollection_add(cache2, _bstr_(xsd_schema2_uri), _variantdoc_(schema4)));
954  ole_check(IXMLDOMSchemaCollection_add(cache2, _bstr_(xsd_schema3_uri), _variantdoc_(schema5)));
955 
956  length = -1;
957  ole_check(IXMLDOMSchemaCollection_get_length(cache2, &length));
958  ok(length == 5, "expected length 5, got %i\n", length);
959 
960  IXMLDOMDocument2_Release(schema1);
961  IXMLDOMDocument2_Release(schema2);
962  IXMLDOMDocument2_Release(schema3);
963  IXMLDOMDocument2_Release(schema4);
964  IXMLDOMDocument2_Release(schema5);
965  }
966 
967  bstr = (void*)0xdeadbeef;
968  /* error if index is out of range */
969  hr = IXMLDOMSchemaCollection_get_namespaceURI(cache1, 3, &bstr);
970  EXPECT_HR(hr, E_FAIL);
971  ok(bstr == (void*)0xdeadbeef, "got %p\n", bstr);
972  /* error if return pointer is NULL */
973  ole_expect(IXMLDOMSchemaCollection_get_namespaceURI(cache1, 0, NULL), E_POINTER);
974  /* pointer is checked first */
975  ole_expect(IXMLDOMSchemaCollection_get_namespaceURI(cache1, 3, NULL), E_POINTER);
976 
977  schema1 = NULL;
978  /* no error if ns uri does not exist */
979  ole_check(IXMLDOMSchemaCollection_get(cache1, _bstr_(xsd_schema1_uri), (IXMLDOMNode**)&schema1));
980  ok(!schema1, "expected NULL\n");
981  /* a NULL bstr corresponds to no-uri ns */
982  ole_check(IXMLDOMSchemaCollection_get(cache1, NULL, (IXMLDOMNode**)&schema1));
983  ok(!schema1, "expected NULL\n");
984  /* error if return pointer is NULL */
985  ole_expect(IXMLDOMSchemaCollection_get(cache1, _bstr_(xdr_schema1_uri), NULL), E_POINTER);
986 
987  for (i = 0; i < 3; ++i)
988  {
989  bstr = NULL;
990  ole_check(IXMLDOMSchemaCollection_get_namespaceURI(cache1, i, &bstr));
991  ok(bstr != NULL && *bstr, "expected non-empty string\n");
992  content[i] = bstr;
993 
994  for (j = 0; j < i; ++j)
995  ok(winetest_strcmpW(content[j], bstr), "got duplicate entry\n");
996  }
997 
998  for (i = 0; i < 3; ++i)
999  {
1001  content[i] = NULL;
1002  }
1003 
1004  if (cache2)
1005  {
1006  for (i = 0; i < 5; ++i)
1007  {
1008  bstr = NULL;
1009  ole_check(IXMLDOMSchemaCollection_get_namespaceURI(cache2, i, &bstr));
1010  ok(bstr != NULL && *bstr, "expected non-empty string\n");
1011 
1012  for (j = 0; j < i; ++j)
1013  ok(winetest_strcmpW(content[j], bstr), "got duplicate entry\n");
1014  content[i] = bstr;
1015  }
1016 
1017  for (i = 0; i < 5; ++i)
1018  {
1020  content[i] = NULL;
1021  }
1022  }
1023 
1024  IXMLDOMSchemaCollection_Release(cache1);
1025  if (cache2) IXMLDOMSchemaCollection_Release(cache2);
1026 
1027  free_bstrs();
1028 }
static const CHAR xsd_schema1_uri[]
Definition: schema.c:101
#define ole_expect(expr, expect)
Definition: schema.c:431
HRESULT hr
Definition: shlfolder.c:183
static const CHAR xdr_schema2_xml[]
Definition: schema.c:70
#define ole_check(expr)
Definition: schema.c:426
OLECHAR * BSTR
Definition: compat.h:2152
#define E_FAIL
Definition: ddrawi.h:102
short VARIANT_BOOL
Definition: compat.h:2149
static const CHAR xdr_schema2_uri[]
Definition: schema.c:69
long LONG
Definition: pedump.c:60
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
content
Definition: atl_ax.c:993
static const CHAR xsd_schema1_xml[]
Definition: schema.c:102
static const CHAR xdr_schema1_xml[]
Definition: schema.c:52
static int winetest_strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: test.h:89
static const CHAR xsd_schema2_xml[]
Definition: schema.c:116
#define b
Definition: ke_i.h:79
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static const CHAR xsd_schema3_uri[]
Definition: schema.c:129
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
LONG HRESULT
Definition: typedefs.h:79
static const CHAR xdr_schema3_uri[]
Definition: schema.c:85
#define create_document_version(v, iid)
Definition: schema.c:501
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define NULL
Definition: types.h:112
static const CHAR xdr_schema1_uri[]
Definition: schema.c:51
#define EXPECT_HR(hr, hr_exp)
Definition: schema.c:40
static BSTR _bstr_(const char *str)
Definition: schema.c:462
static const CHAR xsd_schema3_xml[]
Definition: schema.c:130
static const CHAR xsd_schema2_uri[]
Definition: schema.c:115
#define E_POINTER
Definition: winerror.h:2365
#define create_cache_version(v, iid)
Definition: schema.c:505
static VARIANT _variantdoc_(void *doc)
Definition: schema.c:477
static const CHAR xdr_schema3_xml[]
Definition: schema.c:86
static void free_bstrs(void)
Definition: schema.c:469

Referenced by START_TEST().

◆ test_collection_refs()

static void test_collection_refs ( void  )
static

Definition at line 670 of file schema.c.

671 {
672  IXMLDOMDocument2 *schema1, *schema2, *schema3;
673  IXMLDOMSchemaCollection *cache1, *cache2, *cache3;
674  VARIANT_BOOL b;
675  LONG length;
676 
677  schema1 = create_document(&IID_IXMLDOMDocument2);
678  ok(schema1 != NULL, "Failed to create a document.\n");
679 
680  cache1 = create_cache(&IID_IXMLDOMSchemaCollection);
681  ok(cache1 != NULL, "Failed to create schema collection.\n");
682 
683  if (!schema1 || !cache1)
684  {
685  if (schema1)
686  IXMLDOMDocument2_Release(schema1);
687  if (cache1)
688  IXMLDOMSchemaCollection_Release(cache1);
689  return;
690  }
691 
692  schema2 = create_document(&IID_IXMLDOMDocument2);
693  schema3 = create_document(&IID_IXMLDOMDocument2);
694 
695  cache2 = create_cache(&IID_IXMLDOMSchemaCollection);
696  cache3 = create_cache(&IID_IXMLDOMSchemaCollection);
697 
698  ole_check(IXMLDOMDocument2_loadXML(schema1, _bstr_(xdr_schema1_xml), &b));
699  ok(b == VARIANT_TRUE, "failed to load XML\n");
700 
701  ole_check(IXMLDOMDocument2_loadXML(schema2, _bstr_(xdr_schema2_xml), &b));
702  ok(b == VARIANT_TRUE, "failed to load XML\n");
703 
704  ole_check(IXMLDOMDocument2_loadXML(schema3, _bstr_(xdr_schema3_xml), &b));
705  ok(b == VARIANT_TRUE, "failed to load XML\n");
706 
707  ole_check(IXMLDOMSchemaCollection_add(cache1, _bstr_(xdr_schema1_uri), _variantdoc_(schema1)));
708  ole_check(IXMLDOMSchemaCollection_add(cache2, _bstr_(xdr_schema2_uri), _variantdoc_(schema2)));
709  ole_check(IXMLDOMSchemaCollection_add(cache3, _bstr_(xdr_schema3_uri), _variantdoc_(schema3)));
710 
711  check_ref_expr(IXMLDOMDocument2_Release(schema1), 0);
712  check_ref_expr(IXMLDOMDocument2_Release(schema2), 0);
713  check_ref_expr(IXMLDOMDocument2_Release(schema3), 0);
714  schema1 = NULL;
715  schema2 = NULL;
716  schema3 = NULL;
717 
718  /* releasing the original doc does not affect the schema cache */
719  ole_check(IXMLDOMSchemaCollection_get(cache1, _bstr_(xdr_schema1_uri), (IXMLDOMNode**)&schema1));
720  ole_check(IXMLDOMSchemaCollection_get(cache2, _bstr_(xdr_schema2_uri), (IXMLDOMNode**)&schema2));
721  ole_check(IXMLDOMSchemaCollection_get(cache3, _bstr_(xdr_schema3_uri), (IXMLDOMNode**)&schema3));
722 
723  /* we get a read-only domdoc interface, created just for us */
724  if (schema1) check_refs(IXMLDOMDocument2, schema1, 1);
725  if (schema2) check_refs(IXMLDOMDocument2, schema2, 1);
726  if (schema3) check_refs(IXMLDOMDocument2, schema3, 1);
727 
728  ole_expect(IXMLDOMSchemaCollection_addCollection(cache1, NULL), E_POINTER);
729  ole_check(IXMLDOMSchemaCollection_addCollection(cache2, cache1));
730  ole_check(IXMLDOMSchemaCollection_addCollection(cache3, cache2));
731 
732  length = -1;
733  ole_check(IXMLDOMSchemaCollection_get_length(cache1, &length));
734  ok(length == 1, "expected length 1, got %i\n", length);
735 
736  length = -1;
737  ole_check(IXMLDOMSchemaCollection_get_length(cache2, &length));
738  ok(length == 2, "expected length 2, got %i\n", length);
739 
740  length = -1;
741  ole_check(IXMLDOMSchemaCollection_get_length(cache3, &length));
742  ok(length == 3, "expected length 3, got %i\n", length);
743 
744 
745  /* merging collections does not affect the ref count */
746  check_refs(IXMLDOMSchemaCollection, cache1, 1);
747  check_refs(IXMLDOMSchemaCollection, cache2, 1);
748  check_refs(IXMLDOMSchemaCollection, cache3, 1);
749 
750  /* nor does it affect the domdoc instances */
751  if (schema1) check_refs(IXMLDOMDocument2, schema1, 1);
752  if (schema2) check_refs(IXMLDOMDocument2, schema2, 1);
753  if (schema3) check_refs(IXMLDOMDocument2, schema3, 1);
754 
755  if (schema1) check_ref_expr(IXMLDOMDocument2_Release(schema1), 0);
756  if (schema2) check_ref_expr(IXMLDOMDocument2_Release(schema2), 0);
757  if (schema3) check_ref_expr(IXMLDOMDocument2_Release(schema3), 0);
758  schema1 = NULL;
759  schema2 = NULL;
760  schema3 = NULL;
761 
762  /* releasing the domdoc instances doesn't change the cache */
763  ole_check(IXMLDOMSchemaCollection_get(cache1, _bstr_(xdr_schema1_uri), (IXMLDOMNode**)&schema1));
764  ole_check(IXMLDOMSchemaCollection_get(cache2, _bstr_(xdr_schema2_uri), (IXMLDOMNode**)&schema2));
765  ole_check(IXMLDOMSchemaCollection_get(cache3, _bstr_(xdr_schema3_uri), (IXMLDOMNode**)&schema3));
766 
767  /* we can just get them again */
768  if (schema1) check_refs(IXMLDOMDocument2, schema1, 1);
769  if (schema2) check_refs(IXMLDOMDocument2, schema2, 1);
770  if (schema3) check_refs(IXMLDOMDocument2, schema3, 1);
771 
772  /* releasing the caches does not affect the domdoc instances */
773  check_ref_expr(IXMLDOMSchemaCollection_Release(cache1), 0);
774  check_ref_expr(IXMLDOMSchemaCollection_Release(cache2), 0);
775  check_ref_expr(IXMLDOMSchemaCollection_Release(cache3), 0);
776 
777  /* they're just for us */
778  if (schema1) check_refs(IXMLDOMDocument2, schema1, 1);
779  if (schema2) check_refs(IXMLDOMDocument2, schema2, 1);
780  if (schema3) check_refs(IXMLDOMDocument2, schema3, 1);
781 
782  if (schema1) check_ref_expr(IXMLDOMDocument2_Release(schema1), 0);
783  if (schema2) check_ref_expr(IXMLDOMDocument2_Release(schema2), 0);
784  if (schema3) check_ref_expr(IXMLDOMDocument2_Release(schema3), 0);
785 
786  free_bstrs();
787 }
#define ole_expect(expr, expect)
Definition: schema.c:431
static const CHAR xdr_schema2_xml[]
Definition: schema.c:70
#define ole_check(expr)
Definition: schema.c:426
short VARIANT_BOOL
Definition: compat.h:2149
static const CHAR xdr_schema2_uri[]
Definition: schema.c:69
long LONG
Definition: pedump.c:60
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
static const CHAR xdr_schema1_xml[]
Definition: schema.c:52
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
static const CHAR xdr_schema3_uri[]
Definition: schema.c:85
#define create_cache(iid)
Definition: schema.c:503
#define check_refs(iface, obj, n)
Definition: schema.c:419
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define create_document(iid)
Definition: schema.c:499
static const CHAR xdr_schema1_uri[]
Definition: schema.c:51
static BSTR _bstr_(const char *str)
Definition: schema.c:462
#define check_ref_expr(expr, n)
Definition: schema.c:414
#define E_POINTER
Definition: winerror.h:2365
static VARIANT _variantdoc_(void *doc)
Definition: schema.c:477
static const CHAR xdr_schema3_xml[]
Definition: schema.c:86
static void free_bstrs(void)
Definition: schema.c:469

Referenced by START_TEST().

◆ test_dispex()

static void test_dispex ( void  )
static

Definition at line 1493 of file schema.c.

1494 {
1495  IXMLDOMSchemaCollection *cache;
1496  IDispatchEx *dispex;
1497  IUnknown *unk;
1498  HRESULT hr;
1499  DISPPARAMS dispparams;
1500  VARIANT arg, ret;
1501 
1502  cache = create_cache(&IID_IXMLDOMSchemaCollection);
1503  if (!cache) return;
1504 
1505  hr = IXMLDOMSchemaCollection_QueryInterface(cache, &IID_IUnknown, (void**)&unk);
1506  EXPECT_HR(hr, S_OK);
1507  test_obj_dispex(unk);
1508  IUnknown_Release(unk);
1509 
1510  hr = IXMLDOMSchemaCollection_QueryInterface(cache, &IID_IDispatchEx, (void**)&dispex);
1511  ok(hr == S_OK, "got 0x%08x\n", hr);
1512 
1513  V_VT(&arg) = VT_I4;
1514  V_I4(&arg) = 0;
1515  dispparams.cArgs = 1;
1516  dispparams.cNamedArgs = 0;
1517  dispparams.rgdispidNamedArgs = NULL;
1518  dispparams.rgvarg = &arg;
1519 
1520  V_VT(&ret) = VT_EMPTY;
1521  V_DISPATCH(&ret) = (void*)0x1;
1522  hr = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &ret, NULL, NULL);
1523  ok(hr == DISP_E_MEMBERNOTFOUND, "got 0x%08x\n", hr);
1524  ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret));
1525  ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret));
1526 
1527  IDispatchEx_Release(dispex);
1528  IXMLDOMSchemaCollection_Release(cache);
1529 
1530  cache = create_cache_version(60, &IID_IXMLDOMSchemaCollection);
1531  if (cache)
1532  {
1534  IXMLDOMSchemaCollection_Release(cache);
1535  }
1536 }
Definition: cache.c:48
Definition: compat.h:2157
HRESULT hr
Definition: shlfolder.c:183
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void * arg
Definition: msvc.h:10
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
LONG HRESULT
Definition: typedefs.h:79
const GUID IID_IUnknown
int ret
#define IID_NULL
Definition: guiddef.h:98
static IOleCache * cache
Definition: ole2.c:75
#define V_VT(A)
Definition: oleauto.h:211
#define create_cache(iid)
Definition: schema.c:503
#define S_OK
Definition: intsafe.h:51
#define ok(value,...)
Definition: atltest.h:57
static void test_obj_dispex(IUnknown *obj)
Definition: schema.c:1439
#define NULL
Definition: types.h:112
#define EXPECT_HR(hr, hr_exp)
Definition: schema.c:40
struct stdole::DISPPARAMS DISPPARAMS
#define create_cache_version(v, iid)
Definition: schema.c:505

Referenced by START_TEST().

◆ test_get()

static void test_get ( void  )
static

Definition at line 1538 of file schema.c.

1539 {
1540  IXMLDOMSchemaCollection2 *cache;
1541  IXMLDOMNode *node;
1542  HRESULT hr;
1543 
1544  cache = create_cache_version(60, &IID_IXMLDOMSchemaCollection2);
1545  if (!cache) return;
1546 
1547  hr = IXMLDOMSchemaCollection2_get(cache, NULL, NULL);
1548  ok(hr == E_NOTIMPL || hr == E_POINTER /* win8 */, "got %08x\n", hr);
1549 
1550  hr = IXMLDOMSchemaCollection2_get(cache, _bstr_("uri"), &node);
1552 
1553  IXMLDOMSchemaCollection2_Release(cache);
1554 
1555  cache = create_cache_version(40, &IID_IXMLDOMSchemaCollection2);
1556  if (!cache) return;
1557 
1558  hr = IXMLDOMSchemaCollection2_get(cache, NULL, NULL);
1560 
1561  hr = IXMLDOMSchemaCollection2_get(cache, _bstr_("uri"), &node);
1562  EXPECT_HR(hr, S_OK);
1563 
1564  IXMLDOMSchemaCollection2_Release(cache);
1565  free_bstrs();
1566 }
Definition: cache.c:48
HRESULT hr
Definition: shlfolder.c:183
struct node node
LONG HRESULT
Definition: typedefs.h:79
static IOleCache * cache
Definition: ole2.c:75
#define S_OK
Definition: intsafe.h:51
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define EXPECT_HR(hr, hr_exp)
Definition: schema.c:40
static BSTR _bstr_(const char *str)
Definition: schema.c:462
#define E_POINTER
Definition: winerror.h:2365
#define create_cache_version(v, iid)
Definition: schema.c:505
Definition: dlist.c:348
static void free_bstrs(void)
Definition: schema.c:469

Referenced by START_TEST().

◆ test_ifaces()

static void test_ifaces ( void  )
static

Definition at line 1660 of file schema.c.

1661 {
1662  IXMLDOMSchemaCollection2 *cache;
1663  IUnknown *unk;
1664  HRESULT hr;
1665 
1666  cache = create_cache_version(60, &IID_IXMLDOMSchemaCollection2);
1667  if (!cache) return;
1668 
1669  /* CLSID_XMLSchemaCache60 is returned as an interface (the same as IXMLDOMSchemaCollection2). */
1670  hr = IXMLDOMSchemaCollection2_QueryInterface(cache, &CLSID_XMLSchemaCache60, (void**)&unk);
1671  ok (hr == S_OK, "Could not get CLSID_XMLSchemaCache60 iface: %08x\n", hr);
1672  ok (unk == (IUnknown*)cache, "unk != cache\n");
1673 
1674  IUnknown_Release(unk);
1675  IXMLDOMSchemaCollection2_Release(cache);
1676 }
Definition: cache.c:48
HRESULT hr
Definition: shlfolder.c:183
LONG HRESULT
Definition: typedefs.h:79
static IOleCache * cache
Definition: ole2.c:75
#define S_OK
Definition: intsafe.h:51
#define ok(value,...)
Definition: atltest.h:57
#define create_cache_version(v, iid)
Definition: schema.c:505

Referenced by START_TEST().

◆ test_length()

static void test_length ( void  )
static

Definition at line 789 of file schema.c.

790 {
791  IXMLDOMDocument2 *schema1, *schema2, *schema3;
792  IXMLDOMSchemaCollection *cache;
793  VARIANT_BOOL b;
794  VARIANT v;
795  LONG length;
796 
797  schema1 = create_document(&IID_IXMLDOMDocument2);
798  schema2 = create_document(&IID_IXMLDOMDocument2);
799  schema3 = create_document(&IID_IXMLDOMDocument2);
800 
801  cache = create_cache(&IID_IXMLDOMSchemaCollection);
802 
803  if (!schema1 || !schema2 || !schema3 || !cache)
804  {
805  if (schema1) IXMLDOMDocument2_Release(schema1);
806  if (schema2) IXMLDOMDocument2_Release(schema2);
807  if (schema3) IXMLDOMDocument2_Release(schema3);
808 
809  if (cache) IXMLDOMSchemaCollection_Release(cache);
810 
811  return;
812  }
813 
814  VariantInit(&v);
815 
816  ole_check(IXMLDOMDocument2_loadXML(schema1, _bstr_(xdr_schema1_xml), &b));
817  ok(b == VARIANT_TRUE, "failed to load XML\n");
818 
819  ole_check(IXMLDOMDocument2_loadXML(schema2, _bstr_(xdr_schema2_xml), &b));
820  ok(b == VARIANT_TRUE, "failed to load XML\n");
821 
822  ole_check(IXMLDOMDocument2_loadXML(schema3, _bstr_(xdr_schema3_xml), &b));
823  ok(b == VARIANT_TRUE, "failed to load XML\n");
824 
825  ole_expect(IXMLDOMSchemaCollection_get_length(cache, NULL), E_POINTER);
826 
827  /* MSDN lies; removing a nonexistent entry produces no error */
828  ole_check(IXMLDOMSchemaCollection_remove(cache, NULL));
829  ole_check(IXMLDOMSchemaCollection_remove(cache, _bstr_(xdr_schema1_uri)));
830 
831  length = -1;
832  ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
833  ok(length == 0, "expected length 0, got %i\n", length);
834 
835  ole_check(IXMLDOMSchemaCollection_add(cache, _bstr_(xdr_schema1_uri), _variantdoc_(schema1)));
836 
837  length = -1;
838  ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
839  ok(length == 1, "expected length 1, got %i\n", length);
840 
841  ole_check(IXMLDOMSchemaCollection_add(cache, _bstr_(xdr_schema2_uri), _variantdoc_(schema2)));
842 
843  length = -1;
844  ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
845  ok(length == 2, "expected length 2, got %i\n", length);
846 
847  ole_check(IXMLDOMSchemaCollection_add(cache, _bstr_(xdr_schema3_uri), _variantdoc_(schema3)));
848 
849  length = -1;
850  ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
851  ok(length == 3, "expected length 3, got %i\n", length);
852 
853  /* adding with VT_NULL is the same as removing */
854  V_VT(&v) = VT_NULL;
855  ole_check(IXMLDOMSchemaCollection_add(cache, _bstr_(xdr_schema1_uri), v));
856 
857  length = -1;
858  ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
859  ok(length == 2, "expected length 2, got %i\n", length);
860 
861  ole_check(IXMLDOMSchemaCollection_remove(cache, _bstr_(xdr_schema2_uri)));
862 
863  length = -1;
864  ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
865  ok(length == 1, "expected length 1, got %i\n", length);
866 
867  ole_check(IXMLDOMSchemaCollection_remove(cache, _bstr_(xdr_schema3_uri)));
868 
869  length = -1;
870  ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
871  ok(length == 0, "expected length 0, got %i\n", length);
872 
873  IXMLDOMDocument2_Release(schema1);
874  IXMLDOMDocument2_Release(schema2);
875  IXMLDOMDocument2_Release(schema3);
876  IXMLDOMSchemaCollection_Release(cache);
877 
878  free_bstrs();
879 }
Definition: cache.c:48
#define ole_expect(expr, expect)
Definition: schema.c:431
static const CHAR xdr_schema2_xml[]
Definition: schema.c:70
#define ole_check(expr)
Definition: schema.c:426
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
short VARIANT_BOOL
Definition: compat.h:2149
static const CHAR xdr_schema2_uri[]
Definition: schema.c:69
long LONG
Definition: pedump.c:60
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
static const CHAR xdr_schema1_xml[]
Definition: schema.c:52
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
static const CHAR xdr_schema3_uri[]
Definition: schema.c:85
static IOleCache * cache
Definition: ole2.c:75
#define V_VT(A)
Definition: oleauto.h:211
#define create_cache(iid)
Definition: schema.c:503
const GLdouble * v
Definition: gl.h:2040
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define create_document(iid)
Definition: schema.c:499
static const CHAR xdr_schema1_uri[]
Definition: schema.c:51
static BSTR _bstr_(const char *str)
Definition: schema.c:462
#define E_POINTER
Definition: winerror.h:2365
static VARIANT _variantdoc_(void *doc)
Definition: schema.c:477
static const CHAR xdr_schema3_xml[]
Definition: schema.c:86
static void free_bstrs(void)
Definition: schema.c:469

Referenced by START_TEST().

◆ test_obj_dispex()

static void test_obj_dispex ( IUnknown obj)
static

Definition at line 1439 of file schema.c.

1440 {
1441  static const WCHAR testW[] = {'t','e','s','t','p','r','o','p',0};
1442  static const WCHAR starW[] = {'*',0};
1444  IDispatchEx *dispex;
1445  IUnknown *unk;
1446  DWORD props;
1447  UINT ticnt;
1448  HRESULT hr;
1449  BSTR name;
1450 
1451  hr = IUnknown_QueryInterface(obj, &IID_IDispatchEx, (void**)&dispex);
1452  EXPECT_HR(hr, S_OK);
1453  if (FAILED(hr)) return;
1454 
1455  ticnt = 0;
1456  hr = IDispatchEx_GetTypeInfoCount(dispex, &ticnt);
1457  EXPECT_HR(hr, S_OK);
1458  ok(ticnt == 1, "ticnt=%u\n", ticnt);
1459 
1461  hr = IDispatchEx_DeleteMemberByName(dispex, name, fdexNameCaseSensitive);
1464 
1465  hr = IDispatchEx_DeleteMemberByDispID(dispex, dispid);
1467 
1468  props = 0;
1469  hr = IDispatchEx_GetMemberProperties(dispex, dispid, grfdexPropCanAll, &props);
1471  ok(props == 0, "expected 0 got %d\n", props);
1472 
1473  hr = IDispatchEx_GetMemberName(dispex, dispid, &name);
1475  if (SUCCEEDED(hr)) SysFreeString(name);
1476 
1477  hr = IDispatchEx_GetNextDispID(dispex, fdexEnumDefault, DISPID_XMLDOM_SCHEMACOLLECTION_ADD, &dispid);
1479 
1480  unk = (IUnknown*)0xdeadbeef;
1481  hr = IDispatchEx_GetNameSpaceParent(dispex, &unk);
1483  ok(unk == (IUnknown*)0xdeadbeef, "got %p\n", unk);
1484 
1486  hr = IDispatchEx_GetDispID(dispex, name, fdexNameEnsure, &dispid);
1487  ok(hr == DISP_E_UNKNOWNNAME, "got 0x%08x\n", hr);
1489 
1490  IDispatchEx_Release(dispex);
1491 }
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
#define DISPID_XMLDOM_SCHEMACOLLECTION_ADD
Definition: msxml2did.h:292
HRESULT hr
Definition: shlfolder.c:183
OLECHAR * BSTR
Definition: compat.h:2152
grfdexPropCanAll(fdexPropCanGet|fdexPropCanPut|fdexPropCanPutRef|\\") cpp_quote(" fdexPropCanCall|fdexPropCanConstruct|fdexPropCanSourceEvents)") cpp_quote("cpp_quote(" (fdexPropCannotGet | fdexPropCannotPut | fdexPropCannotPutRef | \\") cpp_quote(" fdexPropCannotCall | fdexPropCannotConstruct | fdexPropCannotSourceEvents)") cpp_quote("cpp_quote("(fdexPropNoSideEffects|fdexPropDynamicType)") cpp_quote("cpp_quote(" (grfdexPropCanAll | grfdexPropCannotAll | grfdexPropExtraAll)") cpp_quote(" cpp_quote("cpp_quote(" [ object
if SUCCEEDED(hr)
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DISPID_SAX_XMLREADER_GETFEATURE
Definition: msxml2did.h:342
#define S_OK
Definition: intsafe.h:51
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
unsigned int UINT
Definition: ndis.h:50
static const WCHAR starW[]
Definition: symbol.c:41
#define EXPECT_HR(hr, hr_exp)
Definition: schema.c:40
Definition: name.c:38
static const WCHAR props[]
Definition: wbemdisp.c:288
static const WCHAR testW[]
Definition: jsregexp.c:44
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by test_dispex().

◆ test_remove()

static void test_remove ( void  )
static

Definition at line 1568 of file schema.c.

1569 {
1570  IXMLDOMSchemaCollection2 *cache;
1571  IXMLDOMDocument *doc;
1572  VARIANT_BOOL b;
1573  HRESULT hr;
1574  VARIANT v;
1575  LONG len;
1576 
1577  cache = create_cache_version(60, &IID_IXMLDOMSchemaCollection2);
1578  if (!cache) return;
1579 
1580  doc = create_document_version(60, &IID_IXMLDOMDocument);
1581  ok(doc != NULL, "got %p\n", doc);
1582 
1583  hr = IXMLDOMDocument_loadXML(doc, _bstr_(xsd_schema1_xml), &b);
1584  EXPECT_HR(hr, S_OK);
1585 
1586  V_VT(&v) = VT_DISPATCH;
1587  V_DISPATCH(&v) = (IDispatch*)doc;
1588  hr = IXMLDOMSchemaCollection2_add(cache, _bstr_(xsd_schema1_uri), v);
1589  EXPECT_HR(hr, S_OK);
1590 
1591  len = -1;
1592  hr = IXMLDOMSchemaCollection2_get_length(cache, &len);
1593  EXPECT_HR(hr, S_OK);
1594  ok(len == 1, "got %d\n", len);
1595 
1596  /* ::remove() is a stub for version 6 */
1597  hr = IXMLDOMSchemaCollection2_remove(cache, NULL);
1599 
1600  hr = IXMLDOMSchemaCollection2_remove(cache, _bstr_("invaliduri"));
1602 
1603  hr = IXMLDOMSchemaCollection2_remove(cache, _bstr_(xsd_schema1_uri));
1605 
1606  len = -1;
1607  hr = IXMLDOMSchemaCollection2_get_length(cache, &len);
1608  EXPECT_HR(hr, S_OK);
1609  ok(len == 1, "got %d\n", len);
1610 
1611  IXMLDOMDocument_Release(doc);
1612  IXMLDOMSchemaCollection2_Release(cache);
1613  free_bstrs();
1614 
1615  /* ::remove() works for version 4 */
1616  cache = create_cache_version(40, &IID_IXMLDOMSchemaCollection2);
1617  if (!cache) return;
1618 
1619  doc = create_document_version(40, &IID_IXMLDOMDocument);
1620  ok(doc != NULL, "got %p\n", doc);
1621 
1622  hr = IXMLDOMDocument_loadXML(doc, _bstr_(xsd_schema1_xml), &b);
1623  EXPECT_HR(hr, S_OK);
1624 
1625  V_VT(&v) = VT_DISPATCH;
1626  V_DISPATCH(&v) = (IDispatch*)doc;
1627  hr = IXMLDOMSchemaCollection2_add(cache, _bstr_(xsd_schema1_uri), v);
1628  EXPECT_HR(hr, S_OK);
1629 
1630  len = -1;
1631  hr = IXMLDOMSchemaCollection2_get_length(cache, &len);
1632  EXPECT_HR(hr, S_OK);
1633  ok(len == 1, "got %d\n", len);
1634 
1635  hr = IXMLDOMSchemaCollection2_remove(cache, NULL);
1636  EXPECT_HR(hr, S_OK);
1637 
1638  hr = IXMLDOMSchemaCollection2_remove(cache, _bstr_("invaliduri"));
1639  EXPECT_HR(hr, S_OK);
1640 
1641  len = -1;
1642  hr = IXMLDOMSchemaCollection2_get_length(cache, &len);
1643  EXPECT_HR(hr, S_OK);
1644  ok(len == 1, "got %d\n", len);
1645 
1646  hr = IXMLDOMSchemaCollection2_remove(cache, _bstr_(xsd_schema1_uri));
1647  EXPECT_HR(hr, S_OK);
1648 
1649  len = -1;
1650  hr = IXMLDOMSchemaCollection2_get_length(cache, &len);
1651  EXPECT_HR(hr, S_OK);
1652  ok(len == 0, "got %d\n", len);
1653 
1654  IXMLDOMDocument_Release(doc);
1655  IXMLDOMSchemaCollection2_Release(cache);
1656 
1657  free_bstrs();
1658 }
Definition: cache.c:48
static const CHAR xsd_schema1_uri[]
Definition: schema.c:101
HRESULT hr
Definition: shlfolder.c:183
short VARIANT_BOOL
Definition: compat.h:2149
#define V_DISPATCH(A)
Definition: oleauto.h:239
long LONG
Definition: pedump.c:60
static const CHAR xsd_schema1_xml[]
Definition: schema.c:102
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
LONG HRESULT
Definition: typedefs.h:79
static IOleCache * cache
Definition: ole2.c:75
#define V_VT(A)
Definition: oleauto.h:211
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:51
const GLdouble * v
Definition: gl.h:2040
#define create_document_version(v, iid)
Definition: schema.c:501
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define EXPECT_HR(hr, hr_exp)
Definition: schema.c:40
static BSTR _bstr_(const char *str)
Definition: schema.c:462
#define create_cache_version(v, iid)
Definition: schema.c:505
static void free_bstrs(void)
Definition: schema.c:469

Referenced by START_TEST().

◆ test_schema_refs()

static void test_schema_refs ( void  )
static

Definition at line 507 of file schema.c.

508 {
509  static const WCHAR emptyW[] = {0};
510  IXMLDOMDocument2 *doc;
511  IXMLDOMNode *node;
512  IXMLDOMSchemaCollection *cache;
513  VARIANT v;
514  VARIANT_BOOL b;
515  BSTR str;
516  LONG len;
517  HRESULT hr;
518 
519  doc = create_document(&IID_IXMLDOMDocument2);
520  if (!doc)
521  return;
522 
523  cache = create_cache(&IID_IXMLDOMSchemaCollection);
524  if(!cache)
525  {
526  IXMLDOMDocument2_Release(doc);
527  return;
528  }
529 
530  VariantInit(&v);
532  ole_check(IXMLDOMDocument2_loadXML(doc, str, &b));
533  ok(b == VARIANT_TRUE, "b %04x\n", b);
535 
536  node = (void*)0xdeadbeef;
537  ole_check(IXMLDOMSchemaCollection_get(cache, NULL, &node));
538  ok(node == NULL, "%p\n", node);
539 
540  /* NULL uri pointer, still adds a document */
541  ole_check(IXMLDOMSchemaCollection_add(cache, NULL, _variantdoc_(doc)));
542  len = -1;
543  ole_check(IXMLDOMSchemaCollection_get_length(cache, &len));
544  ok(len == 1, "got %d\n", len);
545  /* read back - empty valid BSTR */
546  str = NULL;
547  ole_check(IXMLDOMSchemaCollection_get_namespaceURI(cache, 0, &str));
548  ok(str && *str == 0, "got %p\n", str);
550 
551  node = NULL;
552  ole_check(IXMLDOMSchemaCollection_get(cache, NULL, &node));
553  ok(node != NULL, "%p\n", node);
554  IXMLDOMNode_Release(node);
555 
556  node = NULL;
558  ole_check(IXMLDOMSchemaCollection_get(cache, str, &node));
559  ok(node != NULL, "%p\n", node);
560  IXMLDOMNode_Release(node);
562 
563  /* remove with NULL uri */
564  ole_check(IXMLDOMSchemaCollection_remove(cache, NULL));
565  len = -1;
566  ole_check(IXMLDOMSchemaCollection_get_length(cache, &len));
567  ok(len == 0, "got %d\n", len);
568 
569  /* same, but with VT_UNKNOWN type */
570  V_VT(&v) = VT_UNKNOWN;
571  V_UNKNOWN(&v) = (IUnknown*)doc;
572  hr = IXMLDOMSchemaCollection_add(cache, NULL, v);
573  ok(hr == S_OK, "got 0x%08x\n", hr);
574 
575  len = -1;
576  hr = IXMLDOMSchemaCollection_get_length(cache, &len);
577  ok(hr == S_OK, "got 0x%08x\n", hr);
578  ok(len == 1, "got %d\n", len);
579 
580  hr = IXMLDOMSchemaCollection_remove(cache, NULL);
581  ok(hr == S_OK, "got 0x%08x\n", hr);
582  len = -1;
583  hr = IXMLDOMSchemaCollection_get_length(cache, &len);
584  ok(hr == S_OK, "got 0x%08x\n", hr);
585  ok(len == 0, "got %d\n", len);
586 
588  ole_check(IXMLDOMSchemaCollection_add(cache, str, _variantdoc_(doc)));
589 
590  /* IXMLDOMSchemaCollection_add doesn't add a ref on doc */
591  check_refs(IXMLDOMDocument2, doc, 1);
592 
594 
595  V_VT(&v) = VT_INT;
596  ole_expect(IXMLDOMDocument2_get_schemas(doc, &v), S_FALSE);
597  ok(V_VT(&v) == VT_NULL, "vt %x\n", V_VT(&v));
598 
599  check_ref_expr(IXMLDOMSchemaCollection_AddRef(cache), 2);
600  V_VT(&v) = VT_DISPATCH;
601  V_DISPATCH(&v) = (IDispatch*)cache;
602 
603  /* check that putref_schemas takes a ref */
604  ole_check(IXMLDOMDocument2_putref_schemas(doc, v));
605  check_refs(IXMLDOMSchemaCollection, cache, 3);
606 
607  VariantClear(&v); /* refs now 2 */
608 
609  V_VT(&v) = VT_INT;
610  /* check that get_schemas adds a ref */
611  ole_check(IXMLDOMDocument2_get_schemas(doc, &v));
612  ok(V_VT(&v) == VT_DISPATCH, "vt %x\n", V_VT(&v));
613  check_refs(IXMLDOMSchemaCollection, cache, 3);
614 
615  /* get_schemas doesn't release a ref if passed VT_DISPATCH - ie it doesn't call VariantClear() */
616  ole_check(IXMLDOMDocument2_get_schemas(doc, &v));
617  ok(V_VT(&v) == VT_DISPATCH, "vt %x\n", V_VT(&v));
618  check_refs(IXMLDOMSchemaCollection, cache, 4);
619 
620  /* release the two refs returned by get_schemas */
621  check_ref_expr(IXMLDOMSchemaCollection_Release(cache), 3);
622  check_ref_expr(IXMLDOMSchemaCollection_Release(cache), 2);
623 
624  /* check that taking another ref on the document doesn't change the schema's ref count */
625  check_ref_expr(IXMLDOMDocument2_AddRef(doc), 2);
626  check_refs(IXMLDOMSchemaCollection, cache, 2);
627  check_ref_expr(IXMLDOMDocument2_Release(doc), 1);
628 
629  /* call putref_schema with some odd variants */
630  V_VT(&v) = VT_INT;
631  ole_expect(IXMLDOMDocument2_putref_schemas(doc, v), E_FAIL);
632  check_refs(IXMLDOMSchemaCollection, cache, 2);
633 
634  /* calling with VT_EMPTY releases the schema */
635  V_VT(&v) = VT_EMPTY;
636  ole_check(IXMLDOMDocument2_putref_schemas(doc, v));
637  check_refs(IXMLDOMSchemaCollection, cache, 1);
638 
639  /* try setting with VT_UNKNOWN */
640  check_ref_expr(IXMLDOMSchemaCollection_AddRef(cache), 2);
641  V_VT(&v) = VT_UNKNOWN;
642  V_UNKNOWN(&v) = (IUnknown*)cache;
643  ole_check(IXMLDOMDocument2_putref_schemas(doc, v));
644  check_refs(IXMLDOMSchemaCollection, cache, 3);
645 
646  VariantClear(&v); /* refs now 2 */
647 
648  /* calling with VT_NULL releases the schema */
649  V_VT(&v) = VT_NULL;
650  ole_check(IXMLDOMDocument2_putref_schemas(doc, v));
651  check_refs(IXMLDOMSchemaCollection, cache, 1);
652 
653  /* refs now 1 */
654  /* set again */
655  check_ref_expr(IXMLDOMSchemaCollection_AddRef(cache), 2);
656  V_VT(&v) = VT_UNKNOWN;
657  V_UNKNOWN(&v) = (IUnknown*)cache;
658  ole_check(IXMLDOMDocument2_putref_schemas(doc, v));
659  check_refs(IXMLDOMSchemaCollection, cache, 3);
660 
661  VariantClear(&v); /* refs now 2 */
662 
663  /* release the final ref on the doc which should release its ref on the schema */
664  check_ref_expr(IXMLDOMDocument2_Release(doc), 0);
665 
666  check_refs(IXMLDOMSchemaCollection, cache, 1);
667  check_ref_expr(IXMLDOMSchemaCollection_Release(cache), 0);
668 }
Definition: cache.c:48
static const WCHAR xdr_schema_xml[]
Definition: schema.c:45
#define ole_expect(expr, expect)
Definition: schema.c:431
HRESULT hr
Definition: shlfolder.c:183
#define ole_check(expr)
Definition: schema.c:426
OLECHAR * BSTR
Definition: compat.h:2152
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define E_FAIL
Definition: ddrawi.h:102
short VARIANT_BOOL
Definition: compat.h:2149
#define V_DISPATCH(A)
Definition: oleauto.h:239
struct node node
long LONG
Definition: pedump.c:60
#define S_FALSE
Definition: winerror.h:2357
const WCHAR * str
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
static IOleCache * cache
Definition: ole2.c:75
#define V_VT(A)
Definition: oleauto.h:211
GLenum GLsizei len
Definition: glext.h:6722
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define create_cache(iid)
Definition: schema.c:503
#define check_refs(iface, obj, n)
Definition: schema.c:419
#define S_OK
Definition: intsafe.h:51
const GLdouble * v
Definition: gl.h:2040
static const WCHAR emptyW[]
Definition: navigate.c:40
#define ok(value,...)
Definition: atltest.h:57
static const WCHAR xdr_schema_uri[]
Definition: schema.c:43
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define NULL
Definition: types.h:112
#define create_document(iid)
Definition: schema.c:499
#define check_ref_expr(expr, n)
Definition: schema.c:414
static VARIANT _variantdoc_(void *doc)
Definition: schema.c:477
Definition: dlist.c:348

Referenced by START_TEST().

◆ test_validate_on_load()

static void test_validate_on_load ( void  )
static

Definition at line 1419 of file schema.c.

1420 {
1421  IXMLDOMSchemaCollection2 *cache;
1422  VARIANT_BOOL b;
1423  HRESULT hr;
1424 
1425  cache = create_cache_version(40, &IID_IXMLDOMSchemaCollection2);
1426  if (!cache) return;
1427 
1428  hr = IXMLDOMSchemaCollection2_get_validateOnLoad(cache, NULL);
1430 
1431  b = VARIANT_FALSE;
1432  hr = IXMLDOMSchemaCollection2_get_validateOnLoad(cache, &b);
1433  EXPECT_HR(hr, S_OK);
1434  ok(b == VARIANT_TRUE, "got %d\n", b);
1435 
1436  IXMLDOMSchemaCollection2_Release(cache);
1437 }
Definition: cache.c:48
HRESULT hr
Definition: shlfolder.c:183
short VARIANT_BOOL
Definition: compat.h:2149
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
LONG HRESULT
Definition: typedefs.h:79
static IOleCache * cache
Definition: ole2.c:75
#define S_OK
Definition: intsafe.h:51
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define EXPECT_HR(hr, hr_exp)
Definition: schema.c:40
#define E_POINTER
Definition: winerror.h:2365
#define create_cache_version(v, iid)
Definition: schema.c:505

Referenced by START_TEST().

◆ test_XDR_datatypes()

static void test_XDR_datatypes ( void  )
static

Definition at line 1208 of file schema.c.

1209 {
1210  IXMLDOMDocument2 *doc, *schema, *doc2;
1211  IXMLDOMSchemaCollection* cache;
1212  const xdr_datatypes *ptr;
1214  VARIANT_BOOL b;
1215  HRESULT hr;
1216  VARIANT v;
1217  BSTR bstr;
1218  LONG l;
1219 
1220  VariantInit(&v);
1221 
1222  doc = create_document(&IID_IXMLDOMDocument2);
1223  doc2 = create_document(&IID_IXMLDOMDocument2);
1224  schema = create_document(&IID_IXMLDOMDocument2);
1225  cache = create_cache(&IID_IXMLDOMSchemaCollection);
1226 
1227  if (!doc || !doc2 || !schema || !cache)
1228  {
1229  if (doc) IXMLDOMDocument2_Release(doc);
1230  if (doc2) IXMLDOMDocument2_Release(doc2);
1231  if (schema) IXMLDOMDocument2_Release(schema);
1232  if (cache) IXMLDOMSchemaCollection_Release(cache);
1233  return;
1234  }
1235 
1236  hr = IXMLDOMDocument2_loadXML(doc, _bstr_(szDatatypeXML), &b);
1237  EXPECT_HR(hr, S_OK);
1238  ok(b == VARIANT_TRUE, "failed to load XML string\n");
1239 
1240  hr = IXMLDOMDocument2_loadXML(doc2, _bstr_(szDatatypeXML), &b);
1241  EXPECT_HR(hr, S_OK);
1242  ok(b == VARIANT_TRUE, "failed to load XML string\n");
1243 
1244  hr = IXMLDOMDocument2_loadXML(schema, _bstr_(szDatatypeXDR), &b);
1245  EXPECT_HR(hr, S_OK);
1246  ok(b == VARIANT_TRUE, "failed to load XML string\n");
1247 
1248  err = NULL;
1249  hr = IXMLDOMDocument2_validate(doc, &err);
1250  EXPECT_HR(hr, S_FALSE);
1251  ok(err != NULL, "domdoc_validate() should always set err\n");
1252  hr = IXMLDOMParseError_get_errorCode(err, &l);
1253  EXPECT_HR(hr, S_OK);
1254  ok(l == E_XML_NODTD, "got %08x\n", l);
1255  IXMLDOMParseError_Release(err);
1256 
1257  err = NULL;
1258  hr = IXMLDOMDocument2_validate(doc2, &err);
1259  EXPECT_HR(hr, S_FALSE);
1260  ok(err != NULL, "domdoc_validate() should always set err\n");
1261  hr = IXMLDOMParseError_get_errorCode(err, &l);
1262  EXPECT_HR(hr, S_OK);
1263  ok(l == E_XML_NODTD, "got %08x\n", l);
1264  IXMLDOMParseError_Release(err);
1265 
1266  /* now load the schema */
1267  V_VT(&v) = VT_DISPATCH;
1268  V_DISPATCH(&v) = NULL;
1269  hr = IXMLDOMDocument2_QueryInterface(schema, &IID_IDispatch, (void**)&V_DISPATCH(&v));
1270  EXPECT_HR(hr, S_OK);
1271  ok(V_DISPATCH(&v) != NULL, "failed to get IDispatch interface\n");
1272  hr = IXMLDOMSchemaCollection_add(cache, _bstr_("urn:x-schema:datatype-test-xdr"), v);
1273  EXPECT_HR(hr, S_OK);
1274  VariantClear(&v);
1275 
1276  /* associate the cache to the doc */
1277  V_VT(&v) = VT_DISPATCH;
1278  V_DISPATCH(&v) = NULL;
1279  hr = IXMLDOMSchemaCollection_QueryInterface(cache, &IID_IDispatch, (void**)&V_DISPATCH(&v));
1280  EXPECT_HR(hr, S_OK);
1281  ok(V_DISPATCH(&v) != NULL, "failed to get IDispatch interface\n");
1282  hr = IXMLDOMDocument2_putref_schemas(doc2, v);
1283  EXPECT_HR(hr, S_OK);
1284  VariantClear(&v);
1285 
1286  /* validate the doc */
1287  err = NULL;
1288  l = 0;
1289  bstr = NULL;
1290  hr = IXMLDOMDocument2_validate(doc2, &err);
1291  EXPECT_HR(hr, S_OK);
1292  ok(err != NULL, "domdoc_validate() should always set err\n");
1293  hr = IXMLDOMParseError_get_errorCode(err, &l);
1294  EXPECT_HR(hr, S_FALSE);
1295  hr = IXMLDOMParseError_get_reason(err, &bstr);
1296  EXPECT_HR(hr, S_FALSE);
1297  ok(l == 0, "got %08x : %s\n", l, wine_dbgstr_w(bstr));
1298  SysFreeString(bstr);
1299  IXMLDOMParseError_Release(err);
1300 
1302  while (ptr->query)
1303  {
1304  IXMLDOMNode* node = NULL;
1305  VARIANT type;
1306 
1307  /* check data types without the schema */
1308  hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_(ptr->query), &node);
1309  EXPECT_HR(hr, S_OK);
1310  ok(node != NULL, "expected node\n");
1311 
1312  V_VT(&type) = VT_EMPTY;
1313  V_BSTR(&type) = (void*)-1;
1314  hr = IXMLDOMNode_get_dataType(node, &type);
1315  EXPECT_HR(hr, S_FALSE);
1316  ok(V_VT(&type) == VT_NULL, "got type %i\n", V_VT(&type));
1317  /* when returning VT_NULL, the pointer is set to NULL */
1318  ok(V_BSTR(&type) == NULL, "got %p\n", V_BSTR(&type));
1319 
1320  VariantClear(&type);
1321  hr = IXMLDOMNode_get_nodeTypedValue(node, &type);
1322  EXPECT_HR(hr, S_OK);
1323  ok(V_VT(&type) == VT_BSTR, "got variant type %i\n", V_VT(&v));
1324  VariantClear(&type);
1325  IXMLDOMNode_Release(node);
1326 
1327  /* check the data with schema */
1328  node = NULL;
1329  hr = IXMLDOMDocument2_selectSingleNode(doc2, _bstr_(ptr->query), &node);
1330  EXPECT_HR(hr, S_OK);
1331  ok(node != NULL, "expected node\n");
1332 
1333  V_VT(&type) = VT_EMPTY;
1334  hr = IXMLDOMNode_get_dataType(node, &type);
1335  if (ptr->typename)
1336  {
1337  EXPECT_HR(hr, S_OK);
1338  ok(V_VT(&type) == VT_BSTR, "got type %i\n", V_VT(&type));
1339  ok(!lstrcmpW(V_BSTR(&type), _bstr_(ptr->typename)), "got %s\n", wine_dbgstr_w(V_BSTR(&type)));
1340  }
1341  else
1342  {
1343  EXPECT_HR(hr, S_FALSE);
1344  ok(V_VT(&type) == VT_NULL, "%s: got type %i\n", ptr->query, V_VT(&type));
1345  }
1346  VariantClear(&type);
1347 
1348  VariantClear(&v);
1349  hr = IXMLDOMNode_get_nodeTypedValue(node, &v);
1350  EXPECT_HR(hr, S_OK);
1351 
1352  todo_wine_if(ptr->todo)
1353  ok(V_VT(&v) == ptr->type_schema, "%s: got variant type %i\n", ptr->query, V_VT(&v));
1354 
1355  switch (ptr->type_schema)
1356  {
1357  case VT_BOOL:
1358  ok(V_BOOL(&v) == VARIANT_TRUE, "got %x\n", V_BOOL(&v));
1359  break;
1360  case VT_I1:
1361  ok(V_I1(&v) == 42, "got %i\n", V_I1(&v));
1362  break;
1363  case VT_I2:
1364  ok(V_I2(&v) == 420, "got %i\n", V_I2(&v));
1365  break;
1366  case VT_I4:
1367  if (!strcmp(ptr->typename, "int"))
1368  ok(V_I4(&v) == 42, "got %i\n", V_I4(&v));
1369  else if (!strcmp(ptr->typename, "char"))
1370  todo_wine
1371  ok(V_I4(&v) == 'u', "got %x\n", V_I4(&v));
1372  else
1373  ok(V_I4(&v) == -420000000, "got %i\n", V_I4(&v));
1374  break;
1375  case VT_I8:
1376  expect_int64(V_I8(&v), -4200000000, 10);
1377  break;
1378  case VT_R4:
1379  ok(V_R4(&v) == (float)3.14159265, "got %f\n", V_R4(&v));
1380  break;
1381  case VT_R8:
1382  if (!strcmp(ptr->typename, "float"))
1383  ok(V_R8(&v) == 3.14159, "got %f\n", V_R8(&v));
1384  else
1385  todo_wine
1386  ok(V_R8(&v) == 3.14159265358979323846, "got %.20f\n", V_R8(&v));
1387  break;
1388  case VT_UI1:
1389  ok(V_UI1(&v) == 0xFF, "got %02x\n", V_UI1(&v));
1390  break;
1391  case VT_UI2:
1392  ok(V_UI2(&v) == 0xFFFF, "got %04x\n", V_UI2(&v));
1393  break;
1394  case VT_UI4:
1395  ok(V_UI4(&v) == 0xFFFFFFFF, "got %08x\n", V_UI4(&v));
1396  break;
1397  case VT_UI8:
1398  expect_uint64(V_UI8(&v), 0xFFFFFFFFFFFFFFFF, 16);
1399  break;
1400  default:
1401  ;
1402  }
1403 
1404  VariantClear(&v);
1405 
1406  IXMLDOMNode_Release(node);
1407 
1408  ptr++;
1409  }
1410 
1411  IXMLDOMDocument2_Release(schema);
1412  IXMLDOMDocument2_Release(doc);
1413  IXMLDOMDocument2_Release(doc2);
1414  IXMLDOMSchemaCollection_Release(cache);
1415 
1416  free_bstrs();
1417 }
Definition: cache.c:48
Definition: compat.h:2157
Definition: compat.h:2173
HRESULT hr
Definition: shlfolder.c:183
Definition: compat.h:2169
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define V_R8(A)
Definition: oleauto.h:262
#define V_I2(A)
Definition: oleauto.h:245
GLdouble n
Definition: glext.h:7729
OLECHAR * BSTR
Definition: compat.h:2152
#define expect_int64(expr, x, base)
Definition: schema.c:447
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
short VARIANT_BOOL
Definition: compat.h:2149
#define V_UI8(A)
Definition: oleauto.h:272
#define V_I4(A)
Definition: oleauto.h:247
#define V_DISPATCH(A)
Definition: oleauto.h:239
long LONG
Definition: pedump.c:60
static PVOID ptr
Definition: dispmode.c:27
#define S_FALSE
Definition: winerror.h:2357
#define V_UI2(A)
Definition: oleauto.h:268
#define V_I1(A)
Definition: oleauto.h:243
switch(r->id)
Definition: btrfs.c:2980
#define b
Definition: ke_i.h:79
#define V_I8(A)
Definition: oleauto.h:249
r l[0]
Definition: byte_order.h:167
#define todo_wine_if(is_todo)
Definition: test.h:163
#define V_R4(A)
Definition: oleauto.h:260
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
LONG HRESULT
Definition: typedefs.h:79
static const CHAR szDatatypeXDR[]
Definition: schema.c:143
#define V_UI1(A)
Definition: oleauto.h:266
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_UI4(A)
Definition: oleauto.h:270
const GUID IID_IDispatch
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
Definition: compat.h:2158
#define expect_uint64(expr, x, base)
Definition: schema.c:448
#define todo_wine
Definition: test.h:162
static IOleCache * cache
Definition: ole2.c:75
#define V_VT(A)
Definition: oleauto.h:211
GLdouble s
Definition: gl.h:2039
static const CHAR szDatatypeXML[]
Definition: schema.c:219
#define err(...)
#define create_cache(iid)
Definition: schema.c:503
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:51
const GLdouble * v
Definition: gl.h:2040
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static const xdr_datatypes xdr_datatypes_data[]
Definition: schema.c:1176
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define NULL
Definition: types.h:112
const WCHAR * schema
#define create_document(iid)
Definition: schema.c:499
#define EXPECT_HR(hr, hr_exp)
Definition: schema.c:40
static BSTR _bstr_(const char *str)
Definition: schema.c:462
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
Definition: compat.h:2159
Definition: compat.h:2156
Definition: dlist.c:348
static void free_bstrs(void)
Definition: schema.c:469

Referenced by START_TEST().

◆ test_XDR_schemas()

static void test_XDR_schemas ( void  )
static

Definition at line 1030 of file schema.c.

1031 {
1032  IXMLDOMDocument2 *doc, *schema;
1033  IXMLDOMSchemaCollection* cache;
1035  VARIANT_BOOL b;
1036  VARIANT v;
1037  BSTR bstr;
1038 
1039  doc = create_document(&IID_IXMLDOMDocument2);
1040  schema = create_document(&IID_IXMLDOMDocument2);
1041  cache = create_cache(&IID_IXMLDOMSchemaCollection);
1042 
1043  if (!doc || !schema || !cache)
1044  {
1045  if (doc) IXMLDOMDocument2_Release(doc);
1046  if (schema) IXMLDOMDocument2_Release(schema);
1047  if (cache) IXMLDOMSchemaCollection_Release(cache);
1048 
1049  return;
1050  }
1051 
1052  VariantInit(&v);
1053 
1054  ole_check(IXMLDOMDocument2_loadXML(doc, _bstr_(szOpenSeqXML1), &b));
1055  ok(b == VARIANT_TRUE, "failed to load XML string\n");
1056 
1057  ole_check(IXMLDOMDocument2_loadXML(schema, _bstr_(szOpenSeqXDR), &b));
1058  ok(b == VARIANT_TRUE, "failed to load XML string\n");
1059 
1060  /* load the schema */
1061  V_VT(&v) = VT_DISPATCH;
1062  V_DISPATCH(&v) = NULL;
1063  ole_check(IXMLDOMDocument2_QueryInterface(schema, &IID_IDispatch, (void**)&V_DISPATCH(&v)));
1064  ok(V_DISPATCH(&v) != NULL, "failed to get IDispatch interface\n");
1065  ole_check(IXMLDOMSchemaCollection_add(cache, _bstr_(""), v));
1066  VariantClear(&v);
1067 
1068  /* associate the cache to the doc */
1069  V_VT(&v) = VT_DISPATCH;
1070  V_DISPATCH(&v) = NULL;
1071  ole_check(IXMLDOMSchemaCollection_QueryInterface(cache, &IID_IDispatch, (void**)&V_DISPATCH(&v)));
1072  ok(V_DISPATCH(&v) != NULL, "failed to get IDispatch interface\n");
1073  ole_check(IXMLDOMDocument2_putref_schemas(doc, v));
1074  VariantClear(&v);
1075 
1076  /* validate the doc
1077  * only declared elements in the declared order
1078  * this is fine */
1079  err = NULL;
1080  bstr = NULL;
1081  ole_check(IXMLDOMDocument2_validate(doc, &err));
1082  ok(err != NULL, "domdoc_validate() should always set err\n");
1083  ole_expect(IXMLDOMParseError_get_reason(err, &bstr), S_FALSE);
1084  ok(IXMLDOMParseError_get_reason(err, &bstr) == S_FALSE, "got error: %s\n", wine_dbgstr_w(bstr));
1085  SysFreeString(bstr);
1086  IXMLDOMParseError_Release(err);
1087 
1088  /* load the next doc */
1089  IXMLDOMDocument2_Release(doc);
1090  doc = create_document(&IID_IXMLDOMDocument2);
1091  ole_check(IXMLDOMDocument2_loadXML(doc, _bstr_(szOpenSeqXML2), &b));
1092  ok(b == VARIANT_TRUE, "failed to load XML string\n");
1093 
1094  /* associate the cache to the doc */
1095  V_VT(&v) = VT_DISPATCH;
1096  V_DISPATCH(&v) = NULL;
1097  ole_check(IXMLDOMSchemaCollection_QueryInterface(cache, &IID_IDispatch, (void**)&V_DISPATCH(&v)));
1098  ok(V_DISPATCH(&v) != NULL, "failed to get IDispatch interface\n");
1099  ole_check(IXMLDOMDocument2_putref_schemas(doc, v));
1100  VariantClear(&v);
1101 
1102  /* validate the doc
1103  * declared elements in the declared order, with an extra declared element at the end
1104  * this is fine */
1105  err = NULL;
1106  bstr = NULL;
1107  ole_check(IXMLDOMDocument2_validate(doc, &err));
1108  ok(err != NULL, "domdoc_validate() should always set err\n");
1109  ole_expect(IXMLDOMParseError_get_reason(err, &bstr), S_FALSE);
1110  ok(IXMLDOMParseError_get_reason(err, &bstr) == S_FALSE, "got error: %s\n", wine_dbgstr_w(bstr));
1111  SysFreeString(bstr);
1112  IXMLDOMParseError_Release(err);
1113 
1114  /* load the next doc */
1115  IXMLDOMDocument2_Release(doc);
1116  doc = create_document(&IID_IXMLDOMDocument2);
1117  ole_check(IXMLDOMDocument2_loadXML(doc, _bstr_(szOpenSeqXML3), &b));
1118  ok(b == VARIANT_TRUE, "failed to load XML string\n");
1119 
1120  /* associate the cache to the doc */
1121  V_VT(&v) = VT_DISPATCH;
1122  V_DISPATCH(&v) = NULL;
1123  ole_check(IXMLDOMSchemaCollection_QueryInterface(cache, &IID_IDispatch, (void**)&V_DISPATCH(&v)));
1124  ok(V_DISPATCH(&v) != NULL, "failed to get IDispatch interface\n");
1125  ole_check(IXMLDOMDocument2_putref_schemas(doc, v));
1126  VariantClear(&v);
1127 
1128  /* validate the doc
1129  * fails, extra elements are only allowed at the end */
1130  err = NULL;
1131  bstr = NULL;
1132  ole_expect(IXMLDOMDocument2_validate(doc, &err), S_FALSE);
1133  ok(err != NULL, "domdoc_validate() should always set err\n");
1134  todo_wine ok(IXMLDOMParseError_get_reason(err, &bstr) == S_OK, "got error: %s\n", wine_dbgstr_w(bstr));
1135  SysFreeString(bstr);
1136  IXMLDOMParseError_Release(err);
1137 
1138  /* load the next doc */
1139  IXMLDOMDocument2_Release(doc);
1140  doc = create_document(&IID_IXMLDOMDocument2);
1141  ole_check(IXMLDOMDocument2_loadXML(doc, _bstr_(szOpenSeqXML4), &b));
1142  ok(b == VARIANT_TRUE, "failed to load XML string\n");
1143 
1144  /* associate the cache to the doc */
1145  V_VT(&v) = VT_DISPATCH;
1146  V_DISPATCH(&v) = NULL;
1147  ole_check(IXMLDOMSchemaCollection_QueryInterface(cache, &IID_IDispatch, (void**)&V_DISPATCH(&v)));
1148  ok(V_DISPATCH(&v) != NULL, "failed to get IDispatch interface\n");
1149  ole_check(IXMLDOMDocument2_putref_schemas(doc, v));
1150  VariantClear(&v);
1151 
1152  /* validate the doc
1153  * fails, undeclared elements are not allowed */
1154  err = NULL;
1155  bstr = NULL;
1156  ole_expect(IXMLDOMDocument2_validate(doc, &err), S_FALSE);
1157  ok(err != NULL, "domdoc_validate() should always set err\n");
1158  todo_wine ok(IXMLDOMParseError_get_reason(err, &bstr) == S_OK, "got error: %s\n", wine_dbgstr_w(bstr));
1159  SysFreeString(bstr);
1160  IXMLDOMParseError_Release(err);
1161 
1162  IXMLDOMDocument2_Release(doc);
1163  IXMLDOMDocument2_Release(schema);
1164  IXMLDOMSchemaCollection_Release(cache);
1165 
1166  free_bstrs();
1167 }
Definition: cache.c:48
#define ole_expect(expr, expect)
Definition: schema.c:431
static const CHAR szOpenSeqXML4[]
Definition: schema.c:412
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define ole_check(expr)
Definition: schema.c:426
static const CHAR szOpenSeqXML1[]
Definition: schema.c:409
static const CHAR szOpenSeqXML2[]
Definition: schema.c:410
OLECHAR * BSTR
Definition: compat.h:2152
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
short VARIANT_BOOL
Definition: compat.h:2149
#define V_DISPATCH(A)
Definition: oleauto.h:239
#define S_FALSE
Definition: winerror.h:2357
#define b
Definition: ke_i.h:79
static const CHAR szOpenSeqXML3[]
Definition: schema.c:411
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
const GUID IID_IDispatch
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define todo_wine
Definition: test.h:162
static IOleCache * cache
Definition: ole2.c:75
#define V_VT(A)
Definition: oleauto.h:211
#define err(...)
static const CHAR szOpenSeqXDR[]
Definition: schema.c:392
#define create_cache(iid)
Definition: schema.c:503
#define S_OK
Definition: intsafe.h:51
const GLdouble * v
Definition: gl.h:2040
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define NULL
Definition: types.h:112
const WCHAR * schema
#define create_document(iid)
Definition: schema.c:499
static BSTR _bstr_(const char *str)
Definition: schema.c:462
static void free_bstrs(void)
Definition: schema.c:469

Referenced by START_TEST().

Variable Documentation

◆ alloced_bstrs

BSTR alloced_bstrs[256]
static

Definition at line 451 of file schema.c.

Referenced by _bstr_(), and free_bstrs().

◆ alloced_bstrs_count

int alloced_bstrs_count
static

Definition at line 452 of file schema.c.

Referenced by _bstr_(), and free_bstrs().

◆ szDatatypeXDR

const CHAR szDatatypeXDR[]
static

Definition at line 143 of file schema.c.

Referenced by test_XDR_datatypes().

◆ szDatatypeXML

const CHAR szDatatypeXML[]
static

Definition at line 219 of file schema.c.

Referenced by test_XDR_datatypes().

◆ szOpenSeqXDR

const CHAR szOpenSeqXDR[]
static
Initial value:
=
"<Schema xmlns='urn:schemas-microsoft-com:xml-data'>\n"
" <ElementType name='w' content='empty' model='closed'/>\n"
" <ElementType name='x' content='empty' model='closed'/>\n"
" <ElementType name='y' content='empty' model='closed'/>\n"
" <ElementType name='z' content='empty' model='closed'/>\n"
" <ElementType name='test' content='eltOnly' model='open' order='seq'>\n"
" <element type='x'/>\n"
" <group order='seq'>\n"
" <element type='x'/>\n"
" <element type='y'/>\n"
" <element type='z'/>\n"
" </group>\n"
" <element type='z'/>\n"
" </ElementType>\n"
"</Schema>"

Definition at line 392 of file schema.c.

Referenced by test_XDR_schemas().

◆ szOpenSeqXML1

const CHAR szOpenSeqXML1[] = "<test><x/><x/><y/><z/><z/></test>"
static

Definition at line 409 of file schema.c.

Referenced by test_XDR_schemas().

◆ szOpenSeqXML2

const CHAR szOpenSeqXML2[] = "<test><x/><x/><y/><z/><z/><w/></test>"
static

Definition at line 410 of file schema.c.

Referenced by test_XDR_schemas().

◆ szOpenSeqXML3

const CHAR szOpenSeqXML3[] = "<test><w/><x/><x/><y/><z/><z/></test>"
static

Definition at line 411 of file schema.c.

Referenced by test_XDR_schemas().

◆ szOpenSeqXML4

const CHAR szOpenSeqXML4[] = "<test><x/><x/><y/><z/><z/><v/></test>"
static

Definition at line 412 of file schema.c.

Referenced by test_XDR_schemas().

◆ xdr_datatypes_data

const xdr_datatypes xdr_datatypes_data[]
static

Definition at line 1176 of file schema.c.

Referenced by test_XDR_datatypes().

◆ xdr_schema1_uri

const CHAR xdr_schema1_uri[] = "x-schema:test1.xdr"
static

Definition at line 51 of file schema.c.

Referenced by test_collection_content(), test_collection_refs(), and test_length().

◆ xdr_schema1_xml

const CHAR xdr_schema1_xml[]
static
Initial value:
=
"<?xml version='1.0'?>"
"<Schema xmlns='urn:schemas-microsoft-com:xml-data'"
" xmlns:dt='urn:schemas-microsoft-com:datatypes'"
" name='test1.xdr'>"
" <ElementType name='x' dt:type='boolean'/>"
" <ElementType name='y'>"
" <datatype dt:type='int'/>"
" </ElementType>"
" <ElementType name='z'/>"
" <ElementType name='root' content='eltOnly' model='open' order='seq'>"
" <element type='x'/>"
" <element type='y'/>"
" <element type='z'/>"
" </ElementType>"
"</Schema>"

Definition at line 52 of file schema.c.

Referenced by test_collection_content(), test_collection_refs(), and test_length().

◆ xdr_schema2_uri

const CHAR xdr_schema2_uri[] = "x-schema:test2.xdr"
static

Definition at line 69 of file schema.c.

Referenced by test_collection_content(), test_collection_refs(), and test_length().

◆ xdr_schema2_xml

const CHAR xdr_schema2_xml[]
static
Initial value:
=
"<?xml version='1.0'?>"
"<Schema xmlns='urn:schemas-microsoft-com:xml-data'"
" xmlns:dt='urn:schemas-microsoft-com:datatypes'"
" name='test2.xdr'>"
" <ElementType name='x' dt:type='bin.base64'/>"
" <ElementType name='y' dt:type='uuid'/>"
" <ElementType name='z'/>"
" <ElementType name='root' content='eltOnly' model='closed' order='one'>"
" <element type='x'/>"
" <element type='y'/>"
" <element type='z'/>"
" </ElementType>"
"</Schema>"

Definition at line 70 of file schema.c.

Referenced by test_collection_content(), test_collection_refs(), and test_length().

◆ xdr_schema3_uri

const CHAR xdr_schema3_uri[] = "x-schema:test3.xdr"
static

Definition at line 85 of file schema.c.

Referenced by test_collection_content(), test_collection_refs(), and test_length().

◆ xdr_schema3_xml

const CHAR xdr_schema3_xml[]
static
Initial value:
=
"<?xml version='1.0'?>"
"<Schema xmlns='urn:schemas-microsoft-com:xml-data'"
" xmlns:dt='urn:schemas-microsoft-com:datatypes'"
" name='test3.xdr'>"
" <ElementType name='root' content='textOnly' model='open'>"
" <AttributeType name='x' dt:type='int'/>"
" <AttributeType name='y' dt:type='enumeration' dt:values='a b c'/>"
" <AttributeType name='z' dt:type='uuid'/>"
" <attribute type='x'/>"
" <attribute type='y'/>"
" <attribute type='z'/>"
" </ElementType>"
"</Schema>"

Definition at line 86 of file schema.c.

Referenced by test_collection_content(), test_collection_refs(), and test_length().

◆ xdr_schema_uri

const WCHAR xdr_schema_uri[] = {'x','-','s','c','h','e','m','a',':','t','e','s','t','.','x','m','l',0}
static

Definition at line 43 of file schema.c.

Referenced by test_schema_refs().

◆ xdr_schema_xml

const WCHAR xdr_schema_xml[]
static
Initial value:
= {
'<','S','c','h','e','m','a',' ','x','m','l','n','s','=','\"','u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','x','m','l','-','d','a','t','a','\"','\n',
'x','m','l','n','s',':','d','t','=','\"','u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','d','a','t','a','t','y','p','e','s','\"','>','\n',
'<','/','S','c','h','e','m','a','>','\n',0
}

Definition at line 45 of file schema.c.

Referenced by test_schema_refs().

◆ xsd_schema1_uri

const CHAR xsd_schema1_uri[] = "x-schema:test1.xsd"
static

Definition at line 101 of file schema.c.

Referenced by test_collection_content(), and test_remove().

◆ xsd_schema1_xml

const CHAR xsd_schema1_xml[]
static
Initial value:
=
"<?xml version='1.0'?>"
"<schema xmlns='http://www.w3.org/2001/XMLSchema'"
" targetNamespace='x-schema:test1.xsd'>"
" <element name='root'>"
" <complexType>"
" <sequence maxOccurs='unbounded'>"
" <any/>"
" </sequence>"
" </complexType>"
" </element>"
"</schema>"

Definition at line 102 of file schema.c.

Referenced by test_collection_content(), and test_remove().

◆ xsd_schema2_uri

const CHAR xsd_schema2_uri[] = "x-schema:test2.xsd"
static

Definition at line 115 of file schema.c.

Referenced by test_collection_content().

◆ xsd_schema2_xml

const CHAR xsd_schema2_xml[]
static
Initial value:
=
"<?xml version='1.0'?>"
"<schema xmlns='http://www.w3.org/2001/XMLSchema'"
" targetNamespace='x-schema:test2.xsd'>"
" <element name='root'>"
" <complexType>"
" <sequence maxOccurs='unbounded'>"
" <any/>"
" </sequence>"
" </complexType>"
" </element>"
"</schema>"

Definition at line 116 of file schema.c.

Referenced by test_collection_content().

◆ xsd_schema3_uri

const CHAR xsd_schema3_uri[] = "x-schema:test3.xsd"
static

Definition at line 129 of file schema.c.

Referenced by test_collection_content().

◆ xsd_schema3_xml

const CHAR xsd_schema3_xml[]
static
Initial value:
=
"<?xml version='1.0'?>"
"<schema xmlns='http://www.w3.org/2001/XMLSchema'"
" targetNamespace='x-schema:test3.xsd'>"
" <element name='root'>"
" <complexType>"
" <sequence maxOccurs='unbounded'>"
" <any/>"
" </sequence>"
" </complexType>"
" </element>"
"</schema>"

Definition at line 130 of file schema.c.

Referenced by test_collection_content().