ReactOS  0.4.14-dev-337-gf981a68
vartype.c File Reference
#include "wine/test.h"
#include "oleauto.h"
#include <math.h>
#include <stdio.h>
#include "test_tlb.h"
#include "initguid.h"
Include dependency graph for vartype.c:

Go to the source code of this file.

Classes

struct  tagINTERNAL_BSTR
 
struct  DummyDispatch
 

Macros

#define CONST_VTABLE
 
#define COBJMACROS
 
#define HAS_UINT64_TO_FLOAT
 
#define IS_MODERN_VTYPE(vt)
 
#define CONVVARS(typ)   HRESULT hres; CONV_TYPE out; typ in
 
#define _EXPECT_NO_OUT(res)   ok(hres == res, "expected " #res ", got hres=0x%08x\n", hres)
 
#define EXPECT_OVERFLOW   _EXPECT_NO_OUT(DISP_E_OVERFLOW)
 
#define EXPECT_MISMATCH   _EXPECT_NO_OUT(DISP_E_TYPEMISMATCH)
 
#define EXPECT_BADVAR   _EXPECT_NO_OUT(DISP_E_BADVARTYPE)
 
#define EXPECT_INVALID   _EXPECT_NO_OUT(E_INVALIDARG)
 
#define EXPECT_LT   _EXPECT_NO_OUT(VARCMP_LT)
 
#define EXPECT_GT   _EXPECT_NO_OUT(VARCMP_GT)
 
#define EXPECT_EQ   _EXPECT_NO_OUT(VARCMP_EQ)
 
#define _EXPECTRES(res, x, fs)   ok(hres == S_OK && out == (CONV_TYPE)(x), "expected " #x ", got " fs "; hres=0x%08x\n", out, hres)
 
#define EXPECT(x)   EXPECTRES(S_OK, (x))
 
#define EXPECT_DBL(x)   ok(hres == S_OK && fabs(out-(x))<=1e-14*(x), "expected %16.16g, got %16.16g; hres=0x%08x\n", (x), out, hres)
 
#define CONVERT(func, val)   in = val; hres = func(in, &out)
 
#define CONVERTRANGE(func, start, end)   for (i = start; i < end; i+=1) { CONVERT(func, i); EXPECT(i); };
 
#define OVERFLOWRANGE(func, start, end)   for (i = start; i < end; i+=1) { CONVERT(func, i); EXPECT_OVERFLOW; };
 
#define CY_MULTIPLIER   10000
 
#define DATE_MIN   -657434
 
#define DATE_MAX   2958465
 
#define CONVERT_I8(func, hi, lo)   in = hi; in = (in << 32) | lo; hres = func(in, &out)
 
#define CONVERT_CY(func, val)   in.int64 = (LONGLONG)(val * CY_MULTIPLIER); hres = func(in, &out)
 
#define CONVERT_CY64(func, hi, lo)   S(in).Hi = hi; S(in).Lo = lo; in.int64 *= CY_MULTIPLIER; hres = func(in, &out)
 
#define SETDEC(dec, scl, sgn, hi, lo)
 
#define SETDEC64(dec, scl, sgn, hi, mid, lo)
 
#define CONVERT_DEC(func, scl, sgn, hi, lo)   SETDEC(in,scl,sgn,hi,lo); hres = func(&in, &out)
 
#define CONVERT_DEC64(func, scl, sgn, hi, mid, lo)   SETDEC64(in,scl,sgn,hi,mid,lo); hres = func(&in, &out)
 
#define CONVERT_BADDEC(func)
 
#define CONVERT_STR(func, str, flags)
 
#define COPYTEST(val, vt, srcval, dstval, srcref, dstref, fs)
 
#define CHANGETYPEEX(typ)   hres = VariantChangeTypeEx(&vDst, &vSrc, 0, 0, typ)
 
#define TYPETEST(typ, res, fs)
 
#define TYPETESTI8(typ, res)
 
#define BADVAR(typ)   CHANGETYPEEX(typ); EXPECT_BADVAR
 
#define MISMATCH(typ)   CHANGETYPEEX(typ); EXPECT_MISMATCH
 
#define INITIAL_TYPETEST(vt, val, fs)
 
#define NEGATIVE_TYPETEST(vt, val, fs, vtneg, valneg)
 
#define INITIAL_TYPETESTI8(vt, val)
 
#define COMMON_TYPETEST
 
#define DEFINE_EXPECT(func)   static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
 
#define SET_EXPECT(func)   do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)
 
#define CHECK_EXPECT2(func)
 
#define CHECK_EXPECT(func)
 
#define CHECK_CALLED(func)
 
#define CONV_TYPE   signed char
 
#define EXPECTRES(res, x)   _EXPECTRES(res, x, "%d")
 
#define CONV_TYPE   BYTE
 
#define CONV_TYPE   SHORT
 
#define CONV_TYPE   USHORT
 
#define CONV_TYPE   LONG
 
#define CONV_TYPE   ULONG
 
#define EXPECTRES(res, x)   _EXPECTRES(res, x, "%u")
 
#define CONV_TYPE   LONG64
 
#define EXPECTI8(x)
 
#define EXPECTI864(x, y)
 
#define CONV_TYPE   ULONG64
 
#define CONV_TYPE   float
 
#define EXPECTRES(res, x)   _EXPECTRES(res, x, "%15.15f")
 
#define CONV_TYPE   double
 
#define MATHRND(l, r)   left = l; right = r; hres = VarR8Round(left, right, &out)
 
#define CONV_TYPE   DATE
 
#define DFS(str)
 
#define MKRELDATE(day, mth)
 
#define CONV_TYPE   CY
 
#define EXPECTCY(x)
 
#define EXPECTCY64(x, y)
 
#define MATHVARS1   HRESULT hres; double left = 0.0; CY cyLeft, out
 
#define MATHVARS2   MATHVARS1; double right = 0.0; CY cyRight
 
#define MATH1(func, l)   left = (double)l; VarCyFromR8(left, &cyLeft); hres = func(cyLeft, &out)
 
#define MATH2(func, l, r)
 
#define MATHMULI4(l, r)
 
#define MATHMULI8(l, r)
 
#define MATHCMP(l, r)
 
#define MATHCMPR8(l, r)
 
#define MATHRND(l, r)
 
#define MATHFIX(l)
 
#define MATHINT(l)
 
#define CONV_TYPE   DECIMAL
 
#define EXPECTDEC(scl, sgn, hi, lo)
 
#define EXPECTDEC64(scl, sgn, hi, mid, lo)
 
#define EXPECTDECZERO()
 
#define EXPECTDECI   if (i < 0) EXPECTDEC(0, 0x80, 0, -i); else EXPECTDEC(0, 0, 0, i)
 
#define MATHVARS1   HRESULT hres; DECIMAL l, out
 
#define MATHVARS2   MATHVARS1; DECIMAL r
 
#define MATH1(func)   hres = func(&l, &out)
 
#define MATH2(func)   hres = func(&l, &r, &out)
 
#define MATH3(func)   hres = func(&l, r)
 
#define CLEAR(x)   memset(&(x), 0xBB, sizeof(x))
 
#define CONV_TYPE   VARIANT_BOOL
 
#define EXPECTRES(res, x)   _EXPECTRES(res, x, "%d")
 
#define CONVERTRANGE(func, start, end)
 
#define BOOL_STR(flags, str)
 
#define BSTR_DATE(dt, str)   _BSTR_DATE(dt,str,__LINE__)
 
#define BSTR_CY(a, b, str, lcid)   _BSTR_CY(a, b, str, lcid, __LINE__)
 
#define BSTR_DEC(scale, sign, hi, lo, str, lcid)   _BSTR_DEC(scale, sign, hi, 0, lo, str, lcid, __LINE__)
 
#define BSTR_DEC64(scale, sign, hi, mid, lo, str, lcid)   _BSTR_DEC(scale, sign, hi, mid, lo, str, lcid, __LINE__)
 
#define _VARBSTRCMP(left, right, lcid, flags, result)
 
#define VARBSTRCMP(left, right, flags, result)   _VARBSTRCMP(left,right,lcid,flags,result)
 
#define NUM_CUST_ITEMS   16
 

Typedefs

typedef struct tagINTERNAL_BSTR INTERNAL_BSTR
 
typedef struct tagINTERNAL_BSTRLPINTERNAL_BSTR
 

Functions

 DEFINE_GUID (UUID_test_struct, 0x4029f190, 0xca4a, 0x4611, 0xae, 0xb9, 0x67, 0x39, 0x83, 0xcb, 0x96, 0xdd)
 
 DEFINE_EXPECT (dispatch_invoke)
 
static DummyDispatchimpl_from_IDispatch (IDispatch *iface)
 
static ULONG WINAPI DummyDispatch_AddRef (IDispatch *iface)
 
static ULONG WINAPI DummyDispatch_Release (IDispatch *iface)
 
static HRESULT WINAPI DummyDispatch_QueryInterface (IDispatch *iface, REFIID riid, void **ppvObject)
 
static HRESULT WINAPI DummyDispatch_GetTypeInfoCount (IDispatch *iface, UINT *pctinfo)
 
static HRESULT WINAPI DummyDispatch_GetTypeInfo (IDispatch *iface, UINT tinfo, LCID lcid, ITypeInfo **ti)
 
static HRESULT WINAPI DummyDispatch_GetIDsOfNames (IDispatch *iface, REFIID riid, LPOLESTR *names, UINT cnames, LCID lcid, DISPID *dispid)
 
static HRESULT WINAPI DummyDispatch_Invoke (IDispatch *iface, DISPID dispid, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, UINT *arg_err)
 
static void init_test_dispatch (LONG ref, VARTYPE vt, DummyDispatch *dispatch)
 
static void test_VarI1FromI2 (void)
 
static void test_VarI1FromI4 (void)
 
static void test_VarI1FromI8 (void)
 
static void test_VarI1FromUI1 (void)
 
static void test_VarI1FromUI2 (void)
 
static void test_VarI1FromUI4 (void)
 
static void test_VarI1FromUI8 (void)
 
static void test_VarI1FromBool (void)
 
static void test_VarI1FromR4 (void)
 
static void test_VarI1FromR8 (void)
 
static void test_VarI1FromDate (void)
 
static void test_VarI1FromCy (void)
 
static void test_VarI1FromDec (void)
 
static void test_VarI1FromStr (void)
 
static void test_VarI1Copy (void)
 
static void test_VarI1ChangeTypeEx (void)
 
static void test_VarUI1FromI1 (void)
 
static void test_VarUI1FromI2 (void)
 
static void test_VarUI1FromI4 (void)
 
static void test_VarUI1FromI8 (void)
 
static void test_VarUI1FromUI2 (void)
 
static void test_VarUI1FromUI4 (void)
 
static void test_VarUI1FromUI8 (void)
 
static void test_VarUI1FromBool (void)
 
static void test_VarUI1FromR4 (void)
 
static void test_VarUI1FromR8 (void)
 
static void test_VarUI1FromDate (void)
 
static void test_VarUI1FromCy (void)
 
static void test_VarUI1FromDec (void)
 
static void test_VarUI1FromStr (void)
 
static void test_VarUI1FromDisp (void)
 
static void test_VarUI1Copy (void)
 
static void test_VarUI1ChangeTypeEx (void)
 
static void test_VarI2FromI1 (void)
 
static void test_VarI2FromI4 (void)
 
static void test_VarI2FromI8 (void)
 
static void test_VarI2FromUI1 (void)
 
static void test_VarI2FromUI2 (void)
 
static void test_VarI2FromUI4 (void)
 
static void test_VarI2FromUI8 (void)
 
static void test_VarI2FromBool (void)
 
static void test_VarI2FromR4 (void)
 
static void test_VarI2FromR8 (void)
 
static void test_VarI2FromDate (void)
 
static void test_VarI2FromCy (void)
 
static void test_VarI2FromDec (void)
 
static void test_VarI2FromStr (void)
 
static void test_VarI2Copy (void)
 
static void test_VarI2ChangeTypeEx (void)
 
static void test_VarUI2FromI1 (void)
 
static void test_VarUI2FromI2 (void)
 
static void test_VarUI2FromI4 (void)
 
static void test_VarUI2FromI8 (void)
 
static void test_VarUI2FromUI1 (void)
 
static void test_VarUI2FromUI4 (void)
 
static void test_VarUI2FromUI8 (void)
 
static void test_VarUI2FromBool (void)
 
static void test_VarUI2FromR4 (void)
 
static void test_VarUI2FromR8 (void)
 
static void test_VarUI2FromDate (void)
 
static void test_VarUI2FromCy (void)
 
static void test_VarUI2FromDec (void)
 
static void test_VarUI2FromStr (void)
 
static void test_VarUI2Copy (void)
 
static void test_VarUI2ChangeTypeEx (void)
 
static void test_VarI4FromI1 (void)
 
static void test_VarI4FromI2 (void)
 
static void test_VarI4FromI8 (void)
 
static void test_VarI4FromUI1 (void)
 
static void test_VarI4FromUI2 (void)
 
static void test_VarI4FromUI4 (void)
 
static void test_VarI4FromUI8 (void)
 
static void test_VarI4FromBool (void)
 
static void test_VarI4FromR4 (void)
 
static void test_VarI4FromR8 (void)
 
static void test_VarI4FromDate (void)
 
static void test_VarI4FromCy (void)
 
static void test_VarI4FromDec (void)
 
static void test_VarI4FromStr (void)
 
static void test_VarI4Copy (void)
 
static void test_VarI4ChangeTypeEx (void)
 
static void test_VarUI4FromI1 (void)
 
static void test_VarUI4FromI2 (void)
 
static void test_VarUI4FromUI2 (void)
 
static void test_VarUI4FromI8 (void)
 
static void test_VarUI4FromUI1 (void)
 
static void test_VarUI4FromI4 (void)
 
static void test_VarUI4FromUI8 (void)
 
static void test_VarUI4FromBool (void)
 
static void test_VarUI4FromR4 (void)
 
static void test_VarUI4FromR8 (void)
 
static void test_VarUI4FromDate (void)
 
static void test_VarUI4FromCy (void)
 
static void test_VarUI4FromDec (void)
 
static void test_VarUI4FromStr (void)
 
static void test_VarUI4Copy (void)
 
static void test_VarUI4ChangeTypeEx (void)
 
static void test_VarI8FromI1 (void)
 
static void test_VarI8FromUI1 (void)
 
static void test_VarI8FromI2 (void)
 
static void test_VarI8FromUI2 (void)
 
static void test_VarI8FromUI4 (void)
 
static void test_VarI8FromR4 (void)
 
static void test_VarI8FromR8 (void)
 
static void test_VarI8FromDate (void)
 
static void test_VarI8FromBool (void)
 
static void test_VarI8FromUI8 (void)
 
static void test_VarI8FromCy (void)
 
static void test_VarI8FromDec (void)
 
static void test_VarI8FromStr (void)
 
static void test_VarI8Copy (void)
 
static void test_VarI8ChangeTypeEx (void)
 
static void test_VarUI8FromI1 (void)
 
static void test_VarUI8FromUI1 (void)
 
static void test_VarUI8FromI2 (void)
 
static void test_VarUI8FromUI2 (void)
 
static void test_VarUI8FromUI4 (void)
 
static void test_VarUI8FromR4 (void)
 
static void test_VarUI8FromR8 (void)
 
static void test_VarUI8FromDate (void)
 
static void test_VarUI8FromBool (void)
 
static void test_VarUI8FromI8 (void)
 
static void test_VarUI8FromCy (void)
 
static void test_VarUI8FromDec (void)
 
static void test_VarUI8FromStr (void)
 
static void test_VarUI8Copy (void)
 
static void test_VarUI8ChangeTypeEx (void)
 
static void test_VarR4FromI1 (void)
 
static void test_VarR4FromUI1 (void)
 
static void test_VarR4FromI2 (void)
 
static void test_VarR4FromUI2 (void)
 
static void test_VarR4FromI4 (void)
 
static void test_VarR4FromUI4 (void)
 
static void test_VarR4FromR8 (void)
 
static void test_VarR4FromBool (void)
 
static void test_VarR4FromCy (void)
 
static void test_VarR4FromI8 (void)
 
static void test_VarR4FromUI8 (void)
 
static void test_VarR4FromDec (void)
 
static void test_VarR4FromDate (void)
 
static void test_VarR4FromStr (void)
 
static void test_VarR4Copy (void)
 
static void test_VarR4ChangeTypeEx (void)
 
static void test_VarR8FromI1 (void)
 
static void test_VarR8FromUI1 (void)
 
static void test_VarR8FromI2 (void)
 
static void test_VarR8FromUI2 (void)
 
static void test_VarR8FromI4 (void)
 
static void test_VarR8FromUI4 (void)
 
static void test_VarR8FromR4 (void)
 
static void test_VarR8FromBool (void)
 
static void test_VarR8FromCy (void)
 
static void test_VarR8FromI8 (void)
 
static void test_VarR8FromUI8 (void)
 
static void test_VarR8FromDec (void)
 
static void test_VarR8FromDate (void)
 
static void test_VarR8FromStr (void)
 
static void test_VarR8Copy (void)
 
static void test_VarR8ChangeTypeEx (void)
 
static void test_VarR8Round (void)
 
static void test_VarDateFromI1 (void)
 
static void test_VarDateFromUI1 (void)
 
static void test_VarDateFromI2 (void)
 
static void test_VarDateFromUI2 (void)
 
static void test_VarDateFromI4 (void)
 
static void test_VarDateFromUI4 (void)
 
static void test_VarDateFromR4 (void)
 
static void test_VarDateFromR8 (void)
 
static void test_VarDateFromBool (void)
 
static void test_VarDateFromCy (void)
 
static void test_VarDateFromI8 (void)
 
static void test_VarDateFromUI8 (void)
 
static void test_VarDateFromDec (void)
 
static void test_VarDateFromStr (void)
 
static void test_VarDateCopy (void)
 
static const charwtoascii (LPWSTR lpszIn)
 
static void test_VarDateChangeTypeEx (void)
 
static void test_VarCyFromI1 (void)
 
static void test_VarCyFromUI1 (void)
 
static void test_VarCyFromI2 (void)
 
static void test_VarCyFromUI2 (void)
 
static void test_VarCyFromI4 (void)
 
static void test_VarCyFromUI4 (void)
 
static void test_VarCyFromR4 (void)
 
static void test_VarCyFromR8 (void)
 
static void test_VarCyFromBool (void)
 
static void test_VarCyFromI8 (void)
 
static void test_VarCyFromUI8 (void)
 
static void test_VarCyFromDec (void)
 
static void test_VarCyFromDate (void)
 
static void test_VarCyAdd (void)
 
static void test_VarCyMul (void)
 
static void test_VarCySub (void)
 
static void test_VarCyAbs (void)
 
static void test_VarCyNeg (void)
 
static void test_VarCyMulI4 (void)
 
static void test_VarCyMulI8 (void)
 
static void test_VarCyCmp (void)
 
static void test_VarCyCmpR8 (void)
 
static void test_VarCyRound (void)
 
static void test_VarCyFix (void)
 
static void test_VarCyInt (void)
 
static void test_VarDecFromI1 (void)
 
static void test_VarDecFromI2 (void)
 
static void test_VarDecFromI4 (void)
 
static void test_VarDecFromI8 (void)
 
static void test_VarDecFromUI1 (void)
 
static void test_VarDecFromUI2 (void)
 
static void test_VarDecFromUI4 (void)
 
static void test_VarDecFromUI8 (void)
 
static void test_VarDecFromBool (void)
 
static void test_VarDecFromR4 (void)
 
static void test_VarDecFromR8 (void)
 
static void test_VarDecFromDate (void)
 
static void test_VarDecFromStr (void)
 
static void test_VarDecFromCy (void)
 
static void test_VarDecAbs (void)
 
static void test_VarDecNeg (void)
 
static void test_VarDecAdd (void)
 
static void test_VarDecSub (void)
 
static void test_VarDecMul (void)
 
static void test_VarDecDiv (void)
 
static void test_VarDecCmp (void)
 
static void test_VarDecCmpR8 (void)
 
static void test_VarDecRound (void)
 
static void test_VarBoolFromI1 (void)
 
static void test_VarBoolFromUI1 (void)
 
static void test_VarBoolFromI2 (void)
 
static void test_VarBoolFromUI2 (void)
 
static void test_VarBoolFromI4 (void)
 
static void test_VarBoolFromUI4 (void)
 
static void test_VarBoolFromR4 (void)
 
static void test_VarBoolFromR8 (void)
 
static void test_VarBoolFromCy (void)
 
static void test_VarBoolFromI8 (void)
 
static void test_VarBoolFromUI8 (void)
 
static void test_VarBoolFromDec (void)
 
static void test_VarBoolFromDate (void)
 
static void test_VarBoolFromStr (void)
 
static void test_VarBoolCopy (void)
 
static void test_VarBoolChangeTypeEx (void)
 
static void test_VarBstrFromI4 (void)
 
static void test_VarBstrFromR4 (void)
 
static void _BSTR_DATE (DATE dt, const char *str, int line)
 
static void test_VarBstrFromDate (void)
 
static void _BSTR_CY (LONG a, LONG b, const char *str, LCID lcid, int line)
 
static void test_VarBstrFromCy (void)
 
static void _BSTR_DEC (BYTE scale, BYTE sign, ULONG hi, ULONG mid, ULONGLONG lo, const char *str, LCID lcid, int line)
 
static void test_VarBstrFromDec (void)
 
static void test_VarBstrCmp (void)
 
static LPINTERNAL_BSTR Get (const BSTR lpszString)
 
static BSTR GetBSTR (const LPINTERNAL_BSTR bstr)
 
static void test_SysStringLen (void)
 
static void test_SysStringByteLen (void)
 
static void test_SysAllocString (void)
 
static void test_SysAllocStringLen (void)
 
static void test_SysAllocStringByteLen (void)
 
static void test_SysReAllocString (void)
 
static void test_SysReAllocStringLen (void)
 
static void test_BstrCopy (void)
 
static void test_VarBstrCat (void)
 
static void test_IUnknownClear (void)
 
static void test_IUnknownCopy (void)
 
static void test_IUnknownChangeTypeEx (void)
 
static void test_IDispatchClear (void)
 
static void test_IDispatchCopy (void)
 
static void test_IDispatchChangeTypeEx (void)
 
static void test_ErrorChangeTypeEx (void)
 
static void test_EmptyChangeTypeEx (void)
 
static void test_NullChangeTypeEx (void)
 
static void test_UintChangeTypeEx (void)
 
static void test_ClearCustData (void)
 
static void test_NullByRef (void)
 
static void test_ChangeType_keep_dst (void)
 
static void test_bstr_cache (void)
 
static void write_typelib (int res_no, const char *filename)
 
static const charcreate_test_typelib (int res_no)
 
static void test_recinfo (void)
 
 START_TEST (vartype)
 

Variables

static HMODULE hOleaut32
 
static BOOL has_i8
 
static BOOL has_locales
 
static const IDispatchVtbl DummyDispatch_VTable
 
static const char *const BadDateStrings []
 

Macro Definition Documentation

◆ _EXPECT_NO_OUT

#define _EXPECT_NO_OUT (   res)    ok(hres == res, "expected " #res ", got hres=0x%08x\n", hres)

Definition at line 67 of file vartype.c.

◆ _EXPECTRES

#define _EXPECTRES (   res,
  x,
  fs 
)    ok(hres == S_OK && out == (CONV_TYPE)(x), "expected " #x ", got " fs "; hres=0x%08x\n", out, hres)

Definition at line 76 of file vartype.c.

◆ _VARBSTRCMP

#define _VARBSTRCMP (   left,
  right,
  lcid,
  flags,
  result 
)
Value:
ok(hres == result, "VarBstrCmp: expected " #result ", got hres=0x%x\n", hres)
HRESULT hres
Definition: protocol.c:465
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLbitfield flags
Definition: glext.h:7161
HRESULT WINAPI VarBstrCmp(BSTR pbstrLeft, BSTR pbstrRight, LCID lcid, DWORD dwFlags)
Definition: vartype.c:7157
GLuint64EXT * result
Definition: glext.h:11304

Definition at line 4808 of file vartype.c.

◆ BADVAR

#define BADVAR (   typ)    CHANGETYPEEX(typ); EXPECT_BADVAR

Definition at line 144 of file vartype.c.

◆ BOOL_STR

#define BOOL_STR (   flags,
  str 
)
Value:
hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, flags, VT_BSTR); \
ok(hres == S_OK && V_VT(&vDst) == VT_BSTR && \
V_BSTR(&vDst) && !memcmp(V_BSTR(&vDst), str, sizeof(str)), \
"hres=0x%X, type=%d (should be VT_BSTR), *bstr='%c'\n", \
hres, V_VT(&vDst), V_BSTR(&vDst) ? *V_BSTR(&vDst) : '?'); \
VariantClear(&vDst)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
const WCHAR * str
HRESULT hres
Definition: protocol.c:465
GLbitfield flags
Definition: glext.h:7161
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI VariantChangeTypeEx(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, LCID lcid, USHORT wFlags, VARTYPE vt)
Definition: variant.c:991

Definition at line 4494 of file vartype.c.

◆ BSTR_CY

#define BSTR_CY (   a,
  b,
  str,
  lcid 
)    _BSTR_CY(a, b, str, lcid, __LINE__)

◆ BSTR_DATE

#define BSTR_DATE (   dt,
  str 
)    _BSTR_DATE(dt,str,__LINE__)

◆ BSTR_DEC

#define BSTR_DEC (   scale,
  sign,
  hi,
  lo,
  str,
  lcid 
)    _BSTR_DEC(scale, sign, hi, 0, lo, str, lcid, __LINE__)

◆ BSTR_DEC64

#define BSTR_DEC64 (   scale,
  sign,
  hi,
  mid,
  lo,
  str,
  lcid 
)    _BSTR_DEC(scale, sign, hi, mid, lo, str, lcid, __LINE__)

◆ CHANGETYPEEX

#define CHANGETYPEEX (   typ)    hres = VariantChangeTypeEx(&vDst, &vSrc, 0, 0, typ)

Definition at line 134 of file vartype.c.

◆ CHECK_CALLED

#define CHECK_CALLED (   func)
Value:
do { \
ok(called_ ## func, "expected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)
GLenum func
Definition: glext.h:6028

Definition at line 268 of file vartype.c.

◆ CHECK_EXPECT

#define CHECK_EXPECT (   func)
Value:
do { \
CHECK_EXPECT2(func); \
expect_ ## func = FALSE; \
}while(0)
GLenum func
Definition: glext.h:6028

Definition at line 262 of file vartype.c.

◆ CHECK_EXPECT2

#define CHECK_EXPECT2 (   func)
Value:
do { \
ok(expect_ ##func, "unexpected call " #func "\n"); \
called_ ## func = TRUE; \
}while(0)
GLenum func
Definition: glext.h:6028
#define TRUE
Definition: types.h:120
#define expect_(expected, got, precision)
Definition: font.c:29

Definition at line 256 of file vartype.c.

◆ CLEAR

#define CLEAR (   x)    memset(&(x), 0xBB, sizeof(x))

Definition at line 4232 of file vartype.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file vartype.c.

◆ COMMON_TYPETEST

#define COMMON_TYPETEST

Definition at line 195 of file vartype.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 21 of file vartype.c.

◆ CONV_TYPE [1/14]

#define CONV_TYPE   signed char

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [2/14]

#define CONV_TYPE   BYTE

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [3/14]

#define CONV_TYPE   SHORT

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [4/14]

#define CONV_TYPE   USHORT

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [5/14]

#define CONV_TYPE   LONG

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [6/14]

#define CONV_TYPE   ULONG

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [7/14]

#define CONV_TYPE   LONG64

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [8/14]

#define CONV_TYPE   ULONG64

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [9/14]

#define CONV_TYPE   float

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [10/14]

#define CONV_TYPE   double

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [11/14]

#define CONV_TYPE   DATE

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [12/14]

#define CONV_TYPE   CY

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [13/14]

#define CONV_TYPE   DECIMAL

Definition at line 4268 of file vartype.c.

◆ CONV_TYPE [14/14]

#define CONV_TYPE   VARIANT_BOOL

Definition at line 4268 of file vartype.c.

◆ CONVERT

#define CONVERT (   func,
  val 
)    in = val; hres = func(in, &out)

Definition at line 82 of file vartype.c.

◆ CONVERT_BADDEC

#define CONVERT_BADDEC (   func)
Value:
CONVERT_DEC(func,0,0x1,0,0); EXPECT_INVALID; \
CONVERT_DEC(func,0,0x40,0,0); EXPECT_INVALID; \
CONVERT_DEC(func,0,0x7f,0,0); EXPECT_INVALID;
GLenum func
Definition: glext.h:6028
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define EXPECT_INVALID
Definition: vartype.c:71
#define CONVERT_DEC(func, scl, sgn, hi, lo)
Definition: vartype.c:103

Definition at line 107 of file vartype.c.

◆ CONVERT_CY

#define CONVERT_CY (   func,
  val 
)    in.int64 = (LONGLONG)(val * CY_MULTIPLIER); hres = func(in, &out)

Definition at line 93 of file vartype.c.

◆ CONVERT_CY64

#define CONVERT_CY64 (   func,
  hi,
  lo 
)    S(in).Hi = hi; S(in).Lo = lo; in.int64 *= CY_MULTIPLIER; hres = func(in, &out)

Definition at line 95 of file vartype.c.

◆ CONVERT_DEC

#define CONVERT_DEC (   func,
  scl,
  sgn,
  hi,
  lo 
)    SETDEC(in,scl,sgn,hi,lo); hres = func(&in, &out)

Definition at line 103 of file vartype.c.

◆ CONVERT_DEC64

#define CONVERT_DEC64 (   func,
  scl,
  sgn,
  hi,
  mid,
  lo 
)    SETDEC64(in,scl,sgn,hi,mid,lo); hres = func(&in, &out)

Definition at line 105 of file vartype.c.

◆ CONVERT_I8

#define CONVERT_I8 (   func,
  hi,
  lo 
)    in = hi; in = (in << 32) | lo; hres = func(in, &out)

Definition at line 91 of file vartype.c.

◆ CONVERT_STR

#define CONVERT_STR (   func,
  str,
  flags 
)
Value:
hres = func(str ? buff : NULL,in,flags,&out)
GLenum func
Definition: glext.h:6028
#define CP_ACP
Definition: compat.h:99
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
static FILE * out
Definition: regtests2xml.c:44
#define SetLastError(x)
Definition: compat.h:417
GLbitfield flags
Definition: glext.h:7161
GLuint in
Definition: glext.h:9616
#define ARRAY_SIZE(a)
Definition: main.h:24
#define MultiByteToWideChar
Definition: compat.h:100
static unsigned char buff[32768]
Definition: fatten.c:17

Definition at line 113 of file vartype.c.

◆ CONVERTRANGE [1/2]

#define CONVERTRANGE (   func,
  start,
  end 
)    for (i = start; i < end; i+=1) { CONVERT(func, i); EXPECT(i); };

Definition at line 4272 of file vartype.c.

◆ CONVERTRANGE [2/2]

#define CONVERTRANGE (   func,
  start,
  end 
)
Value:
for (i = start; i < end; i++) { \
CONVERT(func, i); if (i) { EXPECT(VARIANT_TRUE); } else { EXPECT(VARIANT_FALSE); } }
GLenum func
Definition: glext.h:6028
#define EXPECT(x)
Definition: vartype.c:78
GLuint GLuint end
Definition: gl.h:1545
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
GLuint start
Definition: gl.h:1545

Definition at line 4272 of file vartype.c.

◆ CONVVARS

#define CONVVARS (   typ)    HRESULT hres; CONV_TYPE out; typ in

Definition at line 65 of file vartype.c.

◆ COPYTEST

#define COPYTEST (   val,
  vt,
  srcval,
  dstval,
  srcref,
  dstref,
  fs 
)
Value:
do { \
HRESULT hres; VARIANTARG vSrc, vDst; CONV_TYPE in = val; \
VariantInit(&vSrc); VariantInit(&vDst); \
V_VT(&vSrc) = vt; srcval = in; \
hres = VariantCopy(&vDst, &vSrc); \
ok(hres == S_OK && V_VT(&vDst) == vt && dstval == in, \
"copy hres 0x%X, type %d, value (" fs ") " fs "\n", hres, V_VT(&vDst), val, dstval); \
V_VT(&vSrc) = vt|VT_BYREF; srcref = &in; \
hres = VariantCopy(&vDst, &vSrc); \
ok(hres == S_OK && V_VT(&vDst) == (vt|VT_BYREF) && dstref == &in, \
"ref hres 0x%X, type %d, ref (%p) %p\n", hres, V_VT(&vDst), &in, dstref); \
hres = VariantCopyInd(&vDst, &vSrc); \
ok(hres == S_OK && V_VT(&vDst) == vt && dstval == in, \
"ind hres 0x%X, type %d, value (" fs ") " fs "\n", hres, V_VT(&vDst), val, dstval); \
} while(0)
HRESULT WINAPI VariantCopyInd(VARIANT *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:850
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
Definition: fs.h:235
#define CONV_TYPE
Definition: vartype.c:4268
GLuint GLfloat * val
Definition: glext.h:7180
HRESULT hres
Definition: protocol.c:465
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
GLuint in
Definition: glext.h:9616
HRESULT WINAPI VariantCopy(VARIANTARG *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:751

Definition at line 118 of file vartype.c.

◆ CY_MULTIPLIER

#define CY_MULTIPLIER   10000

Definition at line 86 of file vartype.c.

◆ DATE_MAX

#define DATE_MAX   2958465

Definition at line 89 of file vartype.c.

◆ DATE_MIN

#define DATE_MIN   -657434

Definition at line 88 of file vartype.c.

◆ DEFINE_EXPECT

#define DEFINE_EXPECT (   func)    static BOOL expect_ ## func = FALSE, called_ ## func = FALSE

Definition at line 250 of file vartype.c.

◆ DFS

#define DFS (   str)
Value:
buff[0] = '\0'; out = 0.0; \
#define CP_ACP
Definition: compat.h:99
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
HRESULT WINAPI VarDateFromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, DATE *pdateOut)
Definition: vartype.c:7594
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
static FILE * out
Definition: regtests2xml.c:44
#define ARRAY_SIZE(a)
Definition: main.h:24
#define MultiByteToWideChar
Definition: compat.h:100
static unsigned char buff[32768]
Definition: fatten.c:17

Definition at line 2945 of file vartype.c.

◆ EXPECT

#define EXPECT (   x)    EXPECTRES(S_OK, (x))

Definition at line 78 of file vartype.c.

◆ EXPECT_BADVAR

#define EXPECT_BADVAR   _EXPECT_NO_OUT(DISP_E_BADVARTYPE)

Definition at line 70 of file vartype.c.

◆ EXPECT_DBL

#define EXPECT_DBL (   x)    ok(hres == S_OK && fabs(out-(x))<=1e-14*(x), "expected %16.16g, got %16.16g; hres=0x%08x\n", (x), out, hres)

Definition at line 79 of file vartype.c.

◆ EXPECT_EQ

#define EXPECT_EQ   _EXPECT_NO_OUT(VARCMP_EQ)

Definition at line 74 of file vartype.c.

◆ EXPECT_GT

#define EXPECT_GT   _EXPECT_NO_OUT(VARCMP_GT)

Definition at line 73 of file vartype.c.

◆ EXPECT_INVALID

#define EXPECT_INVALID   _EXPECT_NO_OUT(E_INVALIDARG)

Definition at line 71 of file vartype.c.

◆ EXPECT_LT

#define EXPECT_LT   _EXPECT_NO_OUT(VARCMP_LT)

Definition at line 72 of file vartype.c.

◆ EXPECT_MISMATCH

#define EXPECT_MISMATCH   _EXPECT_NO_OUT(DISP_E_TYPEMISMATCH)

Definition at line 69 of file vartype.c.

◆ EXPECT_OVERFLOW

#define EXPECT_OVERFLOW   _EXPECT_NO_OUT(DISP_E_OVERFLOW)

Definition at line 68 of file vartype.c.

◆ EXPECTCY

#define EXPECTCY (   x)
Value:
ok((hres == S_OK && out.int64 == (LONGLONG)(x*CY_MULTIPLIER)), \
"expected " #x "*CY_MULTIPLIER, got (%8x %8x); hres=0x%08x\n", S(out).Hi, S(out).Lo, hres)
#define CY_MULTIPLIER
Definition: vartype.c:86
#define S(x)
Definition: test.h:190
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
Definition: movable.cpp:7
int64_t LONGLONG
Definition: typedefs.h:66
HRESULT hres
Definition: protocol.c:465
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

Definition at line 3201 of file vartype.c.

◆ EXPECTCY64

#define EXPECTCY64 (   x,
  y 
)
Value:
ok(hres == S_OK && S(out).Hi == (LONG)x && S(out).Lo == y, \
"expected " #x " " #y " (%u,%u), got (%u,%u); hres=0x%08x\n", \
(ULONG)(x), (ULONG)(y), S(out).Hi, S(out).Lo, hres)
#define S(x)
Definition: test.h:190
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
long LONG
Definition: pedump.c:60
HRESULT hres
Definition: protocol.c:465
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
unsigned int ULONG
Definition: retypes.h:1

Definition at line 3205 of file vartype.c.

◆ EXPECTDEC

#define EXPECTDEC (   scl,
  sgn,
  hi,
  lo 
)
Value:
ok(hres == S_OK && \
S(U(out)).scale == (BYTE)(scl) && S(U(out)).sign == (BYTE)(sgn) && \
out.Hi32 == (ULONG)(hi) && U1(out).Lo64 == (ULONG64)(lo), \
"expected (%d,%d,%d,(%x %x)), got (%d,%d,%d,(%x %x)) hres 0x%08x\n", \
scl, sgn, hi, (LONG)((LONG64)(lo) >> 32), (LONG)((lo) & 0xffffffff), S(U(out)).scale, \
S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres)
static size_t double int int int * sign
Definition: printf.c:69
#define U1(x)
Definition: test.h:172
long sgn(REAL x)
Definition: varray.cc:48
#define S1(x)
Definition: test.h:191
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
#define U(x)
Definition: wordpad.c:44
#define S(x)
Definition: test.h:190
long LONG
Definition: pedump.c:60
int64_t LONG64
Definition: typedefs.h:66
HRESULT hres
Definition: protocol.c:465
static FILE * out
Definition: regtests2xml.c:44
unsigned __int64 ULONG64
Definition: imports.h:198
unsigned char BYTE
Definition: mem.h:68
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
unsigned int ULONG
Definition: retypes.h:1

Definition at line 3676 of file vartype.c.

◆ EXPECTDEC64

#define EXPECTDEC64 (   scl,
  sgn,
  hi,
  mid,
  lo 
)
Value:
ok(hres == S_OK && \
S(U(out)).scale == (BYTE)(scl) && S(U(out)).sign == (BYTE)(sgn) && \
out.Hi32 == (ULONG)(hi) && S1(U1(out)).Mid32 == (ULONG)(mid) && \
S1(U1(out)).Lo32 == (ULONG)(lo), \
"expected (%d,%d,%d,(%x %x)), got (%d,%d,%d,(%x %x)) hres 0x%08x\n", \
scl, sgn, hi, (LONG)(mid), (LONG)(lo), S(U(out)).scale, \
S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres)
static size_t double int int int * sign
Definition: printf.c:69
#define U1(x)
Definition: test.h:172
long sgn(REAL x)
Definition: varray.cc:48
#define S1(x)
Definition: test.h:191
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
#define U(x)
Definition: wordpad.c:44
#define S(x)
Definition: test.h:190
long LONG
Definition: pedump.c:60
HRESULT hres
Definition: protocol.c:465
static FILE * out
Definition: regtests2xml.c:44
unsigned char BYTE
Definition: mem.h:68
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
unsigned int ULONG
Definition: retypes.h:1

Definition at line 3683 of file vartype.c.

◆ EXPECTDECI

#define EXPECTDECI   if (i < 0) EXPECTDEC(0, 0x80, 0, -i); else EXPECTDEC(0, 0, 0, i)

Definition at line 3697 of file vartype.c.

◆ EXPECTDECZERO

#define EXPECTDECZERO ( )
Value:
ok(hres == S_OK && S(U(out)).scale == 0 && \
(S(U(out)).sign == 0 || S(U(out)).sign == 0x80) && out.Hi32 == 0 && U1(out).Lo64 == 0, \
"expected zero, got (%d,%d,%d,(%x %x)) hres 0x%08x\n", \
S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres)
static size_t double int int int * sign
Definition: printf.c:69
#define U1(x)
Definition: test.h:172
#define S1(x)
Definition: test.h:191
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
#define U(x)
Definition: wordpad.c:44
#define S(x)
Definition: test.h:190
HRESULT hres
Definition: protocol.c:465
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

Definition at line 3692 of file vartype.c.

◆ EXPECTI8

#define EXPECTI8 (   x)
Value:
ok((hres == S_OK && out == (CONV_TYPE)(x)), \
"expected " #x "(%u,%u), got (%u,%u); hres=0x%08x\n", \
(ULONG)((LONG64)(x) >> 32), (ULONG)((x) & 0xffffffff), \
(ULONG)(out >> 32), (ULONG)(out & 0xffffffff), hres)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define CONV_TYPE
Definition: vartype.c:4268
int64_t LONG64
Definition: typedefs.h:66
HRESULT hres
Definition: protocol.c:465
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
unsigned int ULONG
Definition: retypes.h:1

Definition at line 1865 of file vartype.c.

◆ EXPECTI864

#define EXPECTI864 (   x,
  y 
)
Value:
ok(hres == S_OK && (out >> 32) == (CONV_TYPE)(x) && (out & 0xffffffff) == (CONV_TYPE)(y), \
"expected " #x "(%u,%u), got (%u,%u); hres=0x%08x\n", \
(ULONG)(x), (ULONG)(y), \
(ULONG)(out >> 32), (ULONG)(out & 0xffffffff), hres)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define CONV_TYPE
Definition: vartype.c:4268
HRESULT hres
Definition: protocol.c:465
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
unsigned int ULONG
Definition: retypes.h:1

Definition at line 1871 of file vartype.c.

◆ EXPECTRES [1/4]

#define EXPECTRES (   res,
  x 
)    _EXPECTRES(res, x, "%d")

Definition at line 4270 of file vartype.c.

◆ EXPECTRES [2/4]

#define EXPECTRES (   res,
  x 
)    _EXPECTRES(res, x, "%u")

Definition at line 4270 of file vartype.c.

◆ EXPECTRES [3/4]

#define EXPECTRES (   res,
  x 
)    _EXPECTRES(res, x, "%15.15f")

Definition at line 4270 of file vartype.c.

◆ EXPECTRES [4/4]

#define EXPECTRES (   res,
  x 
)    _EXPECTRES(res, x, "%d")

Definition at line 4270 of file vartype.c.

◆ HAS_UINT64_TO_FLOAT

#define HAS_UINT64_TO_FLOAT

Definition at line 39 of file vartype.c.

◆ INITIAL_TYPETEST

#define INITIAL_TYPETEST (   vt,
  val,
  fs 
)
Value:
VariantInit(&vSrc); \
VariantInit(&vDst); \
V_VT(&vSrc) = vt; \
(val(&vSrc)) = in; \
TYPETEST(VT_I1, V_I1(&vDst), fs); \
TYPETEST(VT_UI2, V_UI2(&vDst), fs); \
TYPETEST(VT_UI4, V_UI4(&vDst), fs); \
TYPETEST(VT_INT, V_INT(&vDst), fs); \
TYPETEST(VT_UINT, V_UINT(&vDst), fs); \
TYPETEST(VT_UI1, V_UI1(&vDst), fs); \
TYPETEST(VT_I2, V_I2(&vDst), fs); \
TYPETEST(VT_I4, V_I4(&vDst), fs); \
TYPETEST(VT_R4, V_R4(&vDst), fs); \
TYPETEST(VT_R8, V_R8(&vDst), fs); \
TYPETEST(VT_DATE, V_DATE(&vDst), fs); \
if (has_i8) \
{ \
TYPETEST(VT_I8, V_I8(&vDst), fs); \
TYPETEST(VT_UI8, V_UI8(&vDst), fs); \
}
Definition: compat.h:1947
Definition: compat.h:1963
Definition: compat.h:1959
#define V_R8(A)
Definition: oleauto.h:262
#define V_I2(A)
Definition: oleauto.h:245
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
Definition: fs.h:235
#define V_UI8(A)
Definition: oleauto.h:272
#define V_I4(A)
Definition: oleauto.h:247
#define V_UI2(A)
Definition: oleauto.h:268
#define V_I1(A)
Definition: oleauto.h:243
static BOOL has_i8
Definition: vartype.c:56
GLuint GLfloat * val
Definition: glext.h:7180
#define V_I8(A)
Definition: oleauto.h:249
#define V_R4(A)
Definition: oleauto.h:260
#define V_UI1(A)
Definition: oleauto.h:266
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
#define V_UI4(A)
Definition: oleauto.h:270
Definition: compat.h:1948
GLuint in
Definition: glext.h:9616
#define V_INT(x)
Definition: webchild.h:78
#define V_UINT(A)
Definition: oleauto.h:264
Definition: compat.h:1949
Definition: compat.h:1946
#define V_DATE(A)
Definition: oleauto.h:231

Definition at line 147 of file vartype.c.

◆ INITIAL_TYPETESTI8

#define INITIAL_TYPETESTI8 (   vt,
  val 
)
Value:
VariantInit(&vSrc); \
VariantInit(&vDst); \
V_VT(&vSrc) = vt; \
(val(&vSrc)) = in; \
TYPETESTI8(VT_I1, V_I1(&vDst)); \
TYPETESTI8(VT_UI1, V_UI1(&vDst)); \
TYPETESTI8(VT_I2, V_I2(&vDst)); \
TYPETESTI8(VT_UI2, V_UI2(&vDst)); \
TYPETESTI8(VT_I4, V_I4(&vDst)); \
TYPETESTI8(VT_UI4, V_UI4(&vDst)); \
TYPETESTI8(VT_INT, V_INT(&vDst)); \
TYPETESTI8(VT_UINT, V_UINT(&vDst)); \
TYPETESTI8(VT_R4, V_R4(&vDst)); \
TYPETESTI8(VT_R8, V_R8(&vDst)); \
TYPETESTI8(VT_DATE, V_DATE(&vDst)); \
TYPETESTI8(VT_I8, V_I8(&vDst)); \
TYPETESTI8(VT_UI8, V_UI8(&vDst))
Definition: compat.h:1947
Definition: compat.h:1963
Definition: compat.h:1959
#define V_R8(A)
Definition: oleauto.h:262
#define V_I2(A)
Definition: oleauto.h:245
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define V_UI8(A)
Definition: oleauto.h:272
#define V_I4(A)
Definition: oleauto.h:247
#define V_UI2(A)
Definition: oleauto.h:268
#define V_I1(A)
Definition: oleauto.h:243
GLuint GLfloat * val
Definition: glext.h:7180
#define V_I8(A)
Definition: oleauto.h:249
#define V_R4(A)
Definition: oleauto.h:260
#define V_UI1(A)
Definition: oleauto.h:266
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
#define V_UI4(A)
Definition: oleauto.h:270
Definition: compat.h:1948
GLuint in
Definition: glext.h:9616
#define V_INT(x)
Definition: webchild.h:78
#define V_UINT(A)
Definition: oleauto.h:264
Definition: compat.h:1949
Definition: compat.h:1946
#define V_DATE(A)
Definition: oleauto.h:231

Definition at line 176 of file vartype.c.

◆ IS_MODERN_VTYPE

#define IS_MODERN_VTYPE (   vt)
Value:
vt==VT_I1||vt==VT_UI2||vt==VT_UI4||vt == VT_INT||vt == VT_UINT)
Definition: compat.h:1959
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85

Definition at line 61 of file vartype.c.

◆ MATH1 [1/2]

#define MATH1 (   func,
  l 
)    left = (double)l; VarCyFromR8(left, &cyLeft); hres = func(cyLeft, &out)

Definition at line 3875 of file vartype.c.

◆ MATH1 [2/2]

#define MATH1 (   func)    hres = func(&l, &out)

Definition at line 3875 of file vartype.c.

◆ MATH2 [1/2]

#define MATH2 (   func,
  l,
  r 
)
Value:
VarCyFromR8(left, &cyLeft); VarCyFromR8(right, &cyRight); \
hres = func(cyLeft, cyRight, &out)
GLenum func
Definition: glext.h:6028
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
HRESULT WINAPI VarCyFromR8(double dblIn, CY *pCyOut)
Definition: vartype.c:3502
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
r l[0]
Definition: byte_order.h:167
static FILE * out
Definition: regtests2xml.c:44
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859

Definition at line 3877 of file vartype.c.

◆ MATH2 [2/2]

#define MATH2 (   func)    hres = func(&l, &r, &out)

Definition at line 3877 of file vartype.c.

◆ MATH3

#define MATH3 (   func)    hres = func(&l, r)

Definition at line 3879 of file vartype.c.

◆ MATHCMP

#define MATHCMP (   l,
  r 
)
Value:
left = l; right = r; VarCyFromR8(left, &cyLeft); VarCyFromR8(right, &cyRight); \
hres = VarCyCmp(cyLeft, cyRight)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
HRESULT WINAPI VarCyFromR8(double dblIn, CY *pCyOut)
Definition: vartype.c:3502
r l[0]
Definition: byte_order.h:167
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HRESULT WINAPI VarCyCmp(CY cyLeft, CY cyRight)
Definition: vartype.c:4011

Definition at line 3541 of file vartype.c.

◆ MATHCMPR8

#define MATHCMPR8 (   l,
  r 
)
Value:
left = l; right = r; VarCyFromR8(left, &cyLeft); \
hres = VarCyCmpR8(cyLeft, right);
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
HRESULT WINAPI VarCyFromR8(double dblIn, CY *pCyOut)
Definition: vartype.c:3502
r l[0]
Definition: byte_order.h:167
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HRESULT WINAPI VarCyCmpR8(CY cyLeft, double dblRight)
Definition: vartype.c:4045

Definition at line 3563 of file vartype.c.

◆ MATHFIX

#define MATHFIX (   l)
Value:
left = l; VarCyFromR8(left, &cyLeft); \
hres = VarCyFix(cyLeft, &out)
HRESULT WINAPI VarCyFromR8(double dblIn, CY *pCyOut)
Definition: vartype.c:3502
r l[0]
Definition: byte_order.h:167
static FILE * out
Definition: regtests2xml.c:44
GLint left
Definition: glext.h:7726
HRESULT WINAPI VarCyFix(CY cyIn, CY *pCyOut)
Definition: vartype.c:3901

Definition at line 3619 of file vartype.c.

◆ MATHINT

#define MATHINT (   l)
Value:
left = l; VarCyFromR8(left, &cyLeft); \
hres = VarCyInt(cyLeft, &out)
HRESULT WINAPI VarCyFromR8(double dblIn, CY *pCyOut)
Definition: vartype.c:3502
r l[0]
Definition: byte_order.h:167
static FILE * out
Definition: regtests2xml.c:44
GLint left
Definition: glext.h:7726
HRESULT WINAPI VarCyInt(CY cyIn, CY *pCyOut)
Definition: vartype.c:3925

Definition at line 3644 of file vartype.c.

◆ MATHMULI4

#define MATHMULI4 (   l,
  r 
)
Value:
left = l; right = r; VarCyFromR8(left, &cyLeft); \
hres = VarCyMulI4(cyLeft, right, &out)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
HRESULT WINAPI VarCyFromR8(double dblIn, CY *pCyOut)
Definition: vartype.c:3502
r l[0]
Definition: byte_order.h:167
static FILE * out
Definition: regtests2xml.c:44
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HRESULT WINAPI VarCyMulI4(CY cyLeft, LONG lRight, CY *pCyOut)
Definition: vartype.c:3830

Definition at line 3511 of file vartype.c.

◆ MATHMULI8

#define MATHMULI8 (   l,
  r 
)
Value:
left = l; right = r; VarCyFromR8(left, &cyLeft); \
hres = VarCyMulI8(cyLeft, right, &out)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
HRESULT WINAPI VarCyFromR8(double dblIn, CY *pCyOut)
Definition: vartype.c:3502
r l[0]
Definition: byte_order.h:167
static FILE * out
Definition: regtests2xml.c:44
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HRESULT WINAPI VarCyMulI8(CY cyLeft, LONG64 llRight, CY *pCyOut)
Definition: vartype.c:4072

Definition at line 3526 of file vartype.c.

◆ MATHRND [1/2]

#define MATHRND (   l,
  r 
)    left = l; right = r; hres = VarR8Round(left, right, &out)

Definition at line 3587 of file vartype.c.

◆ MATHRND [2/2]

#define MATHRND (   l,
  r 
)
Value:
left = l; right = r; VarCyFromR8(left, &cyLeft); \
hres = VarCyRound(cyLeft, right, &out)
HRESULT WINAPI VarCyRound(CY cyIn, int cDecimals, CY *pCyOut)
Definition: vartype.c:3973
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
HRESULT WINAPI VarCyFromR8(double dblIn, CY *pCyOut)
Definition: vartype.c:3502
r l[0]
Definition: byte_order.h:167
static FILE * out
Definition: regtests2xml.c:44
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859

Definition at line 3587 of file vartype.c.

◆ MATHVARS1 [1/2]

#define MATHVARS1   HRESULT hres; double left = 0.0; CY cyLeft, out

Definition at line 3871 of file vartype.c.

◆ MATHVARS1 [2/2]

#define MATHVARS1   HRESULT hres; DECIMAL l, out

Definition at line 3871 of file vartype.c.

◆ MATHVARS2 [1/2]

#define MATHVARS2   MATHVARS1; double right = 0.0; CY cyRight

Definition at line 3873 of file vartype.c.

◆ MATHVARS2 [2/2]

#define MATHVARS2   MATHVARS1; DECIMAL r

Definition at line 3873 of file vartype.c.

◆ MISMATCH

#define MISMATCH (   typ)    CHANGETYPEEX(typ); EXPECT_MISMATCH

Definition at line 145 of file vartype.c.

◆ MKRELDATE

#define MKRELDATE (   day,
  mth 
)
Value:
st.wMonth = mth; st.wDay = day; \
SystemTimeToVariantTime(&st,&relative)
static DOUBLE day(DOUBLE time)
Definition: date.c:117

Definition at line 2950 of file vartype.c.

◆ NEGATIVE_TYPETEST

#define NEGATIVE_TYPETEST (   vt,
  val,
  fs,
  vtneg,
  valneg 
)
Value:
in = -in; \
VariantInit(&vSrc); \
VariantInit(&vDst); \
V_VT(&vSrc) = vt; \
(val(&vSrc)) = in; \
TYPETEST(vtneg, valneg(&vDst), fs);
Definition: fs.h:235
GLuint GLfloat * val
Definition: glext.h:7180
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
GLuint in
Definition: glext.h:9616

Definition at line 168 of file vartype.c.

◆ NUM_CUST_ITEMS

#define NUM_CUST_ITEMS   16

Definition at line 5823 of file vartype.c.

◆ OVERFLOWRANGE

#define OVERFLOWRANGE (   func,
  start,
  end 
)    for (i = start; i < end; i+=1) { CONVERT(func, i); EXPECT_OVERFLOW; };

Definition at line 84 of file vartype.c.

◆ SET_EXPECT

#define SET_EXPECT (   func)    do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)

Definition at line 253 of file vartype.c.

◆ SETDEC

#define SETDEC (   dec,
  scl,
  sgn,
  hi,
  lo 
)
Value:
S(U(dec)).scale = (BYTE)scl; S(U(dec)).sign = (BYTE)sgn; \
dec.Hi32 = (ULONG)hi; U1(dec).Lo64 = (ULONG64)lo
#define U1(x)
Definition: test.h:172
long sgn(REAL x)
Definition: varray.cc:48
#define U(x)
Definition: wordpad.c:44
#define S(x)
Definition: test.h:190
ios_base &_STLP_CALL dec(ios_base &__s)
Definition: _ios_base.h:321
unsigned __int64 ULONG64
Definition: imports.h:198
unsigned char BYTE
Definition: mem.h:68
unsigned int ULONG
Definition: retypes.h:1

Definition at line 97 of file vartype.c.

◆ SETDEC64

#define SETDEC64 (   dec,
  scl,
  sgn,
  hi,
  mid,
  lo 
)
Value:
S(U(dec)).scale = (BYTE)scl; S(U(dec)).sign = (BYTE)sgn; \
dec.Hi32 = (ULONG)hi; S1(U1(dec)).Mid32 = mid; S1(U1(dec)).Lo32 = lo;
#define U1(x)
Definition: test.h:172
long sgn(REAL x)
Definition: varray.cc:48
#define S1(x)
Definition: test.h:191
#define U(x)
Definition: wordpad.c:44
#define S(x)
Definition: test.h:190
ios_base &_STLP_CALL dec(ios_base &__s)
Definition: _ios_base.h:321
unsigned char BYTE
Definition: mem.h:68
unsigned int ULONG
Definition: retypes.h:1

Definition at line 100 of file vartype.c.

◆ TYPETEST

#define TYPETEST (   typ,
  res,
  fs 
)
Value:
CHANGETYPEEX(typ); \
ok(hres == S_OK && V_VT(&vDst) == typ && (CONV_TYPE)res == in, \
"hres=0x%X, type=%d (should be %d(" #typ ")), value=" fs " (should be " fs ")\n", \
hres, V_VT(&vDst), typ, (CONV_TYPE)res, in);
Definition: fs.h:235
#define CONV_TYPE
Definition: vartype.c:4268
HRESULT hres
Definition: protocol.c:465
#define CHANGETYPEEX(typ)
Definition: vartype.c:134
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
GLuint in
Definition: glext.h:9616
GLuint res
Definition: glext.h:9613

Definition at line 136 of file vartype.c.

◆ TYPETESTI8

#define TYPETESTI8 (   typ,
  res 
)
Value:
CHANGETYPEEX(typ); \
ok(hres == S_OK && V_VT(&vDst) == typ && (CONV_TYPE)res == in, \
"hres=0x%X, type=%d (should be %d(" #typ ")), value=%d (should be 1)\n", \
hres, V_VT(&vDst), typ, (int)res);
#define CONV_TYPE
Definition: vartype.c:4268
HRESULT hres
Definition: protocol.c:465
#define CHANGETYPEEX(typ)
Definition: vartype.c:134
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
GLuint in
Definition: glext.h:9616
GLuint res
Definition: glext.h:9613

Definition at line 140 of file vartype.c.

◆ VARBSTRCMP

#define VARBSTRCMP (   left,
  right,
  flags,
  result 
)    _VARBSTRCMP(left,right,lcid,flags,result)

Definition at line 4811 of file vartype.c.

Typedef Documentation

◆ INTERNAL_BSTR

◆ LPINTERNAL_BSTR

Function Documentation

◆ _BSTR_CY()

static void _BSTR_CY ( LONG  a,
LONG  b,
const char str,
LCID  lcid,
int  line 
)
static

Definition at line 4675 of file vartype.c.

4676 {
4677  HRESULT hr;
4678  BSTR bstr = NULL;
4679  char buff[256];
4680  CY l;
4681 
4682  S(l).Lo = b;
4683  S(l).Hi = a;
4684  hr = VarBstrFromCy(l, lcid, LOCALE_NOUSEROVERRIDE, &bstr);
4685  ok(hr == S_OK, "got hr 0x%08x\n", hr);
4686 
4687  if(bstr)
4688  {
4689  WideCharToMultiByte(CP_ACP, 0, bstr, -1, buff, sizeof(buff), 0, 0);
4690  SysFreeString(bstr);
4691  }
4692  else
4693  buff[0] = 0;
4694 
4695  if(hr == S_OK)
4696  {
4697  ok_(__FILE__, line)(!strcmp(str, buff), "Expected '%s', got '%s'\n", str, buff);
4698  }
4699 }
#define WideCharToMultiByte
Definition: compat.h:101
HRESULT hr
Definition: shlfolder.c:183
#define CP_ACP
Definition: compat.h:99
#define S(x)
Definition: test.h:190
OLECHAR * BSTR
Definition: compat.h:1942
Definition: compat.h:1904
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
#define a
Definition: ke_i.h:78
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
#define b
Definition: ke_i.h:79
r l[0]
Definition: byte_order.h:167
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
HRESULT WINAPI VarBstrFromCy(CY cyIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
Definition: vartype.c:6607
static unsigned char buff[32768]
Definition: fatten.c:17
#define ok_(x1, x2)
Definition: atltest.h:61

◆ _BSTR_DATE()

static void _BSTR_DATE ( DATE  dt,
const char str,
int  line 
)
static

Definition at line 4638 of file vartype.c.

4639 {
4641  char buff[256];
4642  BSTR bstr = NULL;
4643  HRESULT hres;
4644 
4645  hres = VarBstrFromDate(dt, lcid, LOCALE_NOUSEROVERRIDE, &bstr);
4646  if (bstr)
4647  {
4648  WideCharToMultiByte(CP_ACP, 0, bstr, -1, buff, sizeof(buff), 0, 0);
4649  SysFreeString(bstr);
4650  }
4651  else
4652  buff[0] = 0;
4653  ok_(__FILE__, line)(hres == S_OK && !strcmp(str, buff),
4654  "Expected '%s', got '%s', hres = 0x%08x\n", str, buff, hres);
4655 }
#define MAKELCID(lgid, srtid)
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
DWORD LCID
Definition: nls.h:13
OLECHAR * BSTR
Definition: compat.h:1942
HRESULT WINAPI VarBstrFromDate(DATE dateIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
Definition: vartype.c:6777
#define SUBLANG_ENGLISH_US
Definition: nls.h:222
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define SORT_DEFAULT
#define LANG_ENGLISH
Definition: nls.h:52
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define MAKELANGID(p, s)
Definition: nls.h:15
static unsigned char buff[32768]
Definition: fatten.c:17
#define ok_(x1, x2)
Definition: atltest.h:61

◆ _BSTR_DEC()

static void _BSTR_DEC ( BYTE  scale,
BYTE  sign,
ULONG  hi,
ULONG  mid,
ULONGLONG  lo,
const char str,
LCID  lcid,
int  line 
)
static

Definition at line 4726 of file vartype.c.

4728 {
4729  char buff[256];
4730  HRESULT hr;
4731  BSTR bstr = NULL;
4732  DECIMAL dec;
4733 
4734  SETDEC64(dec, scale, sign, hi, mid, lo);
4735  hr = VarBstrFromDec(&dec, lcid, LOCALE_NOUSEROVERRIDE, &bstr);
4736  ok_(__FILE__, line)(hr == S_OK, "got hr 0x%08x\n", hr);
4737 
4738  if(bstr)
4739  {
4740  WideCharToMultiByte(CP_ACP, 0, bstr, -1, buff, sizeof(buff), 0, 0);
4741  SysFreeString(bstr);
4742  }
4743  else
4744  buff[0] = 0;
4745 
4746  if(hr == S_OK)
4747  {
4748  ok_(__FILE__, line)(!strcmp(str, buff), "Expected '%s', got '%s'\n", str, buff);
4749  }
4750 }
static size_t double int int int * sign
Definition: printf.c:69
#define WideCharToMultiByte
Definition: compat.h:101
HRESULT hr
Definition: shlfolder.c:183
#define CP_ACP
Definition: compat.h:99
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
ios_base &_STLP_CALL dec(ios_base &__s)
Definition: _ios_base.h:321
OLECHAR * BSTR
Definition: compat.h:1942
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
HRESULT WINAPI VarBstrFromDec(DECIMAL *pDecIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
Definition: vartype.c:6990
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static unsigned char buff[32768]
Definition: fatten.c:17
#define ok_(x1, x2)
Definition: atltest.h:61
#define SETDEC64(dec, scl, sgn, hi, mid, lo)
Definition: vartype.c:100

◆ create_test_typelib()

static const char* create_test_typelib ( int  res_no)
static

Definition at line 5969 of file vartype.c.

5970 {
5971  static char filename[MAX_PATH];
5972 
5973  GetTempFileNameA( ".", "tlb", 0, filename );
5974  write_typelib(res_no, filename);
5975  return filename;
5976 }
const char * filename
Definition: ioapi.h:135
static void write_typelib(int res_no, const char *filename)
Definition: vartype.c:5951
#define MAX_PATH
Definition: compat.h:26
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
Definition: filename.c:26

Referenced by test_recinfo().

◆ DEFINE_EXPECT()

DEFINE_EXPECT ( dispatch_invoke  )

◆ DEFINE_GUID()

DEFINE_GUID ( UUID_test_struct  ,
0x4029f190  ,
0xca4a  ,
0x4611  ,
0xae  ,
0xb9  ,
0x67  ,
0x39  ,
0x83  ,
0xcb  ,
0x96  ,
0xdd   
)

◆ DummyDispatch_AddRef()

static ULONG WINAPI DummyDispatch_AddRef ( IDispatch iface)
static

Definition at line 296 of file vartype.c.

297 {
299  return InterlockedIncrement(&This->ref);
300 }
static DummyDispatch * impl_from_IDispatch(IDispatch *iface)
Definition: vartype.c:291
#define InterlockedIncrement
Definition: armddk.h:53

◆ DummyDispatch_GetIDsOfNames()

static HRESULT WINAPI DummyDispatch_GetIDsOfNames ( IDispatch iface,
REFIID  riid,
LPOLESTR names,
UINT  cnames,
LCID  lcid,
DISPID dispid 
)
static

Definition at line 336 of file vartype.c.

338 {
339  ok(0, "Unexpected call\n");
340  return E_NOTIMPL;
341 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DummyDispatch_GetTypeInfo()

static HRESULT WINAPI DummyDispatch_GetTypeInfo ( IDispatch iface,
UINT  tinfo,
LCID  lcid,
ITypeInfo **  ti 
)
static

Definition at line 330 of file vartype.c.

331 {
332  ok(0, "Unexpected call\n");
333  return E_NOTIMPL;
334 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DummyDispatch_GetTypeInfoCount()

static HRESULT WINAPI DummyDispatch_GetTypeInfoCount ( IDispatch iface,
UINT pctinfo 
)
static

Definition at line 324 of file vartype.c.

325 {
326  ok(0, "Unexpected call\n");
327  return E_NOTIMPL;
328 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DummyDispatch_Invoke()

static HRESULT WINAPI DummyDispatch_Invoke ( IDispatch iface,
DISPID  dispid,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  params,
VARIANT res,
EXCEPINFO *  ei,
UINT arg_err 
)
static

Definition at line 343 of file vartype.c.

350 {
352 
353  CHECK_EXPECT(dispatch_invoke);
354 
355  ok(dispid == DISPID_VALUE, "got dispid %d\n", dispid);
356  ok(IsEqualIID(riid, &IID_NULL), "go riid %s\n", wine_dbgstr_guid(riid));
357  ok(wFlags == DISPATCH_PROPERTYGET, "Flags wrong\n");
358 
359  ok(params->rgvarg == NULL, "got %p\n", params->rgvarg);
360  ok(params->rgdispidNamedArgs == NULL, "got %p\n", params->rgdispidNamedArgs);
361  ok(params->cArgs == 0, "got %d\n", params->cArgs);
362  ok(params->cNamedArgs == 0, "got %d\n", params->cNamedArgs);
363 
364  ok(res != NULL, "got %p\n", res);
365  ok(V_VT(res) == VT_EMPTY, "got %d\n", V_VT(res));
366  ok(ei == NULL, "got %p\n", ei);
367  ok(arg_err == NULL, "got %p\n", arg_err);
368 
369  if (This->bFailInvoke)
370  return E_OUTOFMEMORY;
371 
372  V_VT(res) = This->vt;
373  if (This->vt == VT_UI1)
374  V_UI1(res) = 1;
375  else
376  memset(res, 0, sizeof(*res));
377 
378  return S_OK;
379 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
REFIID riid
Definition: precomp.h:44
const char * wine_dbgstr_guid(const GUID *guid)
#define CHECK_EXPECT(func)
Definition: vartype.c:262
static DummyDispatch * impl_from_IDispatch(IDispatch *iface)
Definition: vartype.c:291
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
GLenum const GLfloat * params
Definition: glext.h:5645
smooth NULL
Definition: ftsmooth.c:416
#define V_UI1(A)
Definition: oleauto.h:266
#define IID_NULL
Definition: guiddef.h:98
#define V_VT(A)
Definition: oleauto.h:211
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
GLuint res
Definition: glext.h:9613
#define memset(x, y, z)
Definition: compat.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ DummyDispatch_QueryInterface()

static HRESULT WINAPI DummyDispatch_QueryInterface ( IDispatch iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 308 of file vartype.c.

311 {
312  *ppvObject = NULL;
313 
314  if (IsEqualIID(riid, &IID_IDispatch) ||
316  {
317  *ppvObject = iface;
318  IDispatch_AddRef(iface);
319  }
320 
321  return *ppvObject ? S_OK : E_NOINTERFACE;
322 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
const GUID IID_IDispatch
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ DummyDispatch_Release()

static ULONG WINAPI DummyDispatch_Release ( IDispatch iface)
static

Definition at line 302 of file vartype.c.

303 {
305  return InterlockedDecrement(&This->ref);
306 }
static DummyDispatch * impl_from_IDispatch(IDispatch *iface)
Definition: vartype.c:291
#define InterlockedDecrement
Definition: armddk.h:52

◆ Get()

static LPINTERNAL_BSTR Get ( const BSTR  lpszString)
inlinestatic

Definition at line 4895 of file vartype.c.

4896 {
4897  return lpszString ? (LPINTERNAL_BSTR)((char*)lpszString - sizeof(DWORD)) : NULL;
4898 }
struct tagINTERNAL_BSTR * LPINTERNAL_BSTR
#define DWORD
Definition: nt_native.h:44
smooth NULL
Definition: ftsmooth.c:416

Referenced by test_BstrCopy(), test_SysAllocString(), test_SysAllocStringByteLen(), test_SysAllocStringLen(), test_SysReAllocString(), and test_SysReAllocStringLen().

◆ GetBSTR()

static BSTR GetBSTR ( const LPINTERNAL_BSTR  bstr)
inlinestatic

Definition at line 4900 of file vartype.c.

4901 {
4902  return (BSTR)bstr->szString;
4903 }
OLECHAR * BSTR
Definition: compat.h:1942
OLECHAR szString[1]
Definition: vartype.c:280

Referenced by test_SysStringByteLen(), and test_SysStringLen().

◆ impl_from_IDispatch()

static DummyDispatch* impl_from_IDispatch ( IDispatch iface)
inlinestatic

Definition at line 291 of file vartype.c.

292 {
293  return CONTAINING_RECORD(iface, DummyDispatch, IDispatch_iface);
294 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by DummyDispatch_AddRef(), DummyDispatch_Invoke(), and DummyDispatch_Release().

◆ init_test_dispatch()

static void init_test_dispatch ( LONG  ref,
VARTYPE  vt,
DummyDispatch dispatch 
)
static

Definition at line 392 of file vartype.c.

393 {
394  dispatch->IDispatch_iface.lpVtbl = &DummyDispatch_VTable;
395  dispatch->ref = ref;
396  dispatch->vt = vt;
397  dispatch->bFailInvoke = FALSE;
398 }
GLenum GLint ref
Definition: glext.h:6028
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
static const IDispatchVtbl DummyDispatch_VTable
Definition: vartype.c:381

Referenced by test_IDispatchChangeTypeEx(), test_IDispatchClear(), test_IDispatchCopy(), test_IUnknownChangeTypeEx(), test_IUnknownClear(), test_IUnknownCopy(), test_recinfo(), and test_VarUI1FromDisp().

◆ START_TEST()

START_TEST ( vartype  )

Definition at line 6115 of file vartype.c.

6116 {
6117  hOleaut32 = GetModuleHandleA("oleaut32.dll");
6118 
6119  has_i8 = GetProcAddress(hOleaut32, "VarI8FromI1") != NULL;
6120  has_locales = has_i8 && GetProcAddress(hOleaut32, "GetVarConversionLocaleSetting") != NULL;
6121 
6122  trace("LCIDs: System=0x%08x, User=0x%08x\n", GetSystemDefaultLCID(),
6123  GetUserDefaultLCID());
6124 
6125  test_bstr_cache();
6126 
6127  test_VarI1FromI2();
6128  test_VarI1FromI4();
6129  test_VarI1FromI8();
6135  test_VarI1FromR4();
6136  test_VarI1FromR8();
6138  test_VarI1FromCy();
6142  test_VarI1Copy();
6144 
6159  test_VarUI1Copy();
6161 
6162  test_VarI2FromI1();
6163  test_VarI2FromI4();
6164  test_VarI2FromI8();
6170  test_VarI2FromR4();
6171  test_VarI2FromR8();
6173  test_VarI2FromCy();
6176  test_VarI2Copy();
6178 
6193  test_VarUI2Copy();
6195 
6196  test_VarI4FromI1();
6197  test_VarI4FromI2();
6198  test_VarI4FromI8();
6204  test_VarI4FromR4();
6205  test_VarI4FromR8();
6207  test_VarI4FromCy();
6210  test_VarI4Copy();
6212 
6227  test_VarUI4Copy();
6229 
6230  test_VarI8FromI1();
6232  test_VarI8FromI2();
6235  test_VarI8FromR4();
6236  test_VarI8FromR8();
6239  test_VarI8FromCy();
6243  test_VarI8Copy();
6245 
6259  test_VarUI8Copy();
6261 
6262  test_VarR4FromI1();
6264  test_VarR4FromI2();
6266  test_VarR4FromI4();
6268  test_VarR4FromR8();
6270  test_VarR4FromCy();
6271  test_VarR4FromI8();
6276  test_VarR4Copy();
6278 
6279  test_VarR8FromI1();
6281  test_VarR8FromI2();
6283  test_VarR8FromI4();
6285  test_VarR8FromR4();
6287  test_VarR8FromCy();
6288  test_VarR8FromI8();
6293  test_VarR8Copy();
6295  test_VarR8Round();
6296 
6311  test_VarDateCopy();
6313 
6314  test_VarCyFromI1();
6316  test_VarCyFromI2();
6318  test_VarCyFromI4();
6320  test_VarCyFromR4();
6321  test_VarCyFromR8();
6323  test_VarCyFromI8();
6327 
6328  test_VarCyAdd();
6329  test_VarCyMul();
6330  test_VarCySub();
6331  test_VarCyAbs();
6332  test_VarCyNeg();
6333  test_VarCyMulI4();
6334  test_VarCyMulI8();
6335  test_VarCyCmp();
6336  test_VarCyCmpR8();
6337  test_VarCyRound();
6338  test_VarCyFix();
6339  test_VarCyInt();
6340 
6356 
6357  test_VarDecAbs();
6358  test_VarDecNeg();
6359  test_VarDecAdd();
6360  test_VarDecSub();
6361  test_VarDecCmp();
6362  test_VarDecCmpR8();
6363  test_VarDecMul();
6364  test_VarDecDiv();
6365  test_VarDecRound();
6366 
6381  test_VarBoolCopy();
6383 
6389  test_VarBstrCmp();
6397  test_BstrCopy();
6398  test_VarBstrCat();
6399 
6403 
6407 
6412 
6414 
6415  test_NullByRef();
6417 
6418  test_recinfo();
6419 }
static void test_VarUI4FromI2(void)
Definition: vartype.c:1650
static void test_VarUI4FromCy(void)
Definition: vartype.c:1780
static void test_VarUI4FromI1(void)
Definition: vartype.c:1641
static void test_VarR8ChangeTypeEx(void)
Definition: vartype.c:2742
static void test_VarUI4FromUI8(void)
Definition: vartype.c:1696
static void test_VarI8FromR4(void)
Definition: vartype.c:1930
static void test_VarR4FromI8(void)
Definition: vartype.c:2475
static void test_VarDecFromI2(void)
Definition: vartype.c:3710
static void test_VarDateFromDec(void)
Definition: vartype.c:2929
static void test_VarI2FromUI4(void)
Definition: vartype.c:984
static void test_VarUI2FromUI8(void)
Definition: vartype.c:1232
static void test_VarDateFromUI4(void)
Definition: vartype.c:2844
static void test_VarR8FromStr(void)
Definition: vartype.c:2712
static void test_VarCyFromDec(void)
Definition: vartype.c:3381
static void test_VarBoolFromUI8(void)
Definition: vartype.c:4381
static void test_VarR4FromUI4(void)
Definition: vartype.c:2424
static void test_VarDecFromUI1(void)
Definition: vartype.c:3743
static void test_VarI1Copy(void)
Definition: vartype.c:624
static void test_VarUI4FromI8(void)
Definition: vartype.c:1667
static void test_VarR8FromUI4(void)
Definition: vartype.c:2611
static void test_VarUI4FromDec(void)
Definition: vartype.c:1800
static void test_VarDateFromI4(void)
Definition: vartype.c:2827
static void test_VarCyFromI1(void)
Definition: vartype.c:3210
static void test_VarBoolFromR8(void)
Definition: vartype.c:4347
static void test_VarI4FromDate(void)
Definition: vartype.c:1527
static void test_VarI4FromUI2(void)
Definition: vartype.c:1446
static void test_NullChangeTypeEx(void)
Definition: vartype.c:5729
static void test_SysAllocStringByteLen(void)
Definition: vartype.c:4985
static void test_VarI1FromDec(void)
Definition: vartype.c:582
static void test_VarUI1FromUI8(void)
Definition: vartype.c:702
static void test_VarI4FromI2(void)
Definition: vartype.c:1416
static void test_VarUI4FromR8(void)
Definition: vartype.c:1736
static void test_VarUI8FromDec(void)
Definition: vartype.c:2278
static void test_VarI2FromCy(void)
Definition: vartype.c:1087
static void test_VarDateFromR8(void)
Definition: vartype.c:2866
static void test_VarDecFromUI8(void)
Definition: vartype.c:3776
static void test_VarBoolFromR4(void)
Definition: vartype.c:4327
static void test_VarDecSub(void)
Definition: vartype.c:3990
static void test_IUnknownCopy(void)
Definition: vartype.c:5361
static void test_IDispatchChangeTypeEx(void)
Definition: vartype.c:5565
static void test_VarUI8FromBool(void)
Definition: vartype.c:2239
static void test_VarI2FromUI8(void)
Definition: vartype.c:993
static void test_VarI8FromUI2(void)
Definition: vartype.c:1910
static void test_VarDecFromUI2(void)
Definition: vartype.c:3754
static void test_VarUI1FromDisp(void)
Definition: vartype.c:854
static void test_SysReAllocString(void)
Definition: vartype.c:5076
static void test_VarDateFromUI8(void)
Definition: vartype.c:2919
static void test_VarDecFromDate(void)
Definition: vartype.c:3829
static void test_VarR4FromI1(void)
Definition: vartype.c:2381
static void test_VarI2FromDate(void)
Definition: vartype.c:1064
static void test_ClearCustData(void)
Definition: vartype.c:5825
static void test_VarCyCmpR8(void)
Definition: vartype.c:3566
static void test_VarR8FromUI8(void)
Definition: vartype.c:2674
static void test_VarUI1ChangeTypeEx(void)
Definition: vartype.c:919
static void test_VarI4FromR4(void)
Definition: vartype.c:1482
static void test_VarUI8FromI2(void)
Definition: vartype.c:2148
static void test_VarI8FromUI4(void)
Definition: vartype.c:1921
static void test_VarDecNeg(void)
Definition: vartype.c:3895
static void test_VarCyNeg(void)
Definition: vartype.c:3501
static void test_VarI2FromBool(void)
Definition: vartype.c:1002
static void test_VarUI8FromDate(void)
Definition: vartype.c:2220
static void test_VarCyFromI4(void)
Definition: vartype.c:3254
static void test_VarUI8FromStr(void)
Definition: vartype.c:2298
static void test_VarCySub(void)
Definition: vartype.c:3477
static void test_VarUI1FromUI2(void)
Definition: vartype.c:684
static void test_SysReAllocStringLen(void)
Definition: vartype.c:5114
static void test_VarR4FromI4(void)
Definition: vartype.c:2413
static void test_VarUI2FromDate(void)
Definition: vartype.c:1300
static void test_VarR8FromUI1(void)
Definition: vartype.c:2576
LCID WINAPI GetUserDefaultLCID(void)
Definition: lang.c:768
static void test_VarBoolFromStr(void)
Definition: vartype.c:4418
static void test_VarDecAbs(void)
Definition: vartype.c:3881
static void test_VarI2FromStr(void)
Definition: vartype.c:1129
static void test_VarDateFromStr(void)
Definition: vartype.c:2985
static void test_VarR4Copy(void)
Definition: vartype.c:2542
static void test_VarUI2FromI4(void)
Definition: vartype.c:1193
static void test_VarI8FromI1(void)
Definition: vartype.c:1877
static void test_UintChangeTypeEx(void)
Definition: vartype.c:5805
static void test_VarUI4FromBool(void)
Definition: vartype.c:1706
static void test_VarUI4FromI4(void)
Definition: vartype.c:1686
static void test_VarDecFromI8(void)
Definition: vartype.c:3732
static void test_VarUI8FromI8(void)
Definition: vartype.c:2250
static void test_VarCyAbs(void)
Definition: vartype.c:3491
static void test_VarI4FromBool(void)
Definition: vartype.c:1474
static void test_VarR4FromDec(void)
Definition: vartype.c:2492
static void test_IDispatchClear(void)
Definition: vartype.c:5490
static void test_VarR8FromDate(void)
Definition: vartype.c:2703
static void test_VarDateCopy(void)
Definition: vartype.c:3138
static void test_VarUI2FromUI4(void)
Definition: vartype.c:1223
static void test_VarDecFromR4(void)
Definition: vartype.c:3803
static void test_VarDecCmp(void)
Definition: vartype.c:4099
static void test_VarR8FromI2(void)
Definition: vartype.c:2584
static void test_VarI1FromBool(void)
Definition: vartype.c:475
static void test_VarDateChangeTypeEx(void)
Definition: vartype.c:3151
static void test_VarR8FromBool(void)
Definition: vartype.c:2632
static void test_VarUI4FromStr(void)
Definition: vartype.c:1816
static void test_VarI1FromUI8(void)
Definition: vartype.c:466
static void test_VarDateFromI8(void)
Definition: vartype.c:2906
static void test_VarCyRound(void)
Definition: vartype.c:3590
static void test_VarR4FromUI8(void)
Definition: vartype.c:2484
static void test_VarDecFromI1(void)
Definition: vartype.c:3699
static void test_VarUI1FromDate(void)
Definition: vartype.c:772
static void test_VarI2Copy(void)
Definition: vartype.c:1154
static void test_VarI4FromCy(void)
Definition: vartype.c:1549
static HMODULE hOleaut32
Definition: vartype.c:53
static void test_VarDecRound(void)
Definition: vartype.c:4234
static void test_VarCyFromUI4(void)
Definition: vartype.c:3265
static void test_VarUI1FromI1(void)
Definition: vartype.c:645
static void test_ChangeType_keep_dst(void)
Definition: vartype.c:5869
static void test_VarI2FromDec(void)
Definition: vartype.c:1110
static void test_IDispatchCopy(void)
Definition: vartype.c:5518
static void test_VarUI4FromR4(void)
Definition: vartype.c:1714
static void test_VarCyMul(void)
Definition: vartype.c:3465
static void test_VarI4FromI1(void)
Definition: vartype.c:1408
static void test_VarDateFromUI1(void)
Definition: vartype.c:2803
static void test_VarI2FromUI1(void)
Definition: vartype.c:967
static void test_VarCyAdd(void)
Definition: vartype.c:3451
static void test_VarCyMulI4(void)
Definition: vartype.c:3514
static void test_VarUI8Copy(void)
Definition: vartype.c:2323
static void test_VarBoolFromI4(void)
Definition: vartype.c:4307
static void test_VarR4ChangeTypeEx(void)
Definition: vartype.c:2547
smooth NULL
Definition: ftsmooth.c:416
static void test_VarBstrFromDec(void)
Definition: vartype.c:4752
static void test_VarDecFromCy(void)
Definition: vartype.c:3860
static void test_VarR4FromR8(void)
Definition: vartype.c:2435
LCID WINAPI GetSystemDefaultLCID(void)
Definition: lang.c:787
static void test_VarBoolFromCy(void)
Definition: vartype.c:4359
static void test_NullByRef(void)
Definition: vartype.c:5838
static void test_VarI2FromR8(void)
Definition: vartype.c:1037
static void test_VarI1FromUI1(void)
Definition: vartype.c:439
static void test_ErrorChangeTypeEx(void)
Definition: vartype.c:5616
static void test_VarUI1Copy(void)
Definition: vartype.c:914
static void test_VarR8FromI8(void)
Definition: vartype.c:2662
static void test_VarCyFromUI2(void)
Definition: vartype.c:3243
static BOOL has_i8
Definition: vartype.c:56
static void test_IUnknownClear(void)
Definition: vartype.c:5333
static void test_VarR4FromUI2(void)
Definition: vartype.c:2405
static void test_VarUI1FromBool(void)
Definition: vartype.c:711
static void test_SysStringLen(void)
Definition: vartype.c:4905
static void test_VarDecFromI4(void)
Definition: vartype.c:3721
static void test_VarI8Copy(void)
Definition: vartype.c:2069
static void test_VarUI8FromR4(void)
Definition: vartype.c:2182
static void test_VarUI4FromUI1(void)
Definition: vartype.c:1678
static void test_VarI1ChangeTypeEx(void)
Definition: vartype.c:629
static void test_bstr_cache(void)
Definition: vartype.c:5900
static void test_VarR8Copy(void)
Definition: vartype.c:2737
static void test_VarR4FromI2(void)
Definition: vartype.c:2397
static void test_VarBstrCmp(void)
Definition: vartype.c:4814
static BOOL has_locales
Definition: vartype.c:58
static void test_VarDateFromCy(void)
Definition: vartype.c:2884
static void test_VarI8FromStr(void)
Definition: vartype.c:2047
static void test_VarR8FromR4(void)
Definition: vartype.c:2620
static void test_VarUI1FromR4(void)
Definition: vartype.c:722
#define trace
Definition: atltest.h:70
static void test_VarI8FromI2(void)
Definition: vartype.c:1899
static void test_VarUI8FromUI1(void)
Definition: vartype.c:2137
static void test_VarR4FromBool(void)
Definition: vartype.c:2447
static void test_VarBoolFromUI2(void)
Definition: vartype.c:4299
static void test_VarR4FromStr(void)
Definition: vartype.c:2520
static void test_VarR8FromDec(void)
Definition: vartype.c:2685
static void test_VarCyFromUI8(void)
Definition: vartype.c:3369
static void test_VarUI2FromDec(void)
Definition: vartype.c:1342
static void test_VarCyFromR4(void)
Definition: vartype.c:3274
static void test_VarI4FromR8(void)
Definition: vartype.c:1501
static void test_VarUI8FromR8(void)
Definition: vartype.c:2201
static void test_VarR4FromDate(void)
Definition: vartype.c:2511
static void test_VarUI8FromI1(void)
Definition: vartype.c:2122
static void test_VarUI2Copy(void)
Definition: vartype.c:1383
static void test_VarUI2FromR8(void)
Definition: vartype.c:1275
static void test_VarI2FromI1(void)
Definition: vartype.c:939
static void test_VarI4FromUI8(void)
Definition: vartype.c:1464
static void test_VarBoolFromDate(void)
Definition: vartype.c:4409
static void test_VarCyFromR8(void)
Definition: vartype.c:3305
static void test_VarI4FromUI1(void)
Definition: vartype.c:1438
static void test_VarR4FromCy(void)
Definition: vartype.c:2455
static void test_VarUI1FromDec(void)
Definition: vartype.c:814
static void test_VarUI4ChangeTypeEx(void)
Definition: vartype.c:1845
static void test_VarI1FromUI2(void)
Definition: vartype.c:448
static void test_VarUI2FromI8(void)
Definition: vartype.c:1204
static void test_VarUI4Copy(void)
Definition: vartype.c:1840
static void test_VarBstrFromI4(void)
Definition: vartype.c:4543
static void test_VarBoolFromI8(void)
Definition: vartype.c:4372
static void test_SysAllocStringLen(void)
Definition: vartype.c:4950
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
static void test_VarBstrFromDate(void)
Definition: vartype.c:4657
static void test_VarI4FromI8(void)
Definition: vartype.c:1424
static void test_VarUI8FromUI4(void)
Definition: vartype.c:2174
static void test_VarI2FromUI2(void)
Definition: vartype.c:975
static void test_VarI8FromR8(void)
Definition: vartype.c:1950
static void test_VarUI2FromStr(void)
Definition: vartype.c:1359
static void test_VarI8FromDec(void)
Definition: vartype.c:2031
static void test_VarUI1FromI2(void)
Definition: vartype.c:654
static void test_VarI1FromCy(void)
Definition: vartype.c:560
static void test_VarR8Round(void)
Definition: vartype.c:2758
static void test_VarI8FromBool(void)
Definition: vartype.c:1990
static void test_VarDecDiv(void)
Definition: vartype.c:4050
static void test_VarUI8FromCy(void)
Definition: vartype.c:2259
static void test_VarUI2FromUI1(void)
Definition: vartype.c:1215
static void test_VarI1FromDate(void)
Definition: vartype.c:538
static void test_VarI4Copy(void)
Definition: vartype.c:1618
static void test_recinfo(void)
Definition: vartype.c:5978
static void test_VarUI2FromBool(void)
Definition: vartype.c:1241
static void test_SysAllocString(void)
Definition: vartype.c:4927
static void test_VarDecAdd(void)
Definition: vartype.c:3910
static void test_VarCyFromBool(void)
Definition: vartype.c:3345
static void test_VarUI1FromR8(void)
Definition: vartype.c:747
static void test_VarI1FromStr(void)
Definition: vartype.c:600
static void test_VarUI2ChangeTypeEx(void)
Definition: vartype.c:1388
static void test_VarUI4FromUI2(void)
Definition: vartype.c:1659
static void test_VarUI1FromI8(void)
Definition: vartype.c:674
static void test_VarI8FromDate(void)
Definition: vartype.c:1970
static void test_VarDecCmpR8(void)
Definition: vartype.c:4204
static void test_VarDecFromBool(void)
Definition: vartype.c:3787
static void test_VarDateFromI1(void)
Definition: vartype.c:2795
static void test_VarUI8FromUI2(void)
Definition: vartype.c:2163
static void test_EmptyChangeTypeEx(void)
Definition: vartype.c:5657
static void test_VarUI2FromR4(void)
Definition: vartype.c:1250
static void test_VarR8FromI4(void)
Definition: vartype.c:2600
static void test_VarCyMulI8(void)
Definition: vartype.c:3529
static void test_VarBoolFromUI4(void)
Definition: vartype.c:4318
static void test_VarBoolFromUI1(void)
Definition: vartype.c:4283
static void test_VarBoolFromI1(void)
Definition: vartype.c:4275
static void test_VarI2FromI4(void)
Definition: vartype.c:947
static void test_VarR4FromUI1(void)
Definition: vartype.c:2389
static void test_VarI1FromUI4(void)
Definition: vartype.c:457
static void test_VarDateFromBool(void)
Definition: vartype.c:2876
static void test_VarI8FromCy(void)
Definition: vartype.c:2011
static void test_VarI1FromR8(void)
Definition: vartype.c:512
static void test_VarUI1FromStr(void)
Definition: vartype.c:830
static void test_SysStringByteLen(void)
Definition: vartype.c:4916
static void test_VarDateFromI2(void)
Definition: vartype.c:2811
static void test_VarR8FromI1(void)
Definition: vartype.c:2568
static void test_VarI1FromI8(void)
Definition: vartype.c:429
static void test_VarUI4FromDate(void)
Definition: vartype.c:1760
static void test_VarUI2FromI2(void)
Definition: vartype.c:1184
static void test_VarBstrFromCy(void)
Definition: vartype.c:4701
static void test_VarCyFix(void)
Definition: vartype.c:3622
static void test_BstrCopy(void)
Definition: vartype.c:5198
static void test_VarDecFromR8(void)
Definition: vartype.c:3816
static void test_VarCyCmp(void)
Definition: vartype.c:3544
static void test_VarBoolCopy(void)
Definition: vartype.c:4489
static void test_VarUI2FromCy(void)
Definition: vartype.c:1321
#define GetProcAddress(x, y)
Definition: compat.h:418
static void test_VarCyFromUI1(void)
Definition: vartype.c:3221
static void test_VarI2FromI8(void)
Definition: vartype.c:957
static void test_VarDateFromR4(void)
Definition: vartype.c:2856
static void test_VarI4FromUI4(void)
Definition: vartype.c:1454
static void test_VarUI1FromUI4(void)
Definition: vartype.c:693
static void test_VarI1FromI2(void)
Definition: vartype.c:409
static void test_VarDecMul(void)
Definition: vartype.c:4000
static void test_VarBstrFromR4(void)
Definition: vartype.c:4577
static void test_VarI8FromUI8(void)
Definition: vartype.c:2001
static void test_VarI4ChangeTypeEx(void)
Definition: vartype.c:1623
static void test_VarBoolFromDec(void)
Definition: vartype.c:4389
static void test_VarI2FromR4(void)
Definition: vartype.c:1010
static void test_VarBstrCat(void)
Definition: vartype.c:5224
static void test_VarBoolChangeTypeEx(void)
Definition: vartype.c:4501
static void test_IUnknownChangeTypeEx(void)
Definition: vartype.c:5410
static void test_VarDecFromStr(void)
Definition: vartype.c:3842
static void test_VarI8ChangeTypeEx(void)
Definition: vartype.c:2100
static void test_VarDateFromUI2(void)
Definition: vartype.c:2819
static void test_VarUI2FromI1(void)
Definition: vartype.c:1175
static void test_VarI4FromDec(void)
Definition: vartype.c:1572
static void test_VarCyInt(void)
Definition: vartype.c:3647
static void test_VarCyFromI2(void)
Definition: vartype.c:3232
static void test_VarR8FromUI2(void)
Definition: vartype.c:2592
static void test_VarI4FromStr(void)
Definition: vartype.c:1593
static void test_VarI1FromR4(void)
Definition: vartype.c:486
static void test_VarI1FromI4(void)
Definition: vartype.c:419
static void test_VarDecFromUI4(void)
Definition: vartype.c:3765
static void test_VarUI1FromI4(void)
Definition: vartype.c:664
static void test_VarUI1FromCy(void)
Definition: vartype.c:793
static void test_VarI8FromUI1(void)
Definition: vartype.c:1888
static void test_VarBoolFromI2(void)
Definition: vartype.c:4291
static void test_VarI2ChangeTypeEx(void)
Definition: vartype.c:1159
static void test_VarR8FromCy(void)
Definition: vartype.c:2640
static void test_VarUI8ChangeTypeEx(void)
Definition: vartype.c:2354
static void test_VarCyFromI8(void)
Definition: vartype.c:3356
static void test_VarCyFromDate(void)
Definition: vartype.c:3407

◆ test_bstr_cache()

static void test_bstr_cache ( void  )
static

Definition at line 5900 of file vartype.c.

5901 {
5902  BSTR str, str2, strs[20];
5903  unsigned i;
5904 
5905  static const WCHAR testW[] = {'t','e','s','t',0};
5906 
5907  if (GetEnvironmentVariableA("OANOCACHE", NULL, 0)) {
5908  skip("BSTR cache is disabled, some tests will be skipped.\n");
5909  return;
5910  }
5911 
5913  /* This should put the string into cache */
5914  SysFreeString(str);
5915  /* The string is in cache, this won't touch it */
5916  SysFreeString(str);
5917 
5918  ok(SysStringLen(str) == 4, "unexpected len\n");
5919  ok(!lstrcmpW(str, testW), "string changed\n");
5920 
5921  str2 = SysAllocString(testW);
5922  ok(str == str2, "str != str2\n");
5923  SysFreeString(str2);
5924 
5925  /* Fill the bucket with cached entries.
5926  We roll our own, to show that the cache doesn't use
5927  the bstr length field to determine bucket allocation. */
5928  for(i=0; i < ARRAY_SIZE(strs); i++)
5929  {
5930  DWORD_PTR *ptr = CoTaskMemAlloc(64);
5931  ptr[0] = 0;
5932  strs[i] = (BSTR)(ptr + 1);
5933  }
5934  for(i=0; i < ARRAY_SIZE(strs); i++)
5935  SysFreeString(strs[i]);
5936 
5937  /* Following allocation will be made from cache */
5938  str = SysAllocStringLen(NULL, 24);
5939  ok(str == strs[0], "str != strs[0]\n");
5940 
5941  /* Smaller buffers may also use larget cached buffers */
5942  str2 = SysAllocStringLen(NULL, 16);
5943  ok(str2 == strs[1], "str2 != strs[1]\n");
5944 
5945  SysFreeString(str);
5946  SysFreeString(str2);
5947  SysFreeString(str);
5948  SysFreeString(str2);
5949 }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
OLECHAR * BSTR
Definition: compat.h:1942
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 PVOID ptr
Definition: dispmode.c:27
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define GetEnvironmentVariableA(x, y, z)
Definition: compat.h:419
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:199
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
#define skip(...)
Definition: atltest.h:64
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
static const WCHAR testW[]
Definition: jsregexp.c:44

Referenced by START_TEST().

◆ test_BstrCopy()

static void test_BstrCopy ( void  )
static

Definition at line 5198 of file vartype.c.

5199 {
5200  const CHAR szTestA[6] = { 'T','e','s','t','\0','?' };
5201  const CHAR szTestTruncA[4] = { 'T','e','s','\0' };
5202  LPINTERNAL_BSTR bstr;
5203  BSTR str;
5204  HRESULT hres;
5205  VARIANT vt1, vt2;
5206 
5207  str = SysAllocStringByteLen(szTestA, 3);
5208  ok (str != NULL, "Expected non-NULL\n");
5209  if (str)
5210  {
5211  V_VT(&vt1) = VT_BSTR;
5212  V_BSTR(&vt1) = str;
5213  V_VT(&vt2) = VT_EMPTY;
5214  hres = VariantCopy(&vt2, &vt1);
5215  ok (hres == S_OK,"Failed to copy binary bstring with hres 0x%08x\n", hres);
5216  bstr = Get(V_BSTR(&vt2));
5217  ok (bstr->dwLen == 3, "Expected 3, got %d\n", bstr->dwLen);
5218  ok (!lstrcmpA((LPCSTR)bstr->szString, szTestTruncA), "String different\n");
5219  VariantClear(&vt2);
5220  VariantClear(&vt1);
5221  }
5222 }
char CHAR
Definition: xmlstorage.h:175
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
OLECHAR * BSTR
Definition: compat.h:1942
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
OLECHAR szString[1]
Definition: vartype.c:280
BSTR WINAPI DECLSPEC_HOTPATCH SysAllocStringByteLen(LPCSTR str, UINT len)
Definition: oleaut.c:431
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
HRESULT WINAPI VariantCopy(VARIANTARG *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:751
static LPINTERNAL_BSTR Get(const BSTR lpszString)
Definition: vartype.c:4895

Referenced by START_TEST().

◆ test_ChangeType_keep_dst()

static void test_ChangeType_keep_dst ( void  )
static

Definition at line 5869 of file vartype.c.

5870 {
5871  VARIANT v1, v2;
5872  BSTR bstr;
5873  static const WCHAR testW[] = {'t','e','s','t',0};
5874  HRESULT hres;
5875 
5876  bstr = SysAllocString(testW);
5877  VariantInit(&v1);
5878  VariantInit(&v2);
5879  V_VT(&v1) = VT_BSTR;
5880  V_BSTR(&v1) = bstr;
5881  hres = VariantChangeTypeEx(&v1, &v1, 0, 0, VT_INT);
5882  ok(hres == DISP_E_TYPEMISMATCH, "VariantChangeTypeEx returns %08x\n", hres);
5883  ok(V_VT(&v1) == VT_BSTR && V_BSTR(&v1) == bstr, "VariantChangeTypeEx changed dst variant\n");
5884  V_VT(&v2) = VT_INT;
5885  V_INT(&v2) = 4;
5886  hres = VariantChangeTypeEx(&v2, &v1, 0, 0, VT_INT);
5887  ok(hres == DISP_E_TYPEMISMATCH, "VariantChangeTypeEx returns %08x\n", hres);
5888  ok(V_VT(&v2) == VT_INT && V_INT(&v2) == 4, "VariantChangeTypeEx changed dst variant\n");
5889  V_VT(&v2) = 0xff; /* incorrect variant type */
5890  hres = VariantChangeTypeEx(&v2, &v1, 0, 0, VT_INT);
5891  ok(hres == DISP_E_TYPEMISMATCH, "VariantChangeTypeEx returns %08x\n", hres);
5892  ok(V_VT(&v2) == 0xff, "VariantChangeTypeEx changed dst variant\n");
5893  hres = VariantChangeTypeEx(&v2, &v1, 0, 0, VT_BSTR);
5894  ok(hres == DISP_E_BADVARTYPE, "VariantChangeTypeEx returns %08x\n", hres);
5895  ok(V_VT(&v2) == 0xff, "VariantChangeTypeEx changed dst variant\n");
5896  SysFreeString(bstr);
5897 }
OLECHAR * BSTR
Definition: compat.h:1942
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define DISP_E_TYPEMISMATCH
Definition: winerror.h:2514
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define DISP_E_BADVARTYPE
Definition: winerror.h:2517
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
#define ok(value,...)
Definition: atltest.h:57
#define V_INT(x)
Definition: webchild.h:78
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
GLfloat GLfloat v1
Definition: glext.h:6062
static const WCHAR testW[]
Definition: jsregexp.c:44
HRESULT WINAPI VariantChangeTypeEx(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, LCID lcid, USHORT wFlags, VARTYPE vt)
Definition: variant.c:991

Referenced by START_TEST().

◆ test_ClearCustData()

static void test_ClearCustData ( void  )
static

Definition at line 5825 of file vartype.c.

5826 {
5827  CUSTDATA ci;
5828  unsigned i;
5829 
5830  ci.cCustData = NUM_CUST_ITEMS;
5831  ci.prgCustData = CoTaskMemAlloc( sizeof(CUSTDATAITEM) * NUM_CUST_ITEMS );
5832  for (i = 0; i < NUM_CUST_ITEMS; i++)
5833  VariantInit(&ci.prgCustData[i].varValue);
5834  ClearCustData(&ci);
5835  ok(!ci.cCustData && !ci.prgCustData, "ClearCustData didn't clear fields!\n");
5836 }
void WINAPI ClearCustData(CUSTDATA *lpCust)
Definition: typelib.c:11502
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
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
#define NUM_CUST_ITEMS
Definition: vartype.c:5823
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404

Referenced by START_TEST().

◆ test_EmptyChangeTypeEx()

static void test_EmptyChangeTypeEx ( void  )
static

Definition at line 5657 of file vartype.c.

5658 {
5659  VARTYPE vt;
5660  LCID lcid;
5661 
5663 
5664  for (vt = VT_EMPTY; vt <= VT_BSTR_BLOB; vt++)
5665  {
5666  HRESULT hExpected, hres;
5667  VARIANTARG vSrc, vDst;
5668 
5669  /* skip for undefined types */
5670  if ((vt == 15) || (vt > VT_VERSIONED_STREAM && vt < VT_BSTR_BLOB))
5671  continue;
5672 
5673  switch (vt)
5674  {
5675  case VT_I8:
5676  case VT_UI8:
5677  if (has_i8)
5678  hExpected = S_OK;
5679  else
5680  hExpected = DISP_E_BADVARTYPE;
5681  break;
5682  case VT_RECORD:
5683  case VT_VARIANT:
5684  case VT_DISPATCH:
5685  case VT_UNKNOWN:
5686  case VT_ERROR:
5687  hExpected = DISP_E_TYPEMISMATCH;
5688  break;
5689  case VT_EMPTY:
5690  case VT_NULL:
5691  case VT_I2:
5692  case VT_I4:
5693  case VT_R4:
5694  case VT_R8:
5695  case VT_CY:
5696  case VT_DATE:
5697  case VT_BSTR:
5698  case VT_BOOL:
5699  case VT_DECIMAL:
5700  case VT_I1:
5701  case VT_UI1:
5702  case VT_UI2:
5703  case VT_UI4:
5704  case VT_INT:
5705  case VT_UINT:
5706  hExpected = S_OK;
5707  break;
5708  default:
5709  hExpected = DISP_E_BADVARTYPE;
5710  }
5711 
5712  VariantInit(&vSrc);
5713  V_VT(&vSrc) = VT_EMPTY;
5714  memset(&vDst, 0, sizeof(vDst));
5715  V_VT(&vDst) = VT_NULL;
5716 
5717  hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, 0, vt);
5718  ok(hres == hExpected, "change empty: vt %d expected 0x%08x, got 0x%08x, vt %d\n",
5719  vt, hExpected, hres, V_VT(&vDst));
5720  if (hres == S_OK)
5721  {
5722  ok(V_VT(&vDst) == vt, "change empty: vt %d, got %d\n", vt, V_VT(&vDst));
5723  VariantClear(&vDst);
5724  }
5725  }
5726 }
#define MAKELCID(lgid, srtid)
Definition: compat.h:1947
Definition: compat.h:1963
Definition: compat.h:1959
DWORD LCID
Definition: nls.h:13
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define SUBLANG_ENGLISH_US
Definition: nls.h:222
static BOOL has_i8
Definition: vartype.c:56
#define DISP_E_TYPEMISMATCH
Definition: winerror.h:2514
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define SORT_DEFAULT
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
#define LANG_ENGLISH
Definition: nls.h:52
#define DISP_E_BADVARTYPE
Definition: winerror.h:2517
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
Definition: compat.h:1948
#define V_VT(A)
Definition: oleauto.h:211
Definition: compat.h:1950
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
unsigned short VARTYPE
Definition: compat.h:1903
#define MAKELANGID(p, s)
Definition: nls.h:15
#define memset(x, y, z)
Definition: compat.h:39
Definition: compat.h:1949
Definition: compat.h:1946
HRESULT WINAPI VariantChangeTypeEx(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, LCID lcid, USHORT wFlags, VARTYPE vt)
Definition: variant.c:991

Referenced by START_TEST().

◆ test_ErrorChangeTypeEx()

static void test_ErrorChangeTypeEx ( void  )
static

Definition at line 5616 of file vartype.c.

5617 {
5618  HRESULT hres;
5619  VARIANTARG vSrc, vDst;
5620  VARTYPE vt;
5621  LCID lcid;
5622 
5624 
5625  for (vt = 0; vt <= VT_BSTR_BLOB; vt++)
5626  {
5627  HRESULT hExpected = DISP_E_BADVARTYPE;
5628 
5629  V_VT(&vSrc) = VT_ERROR;
5630  V_ERROR(&vSrc) = 1;
5631  VariantInit(&vDst);
5632  hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, 0, vt);
5633 
5634  if (vt == VT_ERROR)
5635  hExpected = S_OK;
5636  else
5637  {
5638  if (vt == VT_I8 || vt == VT_UI8)
5639  {
5640  if (has_i8)
5641  hExpected = DISP_E_TYPEMISMATCH;
5642  }
5643  else if (vt == VT_RECORD)
5644  {
5645  hExpected = DISP_E_TYPEMISMATCH;
5646  }
5647  else if (vt <= VT_UINT && vt != (VARTYPE)15)
5648  hExpected = DISP_E_TYPEMISMATCH;
5649  }
5650 
5651  ok(hres == hExpected,
5652  "change err: vt %d expected 0x%08x, got 0x%08x\n", vt, hExpected, hres);
5653  }
5654 }
#define MAKELCID(lgid, srtid)
Definition: compat.h:1963
DWORD LCID
Definition: nls.h:13
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define SUBLANG_ENGLISH_US
Definition: nls.h:222
static BOOL has_i8
Definition: vartype.c:56
#define DISP_E_TYPEMISMATCH
Definition: winerror.h:2514
HRESULT hres
Definition: protocol.c:465
#define SORT_DEFAULT
LONG HRESULT
Definition: typedefs.h:77
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
#define LANG_ENGLISH
Definition: nls.h:52
#define DISP_E_BADVARTYPE
Definition: winerror.h:2517
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
unsigned short VARTYPE
Definition: compat.h:1903
#define V_ERROR(A)
Definition: oleauto.h:241
#define MAKELANGID(p, s)
Definition: nls.h:15
HRESULT WINAPI VariantChangeTypeEx(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, LCID lcid, USHORT wFlags, VARTYPE vt)
Definition: variant.c:991

Referenced by START_TEST().

◆ test_IDispatchChangeTypeEx()

static void test_IDispatchChangeTypeEx ( void  )
static

Definition at line 5565 of file vartype.c.

5566 {
5567  HRESULT hres;
5568  VARIANTARG vSrc, vDst;
5569  LCID lcid;
5570  DummyDispatch d;
5571  IDispatch* pd;
5572 
5573  init_test_dispatch(1, VT_UI1, &d);
5574  pd = &d.IDispatch_iface;
5575 
5577 
5578  /* NULL IDispatch -> IUnknown */
5579  V_VT(&vSrc) = VT_DISPATCH;
5580  V_DISPATCH(&vSrc) = NULL;
5581  VariantInit(&vDst);
5582  V_UNKNOWN(&vDst) = (void*)0xdeadbeef;
5583  hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, 0, VT_UNKNOWN);
5584  ok(