ReactOS  0.4.14-dev-342-gdc047f9
vartest.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <math.h>
#include <float.h>
#include "windef.h"
#include "winbase.h"
#include "winsock2.h"
#include "wine/test.h"
#include "winuser.h"
#include "wingdi.h"
#include "winnls.h"
#include "winerror.h"
#include "winnt.h"
#include "wtypes.h"
#include "oleauto.h"
Include dependency graph for vartest.c:

Go to the source code of this file.

Classes

struct  DummyDispatch
 
struct  IRecordInfoImpl
 
struct  test_VariantClearImpl
 
struct  decimal_t
 
struct  decimal_round_t
 

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define CHECKPTR(func)
 
#define EQ_DOUBLE(a, b)   (fabs((a)-(b)) / (1.0+fabs(a)+fabs(b)) < 1e-14)
 
#define EQ_FLOAT(a, b)   (fabs((a)-(b)) / (1.0+fabs(a)+fabs(b)) < 1e-7)
 
#define SKIPTESTS(a)   if((a > VT_CLSID+10) && (a < VT_BSTR_BLOB-10)) continue
 
#define V_EMPTY(v)   V_I4(v)
 
#define V_NULL(v)   V_I4(v)
 
#define I1_MAX   0x7f
 
#define I1_MIN   ((-I1_MAX)-1)
 
#define UI1_MAX   0xff
 
#define UI1_MIN   0
 
#define I2_MAX   0x7fff
 
#define I2_MIN   ((-I2_MAX)-1)
 
#define UI2_MAX   0xffff
 
#define UI2_MIN   0
 
#define I4_MAX   0x7fffffff
 
#define I4_MIN   ((-I4_MAX)-1)
 
#define UI4_MAX   0xffffffff
 
#define UI4_MIN   0
 
#define I8_MAX   (((LONGLONG)I4_MAX << 32) | UI4_MAX)
 
#define I8_MIN   ((-I8_MAX)-1)
 
#define UI8_MAX   (((ULONGLONG)UI4_MAX << 32) | UI4_MAX)
 
#define UI8_MIN   0
 
#define DATE_MAX   2958465
 
#define DATE_MIN   -657434
 
#define R4_MAX   FLT_MAX
 
#define R4_MIN   FLT_MIN
 
#define R8_MAX   DBL_MAX
 
#define R8_MIN   DBL_MIN
 
#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 CASE(vt)   case VT_##vt: return #vt
 
#define CASE(vt)   case VT_##vt: return (V_##vt(result) == V_##vt(expected))
 
#define test_bstr_var(a, b)   _test_bstr_var(__LINE__,a,b)
 
#define FAILDIG   255
 
#define CONVERTN(str, dig, flags)   hres = convert_str( str, dig, flags, &np, rgb, lcid )
 
#define CONVERT(str, flags)   CONVERTN(str,sizeof(rgb),flags)
 
#define EXPECT(a, b, c, d, e, f)   expect_NumFromStr( __LINE__, hres, &np, a, b, c, d, e, f )
 
#define EXPECTRGB(a, b)   ok(rgb[a] == b, "Digit[%d], expected %d, got %d\n", a, b, rgb[a])
 
#define EXPECTFAIL   ok(hres == (HRESULT)DISP_E_TYPEMISMATCH, "Call succeeded, hres = %08x\n", hres)
 
#define EXPECT2(a, b)   EXPECTRGB(0,a); EXPECTRGB(1,b)
 
#define SETRGB(indx, val)   if (!indx) memset(rgb, FAILDIG, sizeof(rgb)); rgb[indx] = val
 
#define CONVERT(a, b, c, d, e, f, bits)
 
#define EXPECT_OVERFLOW   ok(hres == (HRESULT)DISP_E_OVERFLOW, szFailOverflow, hres)
 
#define EXPECT_OK
 
#define EXPECT_TYPE(typ)   ok(V_VT(&vOut) == typ,"Expected Type = " #typ ", got %d\n", V_VT(&vOut))
 
#define EXPECT_I1(val)
 
#define EXPECT_UI1(val)
 
#define EXPECT_I2(val)
 
#define EXPECT_UI2(val)
 
#define EXPECT_I4(val)
 
#define EXPECT_UI4(val)
 
#define EXPECT_I8(high, low)
 
#define EXPECT_UI8(val)
 
#define EXPECT_R4(val)
 
#define EXPECT_R8(val)
 
#define CY_MULTIPLIER   10000
 
#define EXPECT_CY(val)
 
#define EXPECT_DECIMAL(valHi, valMid, valLo)
 
#define INTEGER_VTBITS   (VTBIT_I1|VTBIT_UI1|VTBIT_I2|VTBIT_UI2|VTBIT_I4|VTBIT_UI4|VTBIT_I8|VTBIT_UI8)
 
#define DT2UD(dt, flags, r, d, m, y, h, mn, s, ms, dw, dy)   test_UdateFromDate(__LINE__,dt,flags,r,d,m,y,h,mn,s,ms,dw,dy)
 
#define UD2T(d, m, y, h, mn, s, ms, dw, dy, flags, r, dt)   test_DateFromUDate(__LINE__,d,m,y,h,mn,s,ms,dw,dy,flags,r,dt)
 
#define ST2DT(d, m, y, h, mn, s, ms, r, dt)   test_st2dt(__LINE__,d,m,y,h,mn,s,ms,r,dt)
 
#define DT2ST(dt, r, d, m, y, h, mn, s, ms)   test_dt2st(__LINE__,dt,r,d,m,y,h,mn,s,ms)
 
#define MKDOSDATE(d, m, y)   ((d & 0x1f) | ((m & 0xf) << 5) | (((y-1980) & 0x7f) << 9))
 
#define MKDOSTIME(h, m, s)   (((s>>1) & 0x1f) | ((m & 0x3f) << 5) | ((h & 0x1f) << 11))
 
#define DOS2DT(d, m, y, h, mn, s, r, dt)   test_dos2dt(__LINE__,d,m,y,h,mn,s,r,dt)
 
#define DT2DOS(dt, r, d, m, y, h, mn, s)   test_dt2dos(__LINE__,dt,r,d,m,y,h,mn,s)
 
#define VARABS(vt, val, rvt, rval)
 
#define VARNOT(vt, val, rvt, rval)
 
#define VARSUB(vt1, val1, vt2, val2, rvt, rval)
 
#define VARMOD(vt1, vt2, val1, val2, rvt, rval)
 
#define VARMOD2(vt1, vt2, val1, val2, rvt, rval, hexpected)
 
#define VARFIX(vt, val, rvt, rval)
 
#define VARINT(vt, val, rvt, rval)
 
#define VARNEG(vt, val, rvt, rval)
 
#define VARROUND(vt, val, deci, rvt, rval)
 
#define VARXOR(vt1, val1, vt2, val2, rvt, rval)
 
#define VARXORCY(vt1, val1, val2, rvt, rval)
 
#define VAROR(vt1, val1, vt2, val2, rvt, rval)
 
#define VARORCY(vt1, val1, val2, rvt, rval)
 
#define VAREQV(vt1, val1, vt2, val2, rvt, rval)
 
#define VARMUL(vt1, val1, vt2, val2, rvt, rval)
 
#define VARADD(vt1, val1, vt2, val2, rvt, rval)
 
#define VARAND(vt1, val1, vt2, val2, rvt, rval)
 
#define VARANDCY(vt1, val1, val2, rvt, rval)
 
#define SKIPTESTAND(a)
 
#define _VARCMP(vt1, val1, vtfl1, vt2, val2, vtfl2, lcid, flags, result)
 
#define VARCMPEX(vt1, val1, vt2, val2, res1, res2, res3, res4)
 
#define VARCMP(vt1, val1, vt2, val2, result)   VARCMPEX(vt1,val1,vt2,val2,result,result,result,result)
 
#define V_NULL_   V_NULL
 
#define VT_NULL_   VT_NULL
 
#define VARPOW(vt1, val1, vt2, val2, rvt, rval)
 
#define SKIPTESTPOW(a)
 
#define VARDIV(vt1, val1, vt2, val2, rvt, rval)
 
#define SKIPTESTDIV(a)
 
#define VARIDIV(vt1, val1, vt2, val2, rvt, rval)
 
#define SKIPTESTIDIV(a)
 
#define VARIMP(vt1, val1, vt2, val2, rvt, rval)
 
#define SKIPTESTIMP(a)
 

Typedefs

typedef struct IRecordInfoImpl IRecordInfoImpl
 

Functions

static HRESULT (WINAPI *pVarUdateFromDate)(DATE
 
static UDATE *static DATE *static INT (WINAPI *pSystemTimeToVariantTime)(LPSYSTEMTIME
 
 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 (VARTYPE vt, DummyDispatch *dispatch)
 
static IRecordInfoImplimpl_from_IRecordInfo (IRecordInfo *iface)
 
static HRESULT WINAPI RecordInfo_QueryInterface (IRecordInfo *iface, REFIID riid, void **obj)
 
static ULONG WINAPI RecordInfo_AddRef (IRecordInfo *iface)
 
static ULONG WINAPI RecordInfo_Release (IRecordInfo *iface)
 
static HRESULT WINAPI RecordInfo_RecordInit (IRecordInfo *iface, PVOID pvNew)
 
static HRESULT WINAPI RecordInfo_RecordClear (IRecordInfo *iface, void *data)
 
static HRESULT WINAPI RecordInfo_RecordCopy (IRecordInfo *iface, void *src, void *dest)
 
static HRESULT WINAPI RecordInfo_GetGuid (IRecordInfo *iface, GUID *pguid)
 
static HRESULT WINAPI RecordInfo_GetName (IRecordInfo *iface, BSTR *pbstrName)
 
static HRESULT WINAPI RecordInfo_GetSize (IRecordInfo *iface, ULONG *size)
 
static HRESULT WINAPI RecordInfo_GetTypeInfo (IRecordInfo *iface, ITypeInfo **ppTypeInfo)
 
static HRESULT WINAPI RecordInfo_GetField (IRecordInfo *iface, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
 
static HRESULT WINAPI RecordInfo_GetFieldNoCopy (IRecordInfo *iface, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField, PVOID *ppvDataCArray)
 
static HRESULT WINAPI RecordInfo_PutField (IRecordInfo *iface, ULONG wFlags, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
 
static HRESULT WINAPI RecordInfo_PutFieldNoCopy (IRecordInfo *iface, ULONG wFlags, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
 
static HRESULT WINAPI RecordInfo_GetFieldNames (IRecordInfo *iface, ULONG *pcNames, BSTR *rgBstrNames)
 
static BOOL WINAPI RecordInfo_IsMatchingType (IRecordInfo *iface, IRecordInfo *info2)
 
static PVOID WINAPI RecordInfo_RecordCreate (IRecordInfo *iface)
 
static HRESULT WINAPI RecordInfo_RecordCreateCopy (IRecordInfo *iface, PVOID pvSource, PVOID *ppvDest)
 
static HRESULT WINAPI RecordInfo_RecordDestroy (IRecordInfo *iface, PVOID pvRecord)
 
static IRecordInfoImplget_test_recordinfo (void)
 
static void init (void)
 
static void setdec (DECIMAL *dec, BYTE scl, BYTE sgn, ULONG hi32, ULONG64 lo64)
 
static void setdec64 (DECIMAL *dec, BYTE scl, BYTE sgn, ULONG hi32, ULONG mid32, ULONG lo32)
 
static const charvtstr (int x)
 
static const charvariantstr (const VARIANT *var)
 
static BOOL is_expected_variant (const VARIANT *result, const VARIANT *expected)
 
static void test_var_call1 (int line, HRESULT(WINAPI *func)(LPVARIANT, LPVARIANT), VARIANT *arg, VARIANT *expected)
 
static void test_var_call2 (int line, HRESULT(WINAPI *func)(LPVARIANT, LPVARIANT, LPVARIANT), VARIANT *left, VARIANT *right, VARIANT *expected)
 
static int strcmp_wa (const WCHAR *strw, const char *stra)
 
static void _test_bstr_var (unsigned line, const VARIANT *v, const char *str)
 
static void test_VariantInit (void)
 
static BOOL IsValidVariantClearVT (VARTYPE vt, VARTYPE extraFlags)
 
static test_VariantClearImplimpl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI VC_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI VC_AddRef (LPUNKNOWN iface)
 
static ULONG WINAPI VC_Release (LPUNKNOWN iface)
 
static void test_VariantClear (void)
 
static void test_VariantCopy (void)
 
static BOOL IsValidVariantCopyIndVT (VARTYPE vt, VARTYPE extraFlags)
 
static void test_VariantCopyInd (void)
 
static HRESULT convert_str (const char *str, INT dig, ULONG flags, NUMPARSE *np, BYTE rgb[128], LCID lcid)
 
static void expect_NumFromStr (int line, HRESULT hres, NUMPARSE *np, INT a, ULONG b, ULONG c, INT d, INT e, INT f)
 
static void test_VarParseNumFromStr (void)
 
static void test_VarNumFromParseNum (void)
 
static void test_UdateFromDate (int line, DATE dt, ULONG flags, HRESULT r, WORD d, WORD m, WORD y, WORD h, WORD mn, WORD s, WORD ms, WORD dw, WORD dy)
 
static void test_VarUdateFromDate (void)
 
static void test_DateFromUDate (int line, WORD d, WORD m, WORD y, WORD h, WORD mn, WORD s, WORD ms, WORD dw, WORD dy, ULONG flags, HRESULT r, DATE dt)
 
static void test_VarDateFromUdate (void)
 
static void test_st2dt (int line, WORD d, WORD m, WORD y, WORD h, WORD mn, WORD s, WORD ms, INT r, double dt)
 
static void test_SystemTimeToVariantTime (void)
 
static void test_dt2st (int line, double dt, INT r, WORD d, WORD m, WORD y, WORD h, WORD mn, WORD s, WORD ms)
 
static void test_VariantTimeToSystemTime (void)
 
static void test_dos2dt (int line, WORD d, WORD m, WORD y, WORD h, WORD mn, WORD s, INT r, double dt)
 
static void test_DosDateTimeToVariantTime (void)
 
static void test_dt2dos (int line, double dt, INT r, WORD d, WORD m, WORD y, WORD h, WORD mn, WORD s)
 
static void test_VariantTimeToDosDateTime (void)
 
static void test_VarAbs (void)
 
static void test_VarNot (void)
 
static void test_VarSub (void)
 
static void test_Mod (int line, VARIANT *left, VARIANT *right, VARIANT *expected, HRESULT expres)
 
static void test_VarMod (void)
 
static void test_VarFix (void)
 
static void test_VarInt (void)
 
static void test_VarNeg (void)
 
static void test_Round (int line, VARIANT *arg, int deci, VARIANT *expected)
 
static void test_VarRound (void)
 
static void test_VarXor (void)
 
static void test_VarOr (void)
 
static void test_VarEqv (void)
 
static void test_VarMul (void)
 
static void test_VarAdd (void)
 
static void test_VarCat (void)
 
static void test_VarAnd (void)
 
static void test_cmp (int line, LCID lcid, UINT flags, VARIANT *left, VARIANT *right, HRESULT result)
 
static void test_cmpex (int line, LCID lcid, VARIANT *left, VARIANT *right, HRESULT res1, HRESULT res2, HRESULT res3, HRESULT res4)
 
static void test_VarCmp (void)
 
static void test_VarPow (void)
 
static void test_VarDiv (void)
 
static void test_VarIdiv (void)
 
static void test_VarImp (void)
 
 START_TEST (vartest)
 

Variables

static HMODULE hOleaut32
 
static ULONG
 
static UDATE *static DATE *static double *static LPSYSTEMTIME
 
static USHORT
 
static double *static USHORT USHORT *static const WCHAR sz12 [] = {'1','2','\0'}
 
static WCHAR sz12_false [32]
 
static WCHAR sz12_true [32]
 
static BOOL has_i8
 
static const IDispatchVtbl DummyDispatch_VTable
 
static const IRecordInfoVtbl RecordInfoVtbl
 
static char vtstr_buffer [16][256]
 
static int vtstr_current =0
 
static const VARTYPE ExtraFlags [16]
 
static const IUnknownVtbl test_VariantClear_vtbl
 
static test_VariantClearImpl test_myVariantClearImpl = {{&test_VariantClear_vtbl}, 1, 0}
 
static LCID
 
static const charszFailOverflow = "Expected overflow, hres = %08x\n"
 
static const charszFailOk = "Call failed, hres = %08x\n"
 
static LPVARIANT
 
static int
 
static const struct decimal_round_t decimal_round_data []
 

Macro Definition Documentation

◆ _VARCMP

#define _VARCMP (   vt1,
  val1,
  vtfl1,
  vt2,
  val2,
  vtfl2,
  lcid,
  flags,
  result 
)
Value:
V_##vt1(&left) = val1; V_VT(&left) = VT_##vt1 | vtfl1; \
V_##vt2(&right) = val2; V_VT(&right) = VT_##vt2 | vtfl2; \
test_cmp( __LINE__, lcid, flags, &left, &right, result )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLbitfield flags
Definition: glext.h:7161
#define V_VT(A)
Definition: oleauto.h:211
GLuint64EXT * result
Definition: glext.h:11304

Definition at line 6901 of file vartest.c.

◆ CASE [1/2]

#define CASE (   vt)    case VT_##vt: return #vt

◆ CASE [2/2]

#define CASE (   vt)    case VT_##vt: return (V_##vt(result) == V_##vt(expected))

◆ 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 118 of file vartest.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 112 of file vartest.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 106 of file vartest.c.

◆ CHECKPTR

#define CHECKPTR (   func)
Value:
if (!p##func) { win_skip("function " # func " not available, not testing it\n"); return; }
GLenum func
Definition: glext.h:6028
static HMODULE hOleaut32
Definition: vartest.c:43
#define GetProcAddress(x, y)
Definition: compat.h:418
GLfloat GLfloat p
Definition: glext.h:8902
#define win_skip
Definition: test.h:141

Definition at line 58 of file vartest.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 27 of file vartest.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 28 of file vartest.c.

◆ CONVERT [1/2]

#define CONVERT (   str,
  flags 
)    CONVERTN(str,sizeof(rgb),flags)

Definition at line 1744 of file vartest.c.

◆ CONVERT [2/2]

#define CONVERT (   a,
  b,
  c,
  d,
  e,
  f,
  bits 
)
Value:
np.cDig = (a); np.dwInFlags = (b); np.dwOutFlags = (c); np.cchUsed = (d); \
np.nBaseShift = (e); np.nPwr10 = (f); hres = pVarNumFromParseNum(&np, rgb, bits, &vOut)
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
#define a
Definition: ke_i.h:78
#define e
Definition: ke_i.h:82
#define b
Definition: ke_i.h:79
HRESULT hres
Definition: protocol.c:465
#define d
Definition: ke_i.h:81
_In_ ULONG _In_ ULONG rgb
Definition: winddi.h:3520
#define f
Definition: ke_i.h:83
#define c
Definition: ke_i.h:80

Definition at line 1744 of file vartest.c.

◆ CONVERTN

#define CONVERTN (   str,
  dig,
  flags 
)    hres = convert_str( str, dig, flags, &np, rgb, lcid )

Definition at line 1301 of file vartest.c.

◆ CY_MULTIPLIER

#define CY_MULTIPLIER   10000

Definition at line 1775 of file vartest.c.

◆ DATE_MAX

#define DATE_MAX   2958465

Definition at line 93 of file vartest.c.

◆ DATE_MIN

#define DATE_MIN   -657434

Definition at line 94 of file vartest.c.

◆ DEFINE_EXPECT

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

Definition at line 100 of file vartest.c.

◆ DOS2DT

#define DOS2DT (   d,
  m,
  y,
  h,
  mn,
  s,
  r,
  dt 
)    test_dos2dt(__LINE__,d,m,y,h,mn,s,r,dt)

Definition at line 2168 of file vartest.c.

◆ DT2DOS

#define DT2DOS (   dt,
  r,
  d,
  m,
  y,
  h,
  mn,
  s 
)    test_dt2dos(__LINE__,dt,r,d,m,y,h,mn,s)

Definition at line 2256 of file vartest.c.

◆ DT2ST

#define DT2ST (   dt,
  r,
  d,
  m,
  y,
  h,
  mn,
  s,
  ms 
)    test_dt2st(__LINE__,dt,r,d,m,y,h,mn,s,ms)

Definition at line 2142 of file vartest.c.

◆ DT2UD

#define DT2UD (   dt,
  flags,
  r,
  d,
  m,
  y,
  h,
  mn,
  s,
  ms,
  dw,
  dy 
)    test_UdateFromDate(__LINE__,dt,flags,r,d,m,y,h,mn,s,ms,dw,dy)

Definition at line 1974 of file vartest.c.

◆ EQ_DOUBLE

#define EQ_DOUBLE (   a,
  b 
)    (fabs((a)-(b)) / (1.0+fabs(a)+fabs(b)) < 1e-14)

Definition at line 67 of file vartest.c.

◆ EQ_FLOAT

#define EQ_FLOAT (   a,
  b 
)    (fabs((a)-(b)) / (1.0+fabs(a)+fabs(b)) < 1e-7)

Definition at line 68 of file vartest.c.

◆ EXPECT

#define EXPECT (   a,
  b,
  c,
  d,
  e,
  f 
)    expect_NumFromStr( __LINE__, hres, &np, a, b, c, d, e, f )

Definition at line 1303 of file vartest.c.

◆ EXPECT2

#define EXPECT2 (   a,
  b 
)    EXPECTRGB(0,a); EXPECTRGB(1,b)

Definition at line 1306 of file vartest.c.

◆ EXPECT_CY

#define EXPECT_CY (   val)
Value:
ok(V_CY(&vOut).int64 == (LONG64)(val * CY_MULTIPLIER), "Expected r8 = 0x%x%08x, got 0x%x%08x\n", \
(DWORD)((LONG64)val >> 23), (DWORD)(LONG64)val, (DWORD)(V_CY(&vOut).int64 >>32), (DWORD)V_CY(&vOut).int64); }
long long int64
Definition: platform.h:13
#define V_CY(A)
Definition: oleauto.h:229
GLuint GLfloat * val
Definition: glext.h:7180
int64_t LONG64
Definition: typedefs.h:66
#define EXPECT_TYPE(typ)
Definition: vartest.c:1752
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CY_MULTIPLIER
Definition: vartest.c:1775
Definition: compat.h:1950
#define EXPECT_OK
Definition: vartest.c:1750

Definition at line 1776 of file vartest.c.

◆ EXPECT_DECIMAL

#define EXPECT_DECIMAL (   valHi,
  valMid,
  valLo 
)
Value:
ok((V_DECIMAL(&vOut).Hi32 == valHi) && (S1(U1(V_DECIMAL(&vOut))).Mid32 == valMid) && \
(S1(U1(V_DECIMAL(&vOut))).Lo32 == valLo), \
"Expected decimal = %x/0x%x%08x, got %x/0x%x%08x\n", valHi, valMid, valLo, \
V_DECIMAL(&vOut).Hi32, S1(U1(V_DECIMAL(&vOut))).Mid32, S1(U1(V_DECIMAL(&vOut))).Lo32); }
#define U1(x)
Definition: test.h:172
#define S1(x)
Definition: test.h:191
#define V_DECIMAL(A)
Definition: oleauto.h:236
#define EXPECT_TYPE(typ)
Definition: vartest.c:1752
#define EXPECT_OK
Definition: vartest.c:1750

Definition at line 1779 of file vartest.c.

◆ EXPECT_I1

#define EXPECT_I1 (   val)
Value:
ok(V_I1(&vOut) == val, "Expected i1 = %d, got %d\n", (signed char)val, V_I1(&vOut)); }
Definition: compat.h:1959
#define V_I1(A)
Definition: oleauto.h:243
GLuint GLfloat * val
Definition: glext.h:7180
#define EXPECT_TYPE(typ)
Definition: vartest.c:1752
#define EXPECT_OK
Definition: vartest.c:1750

Definition at line 1753 of file vartest.c.

◆ EXPECT_I2

#define EXPECT_I2 (   val)
Value:
ok(V_I2(&vOut) == val, "Expected i2 = %d, got %d\n", (SHORT)val, V_I2(&vOut)); }
#define V_I2(A)
Definition: oleauto.h:245
short SHORT
Definition: pedump.c:59
GLuint GLfloat * val
Definition: glext.h:7180
#define EXPECT_TYPE(typ)
Definition: vartest.c:1752
#define EXPECT_OK
Definition: vartest.c:1750
Definition: compat.h:1946

Definition at line 1757 of file vartest.c.

◆ EXPECT_I4

#define EXPECT_I4 (   val)
Value:
ok(V_I4(&vOut) == val, "Expected i4 = %d, got %d\n", (LONG)val, V_I4(&vOut)); }
Definition: compat.h:1947
#define V_I4(A)
Definition: oleauto.h:247
long LONG
Definition: pedump.c:60
GLuint GLfloat * val
Definition: glext.h:7180
#define EXPECT_TYPE(typ)
Definition: vartest.c:1752
#define EXPECT_OK
Definition: vartest.c:1750

Definition at line 1761 of file vartest.c.

◆ EXPECT_I8

#define EXPECT_I8 (   high,
  low 
)
Value:
ok(V_I8(&vOut) == ((((ULONG64)(high))<<32)|(low)), "Expected i8 = %x%08x, got %x%08x\n", \
(LONG)(high), (LONG)(low), (LONG)(V_I8(&vOut)>>32), (LONG)V_I8(&vOut) ); }
Definition: compat.h:1963
long LONG
Definition: pedump.c:60
#define V_I8(A)
Definition: oleauto.h:249
#define EXPECT_TYPE(typ)
Definition: vartest.c:1752
unsigned __int64 ULONG64
Definition: imports.h:198
#define EXPECT_OK
Definition: vartest.c:1750

Definition at line 1765 of file vartest.c.

◆ EXPECT_OK

#define EXPECT_OK
Value:
if (hres == (HRESULT)S_OK)
static const char * szFailOk
Definition: vartest.c:1749
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

Definition at line 1750 of file vartest.c.

◆ EXPECT_OVERFLOW

#define EXPECT_OVERFLOW   ok(hres == (HRESULT)DISP_E_OVERFLOW, szFailOverflow, hres)

Definition at line 1748 of file vartest.c.

◆ EXPECT_R4

#define EXPECT_R4 (   val)
Value:
ok(V_R4(&vOut) == val, "Expected r4 = %f, got %f\n", val, V_R4(&vOut)); }
GLuint GLfloat * val
Definition: glext.h:7180
#define V_R4(A)
Definition: oleauto.h:260
#define EXPECT_TYPE(typ)
Definition: vartest.c:1752
Definition: compat.h:1948
#define EXPECT_OK
Definition: vartest.c:1750

Definition at line 1771 of file vartest.c.

◆ EXPECT_R8

#define EXPECT_R8 (   val)
Value:
ok(V_R8(&vOut) == val, "Expected r8 = %g, got %g\n", val, V_R8(&vOut)); }
#define V_R8(A)
Definition: oleauto.h:262
GLuint GLfloat * val
Definition: glext.h:7180
#define EXPECT_TYPE(typ)
Definition: vartest.c:1752
#define EXPECT_OK
Definition: vartest.c:1750
Definition: compat.h:1949

Definition at line 1773 of file vartest.c.

◆ EXPECT_TYPE

#define EXPECT_TYPE (   typ)    ok(V_VT(&vOut) == typ,"Expected Type = " #typ ", got %d\n", V_VT(&vOut))

Definition at line 1752 of file vartest.c.

◆ EXPECT_UI1

#define EXPECT_UI1 (   val)
Value:
ok(V_UI1(&vOut) == val, "Expected ui1 = %d, got %d\n", (BYTE)val, V_UI1(&vOut)); }
GLuint GLfloat * val
Definition: glext.h:7180
#define EXPECT_TYPE(typ)
Definition: vartest.c:1752
#define V_UI1(A)
Definition: oleauto.h:266
unsigned char BYTE
Definition: mem.h:68
#define EXPECT_OK
Definition: vartest.c:1750

Definition at line 1755 of file vartest.c.

◆ EXPECT_UI2

#define EXPECT_UI2 (   val)
Value:
ok(V_UI2(&vOut) == val, "Expected ui2 = %d, got %d\n", (USHORT)val, V_UI2(&vOut)); }
#define V_UI2(A)
Definition: oleauto.h:268
GLuint GLfloat * val
Definition: glext.h:7180
#define EXPECT_TYPE(typ)
Definition: vartest.c:1752
unsigned short USHORT
Definition: pedump.c:61
#define EXPECT_OK
Definition: vartest.c:1750

Definition at line 1759 of file vartest.c.

◆ EXPECT_UI4

#define EXPECT_UI4 (   val)
Value:
ok(V_UI4(&vOut) == val, "Expected ui4 = %d, got %d\n", (ULONG)val, V_UI4(&vOut)); }
GLuint GLfloat * val
Definition: glext.h:7180
#define EXPECT_TYPE(typ)
Definition: vartest.c:1752
#define V_UI4(A)
Definition: oleauto.h:270
unsigned int ULONG
Definition: retypes.h:1
#define EXPECT_OK
Definition: vartest.c:1750

Definition at line 1763 of file vartest.c.

◆ EXPECT_UI8

#define EXPECT_UI8 (   val)
Value:
ok(V_UI8(&vOut) == val, "Expected ui8 = 0x%x%08x, got 0x%x%08x\n", \
(DWORD)((ULONG64)val >> 32), (DWORD)(ULONG64)val, (DWORD)(V_UI8(&vOut) >> 32), (DWORD)V_UI8(&vOut)); }
#define V_UI8(A)
Definition: oleauto.h:272
GLuint GLfloat * val
Definition: glext.h:7180
#define EXPECT_TYPE(typ)
Definition: vartest.c:1752
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned __int64 ULONG64
Definition: imports.h:198
#define EXPECT_OK
Definition: vartest.c:1750

Definition at line 1768 of file vartest.c.

◆ EXPECTFAIL

#define EXPECTFAIL   ok(hres == (HRESULT)DISP_E_TYPEMISMATCH, "Call succeeded, hres = %08x\n", hres)

Definition at line 1305 of file vartest.c.

◆ EXPECTRGB

#define EXPECTRGB (   a,
  b 
)    ok(rgb[a] == b, "Digit[%d], expected %d, got %d\n", a, b, rgb[a])

Definition at line 1304 of file vartest.c.

◆ FAILDIG

#define FAILDIG   255

Definition at line 1273 of file vartest.c.

◆ I1_MAX

#define I1_MAX   0x7f

Definition at line 77 of file vartest.c.

◆ I1_MIN

#define I1_MIN   ((-I1_MAX)-1)

Definition at line 78 of file vartest.c.

◆ I2_MAX

#define I2_MAX   0x7fff

Definition at line 81 of file vartest.c.

◆ I2_MIN

#define I2_MIN   ((-I2_MAX)-1)

Definition at line 82 of file vartest.c.

◆ I4_MAX

#define I4_MAX   0x7fffffff

Definition at line 85 of file vartest.c.

◆ I4_MIN

#define I4_MIN   ((-I4_MAX)-1)

Definition at line 86 of file vartest.c.

◆ I8_MAX

#define I8_MAX   (((LONGLONG)I4_MAX << 32) | UI4_MAX)

Definition at line 89 of file vartest.c.

◆ I8_MIN

#define I8_MIN   ((-I8_MAX)-1)

Definition at line 90 of file vartest.c.

◆ INTEGER_VTBITS

◆ MKDOSDATE

#define MKDOSDATE (   d,
  m,
  y 
)    ((d & 0x1f) | ((m & 0xf) << 5) | (((y-1980) & 0x7f) << 9))

Definition at line 2151 of file vartest.c.

◆ MKDOSTIME

#define MKDOSTIME (   h,
  m,
  s 
)    (((s>>1) & 0x1f) | ((m & 0x3f) << 5) | ((h & 0x1f) << 11))

Definition at line 2152 of file vartest.c.

◆ R4_MAX

#define R4_MAX   FLT_MAX

Definition at line 95 of file vartest.c.

◆ R4_MIN

#define R4_MIN   FLT_MIN

Definition at line 96 of file vartest.c.

◆ R8_MAX

#define R8_MAX   DBL_MAX

Definition at line 97 of file vartest.c.

◆ R8_MIN

#define R8_MIN   DBL_MIN

Definition at line 98 of file vartest.c.

◆ SET_EXPECT

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

Definition at line 103 of file vartest.c.

◆ SETRGB

#define SETRGB (   indx,
  val 
)    if (!indx) memset(rgb, FAILDIG, sizeof(rgb)); rgb[indx] = val

Definition at line 1742 of file vartest.c.

◆ SKIPTESTAND

#define SKIPTESTAND (   a)
Value:
if (a == VT_ERROR || a == VT_VARIANT || \
a == VT_DISPATCH || a == VT_UNKNOWN || \
a > VT_UINT || a == 15 /*not defined*/) \
continue
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Definition at line 6213 of file vartest.c.

◆ SKIPTESTDIV

#define SKIPTESTDIV (   a)
Value:
if (a == VT_ERROR || a == VT_VARIANT || \
a == VT_DISPATCH || a == VT_UNKNOWN || \
a == VT_RECORD || a > VT_UINT || \
a == VT_I1 || a == VT_UI8 || \
a == VT_INT || a == VT_UINT || \
a == VT_UI2 || a == VT_UI4 || \
a == 15 /*not defined*/) \
continue
Definition: compat.h:1959
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Definition at line 7686 of file vartest.c.

◆ SKIPTESTIDIV

#define SKIPTESTIDIV (   a)
Value:
if (a == VT_ERROR || a == VT_VARIANT || \
a == VT_DISPATCH || a == VT_UNKNOWN || \
a == VT_RECORD || a > VT_UINT || \
a == 15 /*not defined*/) \
continue
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Definition at line 8063 of file vartest.c.

◆ SKIPTESTIMP

#define SKIPTESTIMP (   a)
Value:
if (a == VT_ERROR || a == VT_VARIANT || \
a == VT_DISPATCH || a == VT_UNKNOWN || \
a == VT_RECORD || a > VT_UINT || \
a == 15 /*not defined*/) \
continue
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Definition at line 8629 of file vartest.c.

◆ SKIPTESTPOW

#define SKIPTESTPOW (   a)
Value:
if (a == VT_ERROR || a == VT_VARIANT || \
a == VT_DISPATCH || a == VT_UNKNOWN || \
a == VT_RECORD || a > VT_UINT || \
a == 15 /*not defined*/) \
continue
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Definition at line 7164 of file vartest.c.

◆ SKIPTESTS

#define SKIPTESTS (   a)    if((a > VT_CLSID+10) && (a < VT_BSTR_BLOB-10)) continue

Definition at line 70 of file vartest.c.

◆ ST2DT

#define ST2DT (   d,
  m,
  y,
  h,
  mn,
  s,
  ms,
  r,
  dt 
)    test_st2dt(__LINE__,d,m,y,h,mn,s,ms,r,dt)

Definition at line 2106 of file vartest.c.

◆ test_bstr_var

#define test_bstr_var (   a,
  b 
)    _test_bstr_var(__LINE__,a,b)

Definition at line 671 of file vartest.c.

◆ UD2T

#define UD2T (   d,
  m,
  y,
  h,
  mn,
  s,
  ms,
  dw,
  dy,
  flags,
  r,
  dt 
)    test_DateFromUDate(__LINE__,d,m,y,h,mn,s,ms,dw,dy,flags,r,dt)

Definition at line 2030 of file vartest.c.

◆ UI1_MAX

#define UI1_MAX   0xff

Definition at line 79 of file vartest.c.

◆ UI1_MIN

#define UI1_MIN   0

Definition at line 80 of file vartest.c.

◆ UI2_MAX

#define UI2_MAX   0xffff

Definition at line 83 of file vartest.c.

◆ UI2_MIN

#define UI2_MIN   0

Definition at line 84 of file vartest.c.

◆ UI4_MAX

#define UI4_MAX   0xffffffff

Definition at line 87 of file vartest.c.

◆ UI4_MIN

#define UI4_MIN   0

Definition at line 88 of file vartest.c.

◆ UI8_MAX

#define UI8_MAX   (((ULONGLONG)UI4_MAX << 32) | UI4_MAX)

Definition at line 91 of file vartest.c.

◆ UI8_MIN

#define UI8_MIN   0

Definition at line 92 of file vartest.c.

◆ V_EMPTY

#define V_EMPTY (   v)    V_I4(v)

Definition at line 73 of file vartest.c.

◆ V_NULL

#define V_NULL (   v)    V_I4(v)

Definition at line 74 of file vartest.c.

◆ V_NULL_

#define V_NULL_   V_NULL

Definition at line 6912 of file vartest.c.

◆ VARABS

#define VARABS (   vt,
  val,
  rvt,
  rval 
)
Value:
V_VT(&v) = VT_##vt; V_##vt(&v) = val; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call1( __LINE__, pVarAbs, &v, &exp )
GLuint GLfloat * val
Definition: glext.h:7180
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
const GLdouble * v
Definition: gl.h:2040
DWORD exp
Definition: msg.c:15681

Definition at line 2277 of file vartest.c.

◆ VARADD

#define VARADD (   vt1,
  val1,
  vt2,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_##vt2; V_##vt2(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarAdd, &left, &right, &exp )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 5550 of file vartest.c.

◆ VARAND

#define VARAND (   vt1,
  val1,
  vt2,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_##vt2; V_##vt2(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarAnd, &left, &right, &exp )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 6200 of file vartest.c.

◆ VARANDCY

#define VARANDCY (   vt1,
  val1,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_CY; V_CY(&right).int64 = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarAnd, &left, &right, &exp )
#define V_CY(A)
Definition: oleauto.h:229
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
Definition: compat.h:1950
DWORD exp
Definition: msg.c:15681

Definition at line 6206 of file vartest.c.

◆ VARCMP

#define VARCMP (   vt1,
  val1,
  vt2,
  val2,
  result 
)    VARCMPEX(vt1,val1,vt2,val2,result,result,result,result)

Definition at line 6909 of file vartest.c.

◆ VARCMPEX

#define VARCMPEX (   vt1,
  val1,
  vt2,
  val2,
  res1,
  res2,
  res3,
  res4 
)
Value:
V_##vt1(&left) = val1; V_VT(&left) = VT_##vt1; \
V_##vt2(&right) = val2; V_VT(&right) = VT_##vt2; \
test_cmpex( __LINE__, lcid, &left, &right, res1, res2, res3, res4 )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
#define V_VT(A)
Definition: oleauto.h:211

Definition at line 6905 of file vartest.c.

◆ VARDIV

#define VARDIV (   vt1,
  val1,
  vt2,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_##vt2; V_##vt2(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarDiv, &left, &right, &exp )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 7679 of file vartest.c.

◆ VAREQV

#define VAREQV (   vt1,
  val1,
  vt2,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_##vt2; V_##vt2(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarEqv, &left, &right, &exp )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 5240 of file vartest.c.

◆ VARFIX

#define VARFIX (   vt,
  val,
  rvt,
  rval 
)
Value:
V_VT(&v) = VT_##vt; V_##vt(&v) = val; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call1( __LINE__, pVarFix, &v, &exp )
GLuint GLfloat * val
Definition: glext.h:7180
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
const GLdouble * v
Definition: gl.h:2040
DWORD exp
Definition: msg.c:15681

Definition at line 3240 of file vartest.c.

◆ VARIDIV

#define VARIDIV (   vt1,
  val1,
  vt2,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_##vt2; V_##vt2(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarIdiv, &left, &right, &exp )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 8056 of file vartest.c.

◆ VARIMP

#define VARIMP (   vt1,
  val1,
  vt2,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_##vt2; V_##vt2(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarImp, &left, &right, &exp )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 8622 of file vartest.c.

◆ VARINT

#define VARINT (   vt,
  val,
  rvt,
  rval 
)
Value:
V_VT(&v) = VT_##vt; V_##vt(&v) = val; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call1( __LINE__, pVarInt, &v, &exp )
GLuint GLfloat * val
Definition: glext.h:7180
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
const GLdouble * v
Definition: gl.h:2040
DWORD exp
Definition: msg.c:15681

Definition at line 3355 of file vartest.c.

◆ VARMOD

#define VARMOD (   vt1,
  vt2,
  val1,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_##vt2; V_##vt2(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarMod, &left, &right, &exp )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 2747 of file vartest.c.

◆ VARMOD2

#define VARMOD2 (   vt1,
  vt2,
  val1,
  val2,
  rvt,
  rval,
  hexpected 
)
Value:
V_VT(&left) = VT_##vt1; V_I4(&left) = val1; \
V_VT(&right) = VT_##vt2; V_I4(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_I4(&exp) = rval; \
test_Mod( __LINE__, &left, &right, &exp, hexpected )
#define V_I4(A)
Definition: oleauto.h:247
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 2753 of file vartest.c.

◆ VARMUL

#define VARMUL (   vt1,
  val1,
  vt2,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_##vt2; V_##vt2(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarMul, &left, &right, &exp )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 5379 of file vartest.c.

◆ VARNEG

#define VARNEG (   vt,
  val,
  rvt,
  rval 
)
Value:
V_VT(&v) = VT_##vt; V_##vt(&v) = val; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call1( __LINE__, pVarNeg, &v, &exp )
GLuint GLfloat * val
Definition: glext.h:7180
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
const GLdouble * v
Definition: gl.h:2040
DWORD exp
Definition: msg.c:15681

Definition at line 3471 of file vartest.c.

◆ VARNOT

#define VARNOT (   vt,
  val,
  rvt,
  rval 
)
Value:
V_VT(&v) = VT_##vt; V_##vt(&v) = val; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call1( __LINE__, pVarNot, &v, &exp )
GLuint GLfloat * val
Definition: glext.h:7180
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
const GLdouble * v
Definition: gl.h:2040
DWORD exp
Definition: msg.c:15681

Definition at line 2375 of file vartest.c.

◆ VAROR

#define VAROR (   vt1,
  val1,
  vt2,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_##vt2; V_##vt2(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarOr, &left, &right, &exp )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 4499 of file vartest.c.

◆ VARORCY

#define VARORCY (   vt1,
  val1,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_CY; V_CY(&right).int64 = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarOr, &left, &right, &exp )
#define V_CY(A)
Definition: oleauto.h:229
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
Definition: compat.h:1950
DWORD exp
Definition: msg.c:15681

Definition at line 4505 of file vartest.c.

◆ VARPOW

#define VARPOW (   vt1,
  val1,
  vt2,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_##vt2; V_##vt2(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarPow, &left, &right, &exp )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 7157 of file vartest.c.

◆ VARROUND

#define VARROUND (   vt,
  val,
  deci,
  rvt,
  rval 
)
Value:
V_VT(&v) = VT_##vt; V_##vt(&v) = val; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_Round( __LINE__, &v, deci, &exp )
GLuint GLfloat * val
Definition: glext.h:7180
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
const GLdouble * v
Definition: gl.h:2040
DWORD exp
Definition: msg.c:15681

Definition at line 3607 of file vartest.c.

◆ VARSUB

#define VARSUB (   vt1,
  val1,
  vt2,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_##vt2; V_##vt2(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarSub, &left, &right, &exp )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 2502 of file vartest.c.

◆ VARXOR

#define VARXOR (   vt1,
  val1,
  vt2,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_##vt2; V_##vt2(&right) = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarXor, &left, &right, &exp )
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
DWORD exp
Definition: msg.c:15681

Definition at line 3765 of file vartest.c.

◆ VARXORCY

#define VARXORCY (   vt1,
  val1,
  val2,
  rvt,
  rval 
)
Value:
V_VT(&left) = VT_##vt1; V_##vt1(&left) = val1; \
V_VT(&right) = VT_CY; V_CY(&right).int64 = val2; \
V_VT(&exp) = VT_##rvt; V_##rvt(&exp) = rval; \
test_var_call2( __LINE__, pVarXor, &left, &right, &exp )
#define V_CY(A)
Definition: oleauto.h:229
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
float rval
Definition: cylfrac.c:48
#define V_VT(A)
Definition: oleauto.h:211
Definition: compat.h:1950
DWORD exp
Definition: msg.c:15681

Definition at line 3771 of file vartest.c.

◆ VT_NULL_

#define VT_NULL_   VT_NULL

Definition at line 6913 of file vartest.c.

Typedef Documentation

◆ IRecordInfoImpl

Function Documentation

◆ _test_bstr_var()

static void _test_bstr_var ( unsigned  line,
const VARIANT v,
const char str 
)
static

Definition at line 672 of file vartest.c.

673 {
674  ok_(__FILE__,line)(V_VT(v) == VT_BSTR, "unexpected vt=%d\n", V_VT(v));
675  if(V_VT(v) == VT_BSTR)
676  ok(!strcmp_wa(V_BSTR(v), str), "v=%s, expected %s\n", wine_dbgstr_w(V_BSTR(v)), str);
677 }
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
static int strcmp_wa(const WCHAR *strw, const char *stra)
Definition: vartest.c:664
const WCHAR * str
Definition: parser.c:48
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
const GLdouble * v
Definition: gl.h:2040
#define ok(value,...)
Definition: atltest.h:57
#define ok_(x1, x2)
Definition: atltest.h:61

◆ convert_str()

static HRESULT convert_str ( const char str,
INT  dig,
ULONG  flags,
NUMPARSE np,
BYTE  rgb[128],
LCID  lcid 
)
static

Definition at line 1275 of file vartest.c.

1277 {
1278  OLECHAR buff[128];
1280  memset( rgb, FAILDIG, 128 );
1281  memset( np, 255, sizeof(*np) );
1282  np->cDig = dig;
1283  np->dwInFlags = flags;
1284  return pVarParseNumFromStr( buff, lcid, LOCALE_NOUSEROVERRIDE, np, rgb);
1285 }
WCHAR OLECHAR
Definition: compat.h:1941
#define CP_ACP
Definition: compat.h:99
ULONG dwInFlags
Definition: oleauto.h:728
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
const WCHAR * str
INT cDig
Definition: oleauto.h:727
GLbitfield flags
Definition: glext.h:7161
#define FAILDIG
Definition: vartest.c:1273
_In_ ULONG _In_ ULONG rgb
Definition: winddi.h:3520
#define ARRAY_SIZE(a)
Definition: main.h:24
#define MultiByteToWideChar
Definition: compat.h:100
#define memset(x, y, z)
Definition: compat.h:39
static unsigned char buff[32768]
Definition: fatten.c:17

◆ DEFINE_EXPECT()

DEFINE_EXPECT ( dispatch_invoke  )

◆ DummyDispatch_AddRef()

static ULONG WINAPI DummyDispatch_AddRef ( IDispatch iface)
static

Definition at line 138 of file vartest.c.

139 {
140  return 2;
141 }

◆ DummyDispatch_GetIDsOfNames()

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

Definition at line 176 of file vartest.c.

178 {
179  ok(0, "Unexpected call\n");
180  return E_NOTIMPL;
181 }
#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 170 of file vartest.c.

171 {
172  ok(0, "Unexpected call\n");
173  return E_NOTIMPL;
174 }
#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 164 of file vartest.c.

165 {
166  ok(0, "Unexpected call\n");
167  return E_NOTIMPL;
168 }
#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 183 of file vartest.c.

190 {
192 
193  CHECK_EXPECT(dispatch_invoke);
194 
195  ok(dispid == DISPID_VALUE, "got dispid %d\n", dispid);
196  ok(IsEqualIID(riid, &IID_NULL), "go riid %s\n", wine_dbgstr_guid(riid));
197  ok(wFlags == DISPATCH_PROPERTYGET, "Flags wrong\n");
198 
199  ok(params->rgvarg == NULL, "got %p\n", params->rgvarg);
200  ok(params->rgdispidNamedArgs == NULL, "got %p\n", params->rgdispidNamedArgs);
201  ok(params->cArgs == 0, "got %d\n", params->cArgs);
202  ok(params->cNamedArgs == 0, "got %d\n", params->cNamedArgs);
203 
204  ok(res != NULL, "got %p\n", res);
205  ok(V_VT(res) == VT_EMPTY, "got %d\n", V_VT(res));
206  ok(ei == NULL, "got %p\n", ei);
207  ok(arg_err == NULL, "got %p\n", arg_err);
208 
209  if (FAILED(This->result))
210  return This->result;
211 
212  V_VT(res) = This->vt;
213  if (This->vt == VT_UI1)
214  V_UI1(res) = 34;
215  else if (This->vt == VT_NULL)
216  {
217  V_VT(res) = VT_NULL;
218  V_BSTR(res) = NULL;
219  }
220  else
221  memset(res, 0, sizeof(*res));
222 
223  return S_OK;
224 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define CHECK_EXPECT(func)
Definition: vartest.c:112
REFIID riid
Definition: precomp.h:44
const char * wine_dbgstr_guid(const GUID *guid)
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
#define V_BSTR(A)
Definition: oleauto.h:226
_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
static DummyDispatch * impl_from_IDispatch(IDispatch *iface)
Definition: vartest.c:133
#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 148 of file vartest.c.

151 {
152  *ppvObject = NULL;
153 
154  if (IsEqualIID(riid, &IID_IDispatch) ||
156  {
157  *ppvObject = iface;
158  IDispatch_AddRef(iface);
159  }
160 
161  return *ppvObject ? S_OK : E_NOINTERFACE;
162 }
#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 143 of file vartest.c.

144 {
145  return 1;
146 }

◆ expect_NumFromStr()

static void expect_NumFromStr ( int  line,
HRESULT  hres,
NUMPARSE np,
INT  a,
ULONG  b,
ULONG  c,
INT  d,
INT  e,
INT  f 
)
static

Definition at line 1287 of file vartest.c.

1289 {
1290  if (hres == (HRESULT)S_OK)
1291  {
1292  ok_(__FILE__,line)(np->cDig == a, "Expected cDig = %d, got %d\n", a, np->cDig);
1293  ok_(__FILE__,line)(np->dwInFlags == b, "Expected dwInFlags = 0x%x, got 0x%x\n", b, np->dwInFlags);
1294  ok_(__FILE__,line)(np->dwOutFlags == c, "Expected dwOutFlags = 0x%x, got 0x%x\n", c, np->dwOutFlags);
1295  ok_(__FILE__,line)(np->cchUsed == d, "Expected cchUsed = %d, got %d\n", d, np->cchUsed);
1296  ok_(__FILE__,line)(np->nBaseShift == e, "Expected nBaseShift = %d, got %d\n", e, np->nBaseShift);
1297  ok_(__FILE__,line)(np->nPwr10 == f, "Expected nPwr10 = %d, got %d\n", f, np->nPwr10);
1298  }
1299 }
INT nBaseShift
Definition: oleauto.h:731
ULONG dwInFlags
Definition: oleauto.h:728
#define a
Definition: ke_i.h:78
#define e
Definition: ke_i.h:82
Definition: parser.c:48
#define b
Definition: ke_i.h:79
HRESULT hres
Definition: protocol.c:465
#define d
Definition: ke_i.h:81
LONG HRESULT
Definition: typedefs.h:77
INT cchUsed
Definition: oleauto.h:730
INT cDig
Definition: oleauto.h:727
#define S_OK
Definition: intsafe.h:59
#define f
Definition: ke_i.h:83
#define c
Definition: ke_i.h:80
INT nPwr10
Definition: oleauto.h:732
#define ok_(x1, x2)
Definition: atltest.h:61
ULONG dwOutFlags
Definition: oleauto.h:729

◆ get_test_recordinfo()

static IRecordInfoImpl* get_test_recordinfo ( void  )
static

Definition at line 422 of file vartest.c.

423 {
424  IRecordInfoImpl *rec;
425 
426  rec = HeapAlloc(GetProcessHeap(), 0, sizeof(IRecordInfoImpl));
427  rec->IRecordInfo_iface.lpVtbl = &RecordInfoVtbl;
428  rec->ref = 1;
429  rec->recordclear = 0;
430  rec->getsize = 0;
431  rec->recordcopy = 0;
432 
433  return rec;
434 }
static const IRecordInfoVtbl RecordInfoVtbl
Definition: vartest.c:399
unsigned int recordcopy
Definition: safearray.c:82
unsigned int getsize
Definition: vartest.c:249
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned int recordclear
Definition: vartest.c:248
IRecordInfo IRecordInfo_iface
Definition: recinfo.c:44

Referenced by test_VariantClear(), and test_VariantCopy().

◆ HRESULT()

static HRESULT ( WINAPI pVarUdateFromDate)
static

◆ impl_from_IDispatch()

static DummyDispatch* impl_from_IDispatch ( IDispatch iface)
inlinestatic

Definition at line 133 of file vartest.c.

134 {
135  return CONTAINING_RECORD(iface, DummyDispatch, IDispatch_iface);
136 }
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_Invoke().

◆ impl_from_IRecordInfo()

static IRecordInfoImpl* impl_from_IRecordInfo ( IRecordInfo iface)
inlinestatic

Definition at line 254 of file vartest.c.

255 {
256  return CONTAINING_RECORD(iface, IRecordInfoImpl, IRecordInfo_iface);
257 }
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 RecordInfo_AddRef(), RecordInfo_GetSize(), RecordInfo_RecordClear(), RecordInfo_RecordCopy(), and RecordInfo_Release().

◆ impl_from_IUnknown()

static test_VariantClearImpl* impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 735 of file vartest.c.

736 {
737  return CONTAINING_RECORD(iface, test_VariantClearImpl, IUnknown_iface);
738 }
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 VC_AddRef(), VC_QueryInterface(), and VC_Release().

◆ init()

static void init ( void  )
static

Definition at line 436 of file vartest.c.

437 {
438  BSTR bstr;
439  HRESULT res;
440 
441  res = VarBstrFromBool(VARIANT_TRUE, LANG_USER_DEFAULT, VAR_LOCALBOOL, &bstr);
442  ok(res == S_OK && bstr[0], "Expected localized string for 'True'\n");
443  /* lstrcpyW / lstrcatW do not work on win95 */
444  memcpy(sz12_true, sz12, sizeof(sz12));
445  if (bstr) memcpy(&sz12_true[2], bstr, SysStringByteLen(bstr) + sizeof(WCHAR));
446  SysFreeString(bstr);
447 
448  res = VarBstrFromBool(VARIANT_FALSE, LANG_USER_DEFAULT, VAR_LOCALBOOL, &bstr);
449  ok(res == S_OK && bstr[0], "Expected localized string for 'False'\n");
450  memcpy(sz12_false, sz12, sizeof(sz12));
451  if (bstr) memcpy(&sz12_false[2], bstr, SysStringByteLen(bstr) + sizeof(WCHAR));
452  SysFreeString(bstr);
453 
454  hOleaut32 = GetModuleHandleA("oleaut32.dll");
455  has_i8 = GetProcAddress(hOleaut32, "VarI8FromI1") != NULL;
456  if (!has_i8)
457  skip("No support for I8 and UI8 data types\n");
458 }
static BOOL has_i8
Definition: vartest.c:62
static WCHAR sz12_false[32]
Definition: vartest.c:54
UINT WINAPI SysStringByteLen(BSTR str)
Definition: oleaut.c:218
OLECHAR * BSTR
Definition: compat.h:1942
static WCHAR sz12_true[32]
Definition: vartest.c:55
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
#define VAR_LOCALBOOL
Definition: oleauto.h:330
#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
HRESULT WINAPI VarBstrFromBool(VARIANT_BOOL boolIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
Definition: vartype.c:6851
#define skip(...)
Definition: atltest.h:64
GLuint res
Definition: glext.h:9613
static HMODULE hOleaut32
Definition: vartest.c:43
#define GetProcAddress(x, y)
Definition: compat.h:418
static double *static USHORT USHORT *static const WCHAR sz12[]
Definition: vartest.c:52
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50

Referenced by START_TEST().

◆ init_test_dispatch()

static void init_test_dispatch ( VARTYPE  vt,
DummyDispatch dispatch 
)
static

Definition at line 237 of file vartest.c.

238 {
239  dispatch->IDispatch_iface.lpVtbl = &DummyDispatch_VTable;
240  dispatch->vt = vt;
241  dispatch->result = S_OK;
242 }
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
#define S_OK
Definition: intsafe.h:59
static const IDispatchVtbl DummyDispatch_VTable
Definition: vartest.c:226

Referenced by test_VarCat().

◆ INT()

static UDATE* static DATE* static INT ( WINAPI pSystemTimeToVariantTime)
static

◆ is_expected_variant()

static BOOL is_expected_variant ( const VARIANT result,
const VARIANT expected 
)
static

Definition at line 585 of file vartest.c.

586 {
587  if (V_VT(result) != V_VT(expected)) return FALSE;
588  switch(V_VT(expected))
589  {
590  case VT_EMPTY:
591  case VT_NULL:
592  return TRUE;
593 
594 #define CASE(vt) case VT_##vt: return (V_##vt(result) == V_##vt(expected))
595  CASE(BOOL);
596  CASE(I1);
597  CASE(UI1);
598  CASE(I2);
599  CASE(UI2);
600  CASE(I4);
601  CASE(UI4);
602  CASE(I8);
603  CASE(UI8);
604  CASE(INT);
605  CASE(UINT);
606 #undef CASE
607 
608  case VT_DATE:
609  return EQ_FLOAT(V_DATE(result), V_DATE(expected));
610  case VT_R4:
611  return EQ_FLOAT(V_R4(result), V_R4(expected));
612  case VT_R8:
613  return EQ_FLOAT(V_R8(result), V_R8(expected));
614  case VT_CY:
615  return (V_CY(result).int64 == V_CY(expected).int64);
616  case VT_BSTR:
617  return !lstrcmpW( V_BSTR(result), V_BSTR(expected) );
618  case VT_DECIMAL:
619  return !memcmp( &V_DECIMAL(result), &V_DECIMAL(expected), sizeof(DECIMAL) );
620  default:
621  ok(0, "unhandled variant type %s\n",vtstr(V_VT(expected)));
622  return FALSE;
623  }
624 }
#define CASE(vt)
#define TRUE
Definition: types.h:120
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define V_R8(A)
Definition: oleauto.h:262
long long int64
Definition: platform.h:13
int32_t INT
Definition: typedefs.h:56
#define V_CY(A)
Definition: oleauto.h:229
unsigned int BOOL
Definition: ntddk_ex.h:94
#define V_DECIMAL(A)
Definition: oleauto.h:236
static const char * vtstr(int x)
Definition: vartest.c:481
#define V_R4(A)
Definition: oleauto.h:260
#define EQ_FLOAT(a, b)
Definition: vartest.c:68
Definition: compat.h:1948
#define V_VT(A)
Definition: oleauto.h:211
Definition: compat.h:1950
#define V_BSTR(A)
Definition: oleauto.h:226
#define ok(value,...)
Definition: atltest.h:57
unsigned int UINT
Definition: ndis.h:50
GLuint64EXT * result
Definition: glext.h:11304
Definition: compat.h:1949
BOOL expected
Definition: store.c:2063
#define V_DATE(A)
Definition: oleauto.h:231

Referenced by test_Mod(), test_Round(), test_var_call1(), and test_var_call2().

◆ IsValidVariantClearVT()

static BOOL IsValidVariantClearVT ( VARTYPE  vt,
VARTYPE  extraFlags 
)
static

Definition at line 710 of file vartest.c.

711 {
712  BOOL ret = FALSE;
713 
714  /* Only the following flags/types are valid */
715  if ((vt <= VT_LPWSTR || vt == VT_RECORD || vt == VT_CLSID) &&
716  vt != (VARTYPE)15 &&
717  (vt < (VARTYPE)24 || vt > (VARTYPE)31) &&
718  (!(extraFlags & (VT_BYREF|VT_ARRAY)) || vt > VT_NULL) &&
719  (extraFlags == 0 || extraFlags == VT_BYREF || extraFlags == VT_ARRAY ||
720  extraFlags == (VT_ARRAY|VT_BYREF)))
721  ret = TRUE; /* ok */
722 
723  if (!has_i8 && (vt == VT_I8 || vt == VT_UI8))
724  ret = FALSE; /* Old versions of oleaut32 */
725  return ret;
726 }
#define TRUE
Definition: types.h:120
Definition: compat.h:1963
static BOOL has_i8
Definition: vartest.c:62
unsigned int BOOL
Definition: ntddk_ex.h:94
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
int ret
unsigned short VARTYPE
Definition: compat.h:1903

Referenced by test_VarAbs(), test_VarAdd(), test_VarCmp(), test_VarEqv(), test_VariantClear(), test_VariantCopy(), test_VariantCopyInd(), test_VarMul(), test_VarNot(), test_VarOr(), test_VarSub(), and test_VarXor().

◆ IsValidVariantCopyIndVT()

static BOOL IsValidVariantCopyIndVT ( VARTYPE  vt,
VARTYPE  extraFlags 
)
static

Definition at line 1058 of file vartest.c.

1059 {
1060  BOOL ret = FALSE;
1061 
1062  if ((extraFlags & VT_ARRAY) ||
1063  (vt > VT_NULL && vt != (VARTYPE)15 && vt < VT_VOID &&
1064  !(extraFlags & (VT_VECTOR|VT_RESERVED))))
1065  {
1066  ret = TRUE; /* ok */
1067  }
1068  return ret;
1069 }
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
int ret
unsigned short VARTYPE
Definition: compat.h:1903

Referenced by test_VariantCopyInd().

◆ RecordInfo_AddRef()

static ULONG WINAPI RecordInfo_AddRef ( IRecordInfo iface)
static

Definition at line 274 of file vartest.c.

275 {
277  return InterlockedIncrement(&This->ref);
278 }
#define InterlockedIncrement
Definition: armddk.h:53
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: vartest.c:254

◆ RecordInfo_GetField()

static HRESULT WINAPI RecordInfo_GetField ( IRecordInfo iface,
PVOID  pvData,
LPCOLESTR  szFieldName,
VARIANT pvarField 
)
static

Definition at line 339 of file vartest.c.

341 {
342  ok(0, "unexpected call\n");
343  return E_NOTIMPL;
344 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RecordInfo_GetFieldNames()

static HRESULT WINAPI RecordInfo_GetFieldNames ( IRecordInfo iface,
ULONG pcNames,
BSTR rgBstrNames 
)
static

Definition at line 367 of file vartest.c.

369 {
370  ok(0, "unexpected call\n");
371  return E_NOTIMPL;
372 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RecordInfo_GetFieldNoCopy()

static HRESULT WINAPI RecordInfo_GetFieldNoCopy ( IRecordInfo iface,
PVOID  pvData,
LPCOLESTR  szFieldName,
VARIANT pvarField,
PVOID ppvDataCArray 
)
static

Definition at line 346 of file vartest.c.

348 {
349  ok(0, "unexpected call\n");
350  return E_NOTIMPL;
351 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RecordInfo_GetGuid()

static HRESULT WINAPI RecordInfo_GetGuid ( IRecordInfo iface,
GUID pguid 
)
static

Definition at line 313 of file vartest.c.

314 {
315  ok(0, "unexpected call\n");
316  return E_NOTIMPL;
317 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RecordInfo_GetName()

static HRESULT WINAPI RecordInfo_GetName ( IRecordInfo iface,
BSTR pbstrName 
)
static

Definition at line 319 of file vartest.c.

320 {
321  ok(0, "unexpected call\n");
322  return E_NOTIMPL;
323 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RecordInfo_GetSize()

static HRESULT WINAPI RecordInfo_GetSize ( IRecordInfo iface,
ULONG size 
)
static

Definition at line 325 of file vartest.c.

326 {
328  This->getsize++;
329  *size = 0;
330  return S_OK;
331 }
GLsizeiptr size
Definition: glext.h:5919
#define S_OK
Definition: intsafe.h:59
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: vartest.c:254

◆ RecordInfo_GetTypeInfo()

static HRESULT WINAPI RecordInfo_GetTypeInfo ( IRecordInfo iface,
ITypeInfo **  ppTypeInfo 
)
static

Definition at line 333 of file vartest.c.

334 {
335  ok(0, "unexpected call\n");
336  return E_NOTIMPL;
337 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RecordInfo_IsMatchingType()

static BOOL WINAPI RecordInfo_IsMatchingType ( IRecordInfo iface,
IRecordInfo info2 
)
static

Definition at line 374 of file vartest.c.

375 {
376  ok(0, "unexpected call\n");
377  return FALSE;
378 }
#define ok(value,...)
Definition: atltest.h:57

◆ RecordInfo_PutField()

static HRESULT WINAPI RecordInfo_PutField ( IRecordInfo iface,
ULONG  wFlags,
PVOID  pvData,
LPCOLESTR  szFieldName,
VARIANT pvarField 
)
static

Definition at line 353 of file vartest.c.

355 {
356  ok(0, "unexpected call\n");
357  return E_NOTIMPL;
358 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RecordInfo_PutFieldNoCopy()

static HRESULT WINAPI RecordInfo_PutFieldNoCopy ( IRecordInfo iface,
ULONG  wFlags,
PVOID  pvData,
LPCOLESTR  szFieldName,
VARIANT pvarField 
)
static

Definition at line 360 of file vartest.c.

362 {
363  ok(0, "unexpected call\n");
364  return E_NOTIMPL;
365 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RecordInfo_QueryInterface()

static HRESULT WINAPI RecordInfo_QueryInterface ( IRecordInfo iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 259 of file vartest.c.

260 {
261  *obj = NULL;
262 
263  if (IsEqualIID(riid, &IID_IUnknown) ||
264  IsEqualIID(riid, &IID_IRecordInfo))
265  {
266  *obj = iface;
267  IRecordInfo_AddRef(iface);
268  return S_OK;
269  }
270 
271  return E_NOINTERFACE;
272 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ RecordInfo_RecordClear()

static HRESULT WINAPI RecordInfo_RecordClear ( IRecordInfo iface,
void data 
)
static

Definition at line 297 of file vartest.c.

298 {
300  This->recordclear++;
301  This->rec->pvRecord = NULL;
302  return S_OK;
303 }
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: vartest.c:254

◆ RecordInfo_RecordCopy()

static HRESULT WINAPI RecordInfo_RecordCopy ( IRecordInfo iface,
void src,
void dest 
)
static

Definition at line 305 of file vartest.c.

306 {
308  This->recordcopy++;
309  ok(src == (void*)0xdeadbeef, "wrong src pointer %p\n", src);
310  return S_OK;
311 }
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: vartest.c:254

◆ RecordInfo_RecordCreate()

static PVOID WINAPI RecordInfo_RecordCreate ( IRecordInfo iface)
static

Definition at line 380 of file vartest.c.

381 {
382  ok(0, "unexpected call\n");
383  return NULL;
384 }
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: atltest.h:57

◆ RecordInfo_RecordCreateCopy()

static HRESULT WINAPI RecordInfo_RecordCreateCopy ( IRecordInfo iface,
PVOID  pvSource,
PVOID ppvDest 
)
static

Definition at line 386 of file vartest.c.

388 {
389  ok(0, "unexpected call\n");
390  return E_NOTIMPL;
391 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RecordInfo_RecordDestroy()

static HRESULT WINAPI RecordInfo_RecordDestroy ( IRecordInfo iface,
PVOID  pvRecord 
)
static

Definition at line 393 of file vartest.c.

394 {
395  ok(0, "unexpected call\n");
396  return E_NOTIMPL;
397 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RecordInfo_RecordInit()

static HRESULT WINAPI RecordInfo_RecordInit ( IRecordInfo iface,
PVOID  pvNew 
)
static

Definition at line 291 of file vartest.c.

292 {
293  ok(0, "unexpected call\n");
294  return E_NOTIMPL;
295 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RecordInfo_Release()

static ULONG WINAPI RecordInfo_Release ( IRecordInfo iface)
static

Definition at line 280 of file vartest.c.

281 {
284 
285  if (!ref)
287 
288  return ref;
289 }
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
#define GetProcessHeap()
Definition: compat.h:403
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: vartest.c:254
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ setdec()

static void setdec ( DECIMAL dec,
BYTE  scl,
BYTE  sgn,
ULONG  hi32,
ULONG64  lo64 
)
static

Definition at line 461 of file vartest.c.

462 {
463  S(U(*dec)).scale = scl;
464  S(U(*dec)).sign = sgn;
465  dec->Hi32 = hi32;
466  U1(*dec).Lo64 = lo64;
467 }
#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

Referenced by test_VarCmp().

◆ setdec64()

static void setdec64 ( DECIMAL dec,
BYTE  scl,
BYTE  sgn,
ULONG  hi32,
ULONG  mid32,
ULONG  lo32 
)
static

Definition at line 469 of file vartest.c.

470 {
471  S(U(*dec)).scale = scl;
472  S(U(*dec)).sign = sgn;
473  dec->Hi32 = hi32;
474  S1(U1(*dec)).Mid32 = mid32;
475  S1(U1(*dec)).Lo32 = lo32;
476 }
#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

Referenced by test_VarCmp().

◆ START_TEST()

START_TEST ( vartest  )

Definition at line 9182 of file vartest.c.

9183 {
9184  init();
9185 
9186  test_VariantInit();
9188  test_VariantCopy();
9198  test_VarAbs();
9199  test_VarNot();
9200  test_VarSub();
9201  test_VarMod();
9202  test_VarFix();
9203  test_VarInt();
9204  test_VarNeg();
9205  test_VarRound();
9206  test_VarXor();
9207  test_VarOr();
9208  test_VarPow();
9209  test_VarEqv();
9210  test_VarMul();
9211  test_VarAdd();
9212  test_VarCmp(); /* Before test_VarCat() which needs VarCmp() */
9213  test_VarCat();
9214  test_VarAnd();
9215  test_VarDiv();
9216  test_VarIdiv();
9217  test_VarImp();
9218 }
static void test_DosDateTimeToVariantTime(void)
Definition: vartest.c:2170
static void test_VarAbs(void)
Definition: vartest.c:2282
static void test_VarDateFromUdate(void)
Definition: vartest.c:2032
static void test_VarCat(void)
Definition: vartest.c:5743
static void test_VariantInit(void)
Definition: vartest.c:679
static void test_VarNumFromParseNum(void)
Definition: vartest.c:1785
static void test_VarMod(void)
Definition: vartest.c:2759
static void test_VarXor(void)
Definition: vartest.c:3777
static void test_VarFix(void)
Definition: vartest.c:3245
static void test_VarNeg(void)
Definition: vartest.c:3476
static void test_VarImp(void)
Definition: vartest.c:8636
static void test_VarNot(void)
Definition: vartest.c:2380
static void test_VarCmp(void)
Definition: vartest.c:6915
static void test_VarUdateFromDate(void)
Definition: vartest.c:1976
static void test_VarMul(void)
Definition: vartest.c:5385
static void test_VarSub(void)
Definition: vartest.c:2508
static void test_VarDiv(void)
Definition: vartest.c:7696
static void test_VarAnd(void)
Definition: vartest.c:6219
static void init(void)
Definition: vartest.c:436
static void test_VariantTimeToDosDateTime(void)
Definition: vartest.c:2258
static void test_VariantCopyInd(void)
Definition: vartest.c:1071
static void test_VariantTimeToSystemTime(void)
Definition: vartest.c:2144
static void test_VariantCopy(void)
Definition: vartest.c:909
static void test_VarIdiv(void)
Definition: vartest.c:8070
static void test_SystemTimeToVariantTime(void)
Definition: vartest.c:2108
static void test_VarEqv(void)
Definition: vartest.c:5246
static void test_VarRound(void)
Definition: vartest.c:3639
static void test_VarAdd(void)
Definition: vartest.c:5556
static void test_VarOr(void)
Definition: vartest.c:4511
static void test_VariantClear(void)
Definition: vartest.c:768
static void test_VarParseNumFromStr(void)
Definition: vartest.c:1308
static void test_VarPow(void)
Definition: vartest.c:7171
static void test_VarInt(void)
Definition: vartest.c:3360

◆ strcmp_wa()

static int strcmp_wa ( const WCHAR strw,
const char stra 
)
static

Definition at line 664 of file vartest.c.

665 {
666  WCHAR buf[512];
667  MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, ARRAY_SIZE(buf));
668  return lstrcmpW(strw, buf);
669 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CP_ACP
Definition: compat.h:99
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ARRAY_SIZE(a)
Definition: main.h:24
#define MultiByteToWideChar
Definition: compat.h:100
static const char * strw(LPCWSTR x)
Definition: actctx.c:49

Referenced by _test_bstr_var(), and test_VarCat().

◆ test_cmp()

static void test_cmp ( int  line,
LCID  lcid,
UINT  flags,
VARIANT left,
VARIANT right,
HRESULT  result 
)
static

Definition at line 6875 of file vartest.c.

6876 {
6877  HRESULT hres;
6878 
6879  CHECKPTR(VarCmp);
6880 
6881  hres = pVarCmp(left,right,lcid,flags);
6882  ok_(__FILE__,line)(hres == result, "VarCmp(%s,%s): expected 0x%x, got hres=0x%x\n",
6884 }
Definition: parser.c:48
#define CHECKPTR(func)
Definition: vartest.c:58
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLint left
Definition: glext.h:7726
static const char * variantstr(const VARIANT *var)
Definition: vartest.c:546
GLdouble GLdouble right
Definition: glext.h:10859
GLbitfield flags
Definition: glext.h:7161
GLuint64EXT * result
Definition: glext.h:11304
HRESULT WINAPI VarCmp(LPVARIANT left, LPVARIANT right, LCID lcid, DWORD flags)
Definition: variant.c:2715
#define ok_(x1, x2)
Definition: atltest.h:61

Referenced by test_cmpex().

◆ test_cmpex()

static void test_cmpex ( int  line,
LCID  lcid,
VARIANT left,
VARIANT right,
HRESULT  res1,
HRESULT  res2,
HRESULT  res3,
HRESULT  res4 
)
static

Definition at line 6885 of file vartest.c.

6887 {
6888  test_cmp( line, lcid, 0, left, right, res1 );
6889  V_VT(left) |= VT_RESERVED;
6890  test_cmp( line, lcid, 0, left, right, res2 );
6891  V_VT(left) &= ~VT_RESERVED;
6892  V_VT(right) |= VT_RESERVED;
6893  test_cmp( line, lcid, 0, left, right, res3 );
6894  V_VT(left) |= VT_RESERVED;
6895  test_cmp( line, lcid, 0, left, right, res4 );
6896  ok_(__FILE__,line)(V_VT(left) & V_VT(right) & VT_RESERVED, "VT_RESERVED filtered out\n");
6897 }
Definition: parser.c:48
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
#define V_VT(A)
Definition: oleauto.h:211
static void test_cmp(int line, LCID lcid, UINT flags, VARIANT *left, VARIANT *right, HRESULT result)
Definition: vartest.c:6875
#define ok_(x1, x2)
Definition: atltest.h:61

◆ test_DateFromUDate()

static void test_DateFromUDate ( int  line,
WORD  d,
WORD  m,
WORD  y,
WORD  h,
WORD  mn,
WORD  s,
WORD  ms,
WORD  dw,
WORD  dy,
ULONG  flags,
HRESULT  r,
DATE  dt 
)
static

Definition at line 2010 of file vartest.c.

2012 {
2013  UDATE ud;
2014  double out;
2015  HRESULT res;
2016 
2017  ud.st.wYear = y;
2018  ud.st.wMonth = m;
2019  ud.st.wDay = d;
2020  ud.st.wHour = h;
2021  ud.st.wMinute = mn;
2022  ud.st.wSecond = s;
2023  ud.st.wMilliseconds = ms;
2024  ud.st.wDayOfWeek = dw;
2025  ud.wDayOfYear = dy;
2026  res = pVarDateFromUdate(&ud, flags, &out);
2027  ok_(__FILE__,line)(r == res && (r != S_OK || EQ_DOUBLE(out, dt)),
2028  "expected %x, %.16g, got %x, %.16g\n", r, dt, res, out);
2029 }
SYSTEMTIME st
Definition: oleauto.h:721
WORD wMonth
Definition: winbase.h:878
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
WORD wDayOfWeek
Definition: winbase.h:879
GLint dy
Definition: linetemp.h:97
const GLfloat * m
Definition: glext.h:10848
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
WORD wYear
Definition: winbase.h:877
WORD wMinute
Definition: winbase.h:882
Definition: parser.c:48
#define d
Definition: ke_i.h:81
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
REFIID LPVOID DWORD dw
Definition: atlbase.h:40
GLbitfield flags
Definition: glext.h:7161
WORD wSecond
Definition: winbase.h:883
WORD wMilliseconds
Definition: winbase.h:884
#define EQ_DOUBLE(a, b)
Definition: vartest.c:67
Definition: oleauto.h:720
GLdouble s
Definition: gl.h:2039
WORD wDay
Definition: winbase.h:880
#define S_OK
Definition: intsafe.h:59
WORD wHour
Definition: winbase.h:881
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint res
Definition: glext.h:9613
USHORT wDayOfYear
Definition: oleauto.h:722
#define ok_(x1, x2)
Definition: atltest.h:61

◆ test_dos2dt()

static void test_dos2dt ( int  line,
WORD  d,
WORD  m,
WORD  y,
WORD  h,
WORD  mn,
WORD  s,
INT  r,
double  dt 
)
static

Definition at line 2154 of file vartest.c.

2156 {
2157  unsigned short dosDate, dosTime;
2158  double out;
2159  INT res;
2160 
2161  out = 0.0;
2162  dosDate = MKDOSDATE(d, m, y);
2163  dosTime = MKDOSTIME(h, mn, s);
2164  res = pDosDateTimeToVariantTime(dosDate, dosTime, &out);
2165  ok_(__FILE__,line)(r == res && (!r || EQ_DOUBLE(out, dt)),
2166  "expected %d, %.16g, got %d, %.16g\n", r, dt, res, out);
2167 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
int32_t INT
Definition: typedefs.h:56
const GLfloat * m
Definition: glext.h:10848
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
Definition: parser.c:48
#define MKDOSDATE(d, m, y)
Definition: vartest.c:2151
#define d
Definition: ke_i.h:81
static FILE * out
Definition: regtests2xml.c:44
#define EQ_DOUBLE(a, b)
Definition: vartest.c:67
GLdouble s
Definition: gl.h:2039
#define MKDOSTIME(h, m, s)
Definition: vartest.c:2152
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint res
Definition: glext.h:9613
#define ok_(x1, x2)
Definition: atltest.h:61

◆ test_DosDateTimeToVariantTime()

static void test_DosDateTimeToVariantTime ( void  )
static

Definition at line 2170 of file vartest.c.

2171 {
2173 
2174  /* Date */
2175  DOS2DT(1,1,1980,0,0,0,1,29221.0); /* 1/1/1980 */
2176  DOS2DT(31,12,2099,0,0,0,1,73050.0); /* 31/12/2099 */
2177  /* Dates are limited to the dos date max of 31/12/2099 */
2178  DOS2DT(31,12,2100,0,0,0,0,0.0); /* 31/12/2100 */
2179  /* Days and months of 0 cause date to roll back 1 day or month */
2180  DOS2DT(0,1,1980,0,0,0,1,29220.0); /* 0 Day => 31/12/1979 */
2181  DOS2DT(1,0,1980,0,0,0,1,29190.0); /* 0 Mth => 1/12/1979 */
2182  DOS2DT(0,0,1980,0,0,0,1,29189.0); /* 0 D/M => 30/11/1979 */
2183  /* Days > days in the month cause date to roll forward 1 month */
2184  DOS2DT(29,2,1981,0,0,0,1,29646.0); /* 29/2/1981 -> 3/1/1980 */
2185  DOS2DT(30,2,1981,0,0,0,1,29647.0); /* 30/2/1981 -> 4/1/1980 */
2186  /* Takes leap years into account when rolling forward */
2187  DOS2DT(29,2,1980,0,0,0,1,29280.0); /* 2/29/1980 */
2188  /* Months > 12 cause an error */
2189  DOS2DT(2,13,1980,0,0,0,0,0.0);
2190 
2191  /* Time */
2192  DOS2DT(1,1,1980,0,0,29,1,29221.00032407407); /* 1/1/1980 12:00:28 AM */
2193  DOS2DT(1,1,1980,0,0,31,1,29221.00034722222); /* 1/1/1980 12:00:30 AM */
2194  DOS2DT(1,1,1980,0,59,0,1,29221.04097222222); /* 1/1/1980 12:59:00 AM */
2195  DOS2DT(1,1,1980,0,60,0,0,0.0); /* Invalid minutes */
2196  DOS2DT(1,1,1980,0,0,60,0,0.0); /* Invalid seconds */
2197  DOS2DT(1,1,1980,23,0,0,1,29221.95833333333); /* 1/1/1980 11:00:00 PM */
2198  DOS2DT(1,1,1980,24,0,0,0,0.0); /* Invalid hours */
2199 
2200  DOS2DT(1,1,1980,0,0,1,1,29221.0);
2201  DOS2DT(2,1,1980,0,0,0,1,29222.0);
2202  DOS2DT(2,1,1980,0,0,0,1,29222.0);
2203  DOS2DT(31,12,1990,0,0,0,1,33238.0);
2204  DOS2DT(31,12,90,0,0,0,1,40543.0);
2205  DOS2DT(30,12,1899,0,0,0,1,46751.0);
2206  DOS2DT(1,1,100,0,0,0,1,43831.0);
2207  DOS2DT(31,12,9999,0,0,0,1,59901.0);
2208  DOS2DT(1,1,10000,0,0,0,1,59902.0);
2209  DOS2DT(1,1,-10000,0,0,0,1,48214.0);
2210 
2211  DOS2DT(30,12,1899,0,0,0,1,46751.0);
2212  DOS2DT(30,12,1899,0,0,1,1,46751.0);
2213 
2214  DOS2DT(1,1,1980,18,1,16,1,29221.75087962963);
2215  DOS2DT(1,300,1980,18,1,16,1,29556.75087962963);
2216  DOS2DT(300,1,1980,18,1,16,1,29232.75087962963);
2217  DOS2DT(0,1,1980,42,1,16,1,29220.4175462963);
2218  DOS2DT(1,1,1980,17,61,16,0,0.0);
2219  DOS2DT(1,1,1980,18,0,76,1,29221.75013888889);
2220  DOS2DT(1,-300,1980,18,1,16,1,29312.75087962963);
2221  DOS2DT(-300,1,1980,18,1,16,1,29240.75087962963);
2222  DOS2DT(3,1,1980,-30,1,16,1,29223.08421296296);
2223  DOS2DT(1,1,1980,20,-119,16,1,29221.83976851852);
2224  DOS2DT(1,1,1980,18,3,-104,1,29221.75236111111);
2225  DOS2DT(1,12001,-1020,18,1,16,1,55519.75087962963);
2226  DOS2DT(1,-23,1982,18,1,16,1,30195.75087962963);
2227  DOS2DT(-59,3,1980,18,1,16,1,29285.75087962963);
2228  DOS2DT(1,1,0,0,0,0,1,54058.0);
2229  DOS2DT(0,0,1980,0,0,0,1,29189.0);
2230  DOS2DT(0,1,1980,0,0,0,1,29220.0);
2231  DOS2DT(-1,1,1980,18,1,16,1,29251.75087962963);
2232  DOS2DT(1,1,-1,18,1,16,1,53693.75087962963);
2233  DOS2DT(1,-1,1980,18,1,16,0,0);
2234 }
#define DOS2DT(d, m, y, h, mn, s, r, dt)
Definition: vartest.c:2168
#define CHECKPTR(func)
Definition: vartest.c:58
INT WINAPI DosDateTimeToVariantTime(USHORT wDosDate, USHORT wDosTime, double *pDateOut)
Definition: variant.c:1214

Referenced by START_TEST().

◆ test_dt2dos()

static void test_dt2dos ( int  line,
double  dt,
INT  r,
WORD  d,
WORD  m,
WORD  y,
WORD  h,
WORD  mn,
WORD  s 
)
static

Definition at line 2236 of file vartest.c.

2238 {
2239  unsigned short dosDate, dosTime, expDosDate, expDosTime;
2240  INT res;
2241 
2242  dosTime = dosDate = 0;
2243  expDosDate = MKDOSDATE(d,m,y);
2244  expDosTime = MKDOSTIME(h,mn,s);
2245  res = pVariantTimeToDosDateTime(dt, &dosDate, &dosTime);
2246  ok_(__FILE__,line)(r == res && (!r || (dosTime == expDosTime && dosDate == expDosDate)),
2247  "%g: expected %d,%d(%d/%d/%d),%d(%d:%d:%d) got %d,%d(%d/%d/%d),%d(%d:%d:%d)\n",
2248  dt, r, expDosDate, expDosDate & 0x1f,
2249  (expDosDate >> 5) & 0xf, 1980 + (expDosDate >> 9),
2250  expDosTime, expDosTime >> 11, (expDosTime >> 5) & 0x3f,
2251  (expDosTime & 0x1f),
2252  res, dosDate, dosDate & 0x1f, (dosDate >> 5) & 0xf,
2253  1980 + (dosDate >> 9), dosTime, dosTime >> 11,
2254  (dosTime >> 5) & 0x3f, (dosTime & 0x1f));
2255 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
int32_t INT
Definition: typedefs.h:56
const GLfloat * m
Definition: glext.h:10848
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
Definition: parser.c:48
#define MKDOSDATE(d, m, y)
Definition: vartest.c:2151
#define d
Definition: ke_i.h:81
GLdouble s
Definition: gl.h:2039
#define MKDOSTIME(h, m, s)
Definition: vartest.c:2152
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint res
Definition: glext.h:9613
#define ok_(x1, x2)
Definition: atltest.h:61

◆ test_dt2st()

static void test_dt2st ( int  line,
double  dt,
INT  r,
WORD  d,
WORD  m,
WORD  y,
WORD  h,
WORD  mn,
WORD  s,
WORD  ms 
)
static

Definition at line 2125 of file vartest.c.

2127 {
2128  SYSTEMTIME st;
2129  INT res;
2130 
2131  memset(&st, 0, sizeof(st));
2132  res = pVariantTimeToSystemTime(dt, &st);
2133  ok_(__FILE__,line)(r == res &&
2134  (!r || (st.wYear == y && st.wMonth == m && st.wDay == d &&
2135  st.wHour == h && st.wMinute == mn &&
2136  st.wSecond == s && st.wMilliseconds == ms)),
2137  "%.16g expected %d, %d,%d,%d,%d,%d,%d,%d, got %d, %d,%d,%d,%d,%d,%d,%d\n",
2138  dt, r, d, m, y, h, mn, s, ms, res, st.wDay, st.wMonth,
2139  st.wYear, st.wHour, st.wMinute, st.wSecond,
2140  st.wMilliseconds);
2141 }
WORD wMonth
Definition: winbase.h:878
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
int32_t INT
Definition: typedefs.h:56
const GLfloat * m
Definition: glext.h:10848
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
WORD wYear
Definition: winbase.h:877
WORD wMinute
Definition: winbase.h:882
Definition: parser.c:48
#define d
Definition: ke_i.h:81
WORD wSecond
Definition: winbase.h:883
WORD wMilliseconds
Definition: winbase.h:884
GLdouble s
Definition: gl.h:2039
WORD wDay
Definition: winbase.h:880
WORD wHour
Definition: winbase.h:881
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint res
Definition: glext.h:9613
#define memset(x, y, z)
Definition: compat.h:39
#define ok_(x1, x2)
Definition: atltest.h:61

◆ test_Mod()

static void test_Mod ( int  line,
VARIANT left,
VARIANT right,
VARIANT expected,
HRESULT  expres 
)
static

Definition at line 2734 of file vartest.c.

2735 {
2736  VARIANT result;
2737  HRESULT hres;
2738 
2739  memset( &result, 0, sizeof(result) );
2740  hres = pVarMod( left, right, &result );
2741  ok_(__FILE__,line)( hres == expres, "wrong result %x/%x\n", hres, expres );
2742  if (hres == S_OK)
2743  ok_(__FILE__,line)( is_expected_variant( &result, expected ),
2744  "got %s expected %s\n", variantstr(&result), variantstr(expected) );
2745 }
static BOOL is_expected_variant(const VARIANT *result, const VARIANT *expected)
Definition: vartest.c:585
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLint left
Definition: glext.h:7726
static const char * variantstr(const VARIANT *var)
Definition: vartest.c:546
GLdouble GLdouble right
Definition: glext.h:10859
#define S_OK
Definition: intsafe.h:59
GLuint64EXT * result
Definition: glext.h:11304
#define memset(x, y, z)
Definition: compat.h:39
BOOL expected
Definition: store.c:2063
#define ok_(x1, x2)
Definition: atltest.h:61

◆ test_Round()

static void test_Round ( int  line,
VARIANT arg,
int  deci,
VARIANT expected 
)
static

Definition at line 3595 of file vartest.c.

3596 {
3597  VARIANT result;
3598  HRESULT hres;
3599 
3600  memset( &result, 0, sizeof(result) );
3601  hres = pVarRound( arg, deci, &result );
3602  ok_(__FILE__,line)( hres == S_OK, "wrong result %x\n", hres );
3603  if (hres == S_OK)
3604  ok_(__FILE__,line)( is_expected_variant( &result, expected ),
3605  "got %s expected %s\n", variantstr(&result), variantstr(expected) );
3606 }
static BOOL is_expected_variant(const VARIANT *result, const VARIANT *expected)
Definition: vartest.c:585
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static const char * variantstr(const VARIANT *var)
Definition: vartest.c:546
#define S_OK
Definition: intsafe.h:59
GLuint64EXT * result
Definition: glext.h:11304
#define memset(x, y, z)
Definition: compat.h:39
BOOL expected
Definition: store.c:2063
#define ok_(x1, x2)
Definition: atltest.h:61

◆ test_st2dt()

static void test_st2dt ( int  line,
WORD  d,
WORD  m,
WORD  y,
WORD  h,
WORD  mn,
WORD  s,
WORD  ms,
INT  r,
double  dt 
)
static

Definition at line 2087 of file vartest.c.

2089 {
2090  SYSTEMTIME st;
2091  double out;
2092  INT res;
2093 
2094  st.wYear = y;
2095  st.wMonth = m;
2096  st.wDay = d;
2097  st.wHour = h;
2098  st.wMinute = mn;
2099  st.wSecond = s;
2100  st.wMilliseconds = ms;
2101  st.wDayOfWeek = 0;
2102  res = pSystemTimeToVariantTime(&st, &out);
2103  ok_(__FILE__,line)(r == res && (!r || EQ_DOUBLE(out, dt)),
2104  "expected %d, %.16g, got %d, %.16g\n", r, dt, res, out);
2105 }
WORD wMonth
Definition: winbase.h:878
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
WORD wDayOfWeek
Definition: winbase.h:879
int32_t INT
Definition: typedefs.h:56
const GLfloat * m
Definition: glext.h:10848
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
WORD wYear
Definition: winbase.h:877
WORD wMinute
Definition: winbase.h:882
Definition: parser.c:48
#define d
Definition: ke_i.h:81
static FILE * out
Definition: regtests2xml.c:44
WORD wSecond
Definition: winbase.h:883
WORD wMilliseconds
Definition: winbase.h:884
#define EQ_DOUBLE(a, b)
Definition: vartest.c:67
GLdouble s
Definition: gl.h:2039
WORD wDay
Definition: winbase.h:880
WORD wHour
Definition: winbase.h:881
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint res
Definition: glext.h:9613
#define ok_(x1, x2)
Definition: atltest.h:61

◆ test_SystemTimeToVariantTime()

static void test_SystemTimeToVariantTime ( void  )
static

Definition at line 2108 of file vartest.c.

2109 {
2111  ST2DT(1,1,1980,0,0,0,0,TRUE,29221.0);
2112  ST2DT(2,1,1980,0,0,0,0,TRUE,29222.0);
2113  ST2DT(0,1,1980,0,0,0,0,TRUE,29220.0); /* Rolls back to 31 Dec 1899 */
2114  ST2DT(1,13,1980,0,0,0,0,FALSE,29587.0); /* Fails on invalid month */
2115  ST2DT(32,1,1980,0,0,0,0,FALSE,0.0); /* Fails on invalid day */
2116  ST2DT(1,1,-1,0,0,0,0,FALSE,0.0); /* Fails on invalid year */
2117  ST2DT(1,1,10000,0,0,0,0,FALSE,0.0); /* Fails on invalid year */
2118  ST2DT(1,1,9999,0,0,0,0,TRUE,2958101.0); /* 9999 is last valid year */
2119  ST2DT(31,12,90,0,0,0,0,TRUE,33238.0); /* 30 <= year < 100 is 1900+year */
2120  ST2DT(1,1,30,0,0,0,0,TRUE,10959.0); /* 30 <= year < 100 is 1900+year */
2121  ST2DT(1,1,29,0,0,0,0,TRUE,47119.0); /* 0 <= year < 30 is 2000+year */
2122  ST2DT(1,1,0,0,0,0,0,TRUE,36526.0); /* 0 <= year < 30 is 2000+year */
2123 }
#define TRUE
Definition: types.h:120
#define ST2DT(d, m, y, h, mn, s, ms, r, dt)
Definition: vartest.c:2106
#define CHECKPTR(func)
Definition: vartest.c:58
INT WINAPI SystemTimeToVariantTime(LPSYSTEMTIME lpSt, double *pDateOut)
Definition: variant.c:1289

Referenced by START_TEST().

◆ test_UdateFromDate()

static void test_UdateFromDate ( int  line,
DATE  dt,
ULONG  flags,
HRESULT  r,
WORD  d,
WORD  m,
WORD  y,
WORD  h,
WORD  mn,
WORD  s,
WORD  ms,
WORD  dw,
WORD  dy 
)
static

Definition at line 1958 of file vartest.c.

1960 {
1961  UDATE ud;
1962  HRESULT res;
1963 
1964  memset(&ud, 0, sizeof(ud));
1965  res = pVarUdateFromDate(dt, flags, &ud);
1966  ok_(__FILE__,line)(r == res && (res != S_OK || (ud.st.wYear == y && ud.st.wMonth == m && ud.st.wDay == d &&
1967  ud.st.wHour == h && ud.st.wMinute == mn && ud.st.wSecond == s &&
1968  ud.st.wMilliseconds == ms && ud.st.wDayOfWeek == dw && ud.wDayOfYear == dy)),
1969  "%.16g expected res(%x) %d,%d,%d,%d,%d,%d,%d %d %d, got res(%x) %d,%d,%d,%d,%d,%d,%d %d %d\n",
1970  dt, r, d, m, y, h, mn, s, ms, dw, dy,
1971  res, ud.st.wDay, ud.st.wMonth, ud.st.wYear, ud.st.wHour, ud.st.wMinute,
1972  ud.st.wSecond, ud.st.wMilliseconds, ud.st.wDayOfWeek, ud.wDayOfYear );
1973 }
SYSTEMTIME st
Definition: oleauto.h:721
WORD wMonth
Definition: winbase.h:878
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
WORD wDayOfWeek
Definition: winbase.h:879
GLint dy
Definition: linetemp.h:97
const GLfloat * m
Definition: glext.h:10848
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
WORD wYear
Definition: winbase.h:877
WORD wMinute
Definition: winbase.h:882
Definition: parser.c:48
#define d
Definition: ke_i.h:81
LONG HRESULT
Definition: typedefs.h:77
REFIID LPVOID DWORD dw
Definition: atlbase.h:40
GLbitfield flags
Definition: glext.h:7161
WORD wSecond
Definition: winbase.h:883
WORD wMilliseconds
Definition: winbase.h:884
Definition: oleauto.h:720
GLdouble s
Definition: gl.h:2039
WORD wDay
Definition: winbase.h:880
#define S_OK
Definition: intsafe.h:59
WORD wHour
Definition: winbase.h:881
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint res
Definition: glext.h:9613
#define memset(x, y, z)
Definition: compat.h:39
USHORT wDayOfYear
Definition: oleauto.h:722
#define ok_(x1, x2)
Definition: atltest.h:61

◆ test_var_call1()

static void test_var_call1 ( int  line,
HRESULT(WINAPI *func)(LPVARIANT, LPVARIANT ,
VARIANT arg,
VARIANT expected 
)
static

Definition at line 626 of file vartest.c.

628 {
629  VARIANT old_arg = *arg;
630  VARIANT result;
631  HRESULT hres;
632 
633  memset( &result, 0, sizeof(result) );
634  hres = func( arg, &result );
635  ok_(__FILE__,line)( hres == S_OK, "wrong result %x\n", hres );
636  if (hres == S_OK)
637  ok_(__FILE__,line)( is_expected_variant( &result, expected ),
638  "got %s expected %s\n", variantstr(&result), variantstr(expected) );
639  ok_(__FILE__,line)( is_expected_variant( arg, &old_arg ), "Modified argument %s / %s\n",
640  variantstr(&old_arg), variantstr(arg));
641  VariantClear( &result );
642 }
GLenum func
Definition: glext.h:6028
static BOOL is_expected_variant(const VARIANT *result, const VARIANT *expected)
Definition: vartest.c:585
void * arg
Definition: msvc.h:12
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static const char * variantstr(const VARIANT *var)
Definition: vartest.c:546
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define S_OK
Definition: intsafe.h:59
GLuint64EXT * result
Definition: glext.h:11304
#define memset(x, y, z)
Definition: compat.h:39
BOOL expected
Definition: store.c:2063
#define ok_(x1, x2)
Definition: atltest.h:61

◆ test_var_call2()

static void test_var_call2 ( int  line,
HRESULT(WINAPI *func)(LPVARIANT, LPVARIANT, LPVARIANT ,
VARIANT left,
VARIANT right,
VARIANT expected 
)
static

Definition at line 644 of file vartest.c.

646 {
647  VARIANT old_left = *left, old_right = *right;
648  VARIANT result;
649  HRESULT hres;
650 
651  memset( &result, 0, sizeof(result) );
652  hres = func( left, right, &result );
653  ok_(__FILE__,line)( hres == S_OK, "wrong result %x\n", hres );
654  if (hres == S_OK)
655  ok_(__FILE__,line)( is_expected_variant( &result, expected ),
656  "got %s expected %s\n", variantstr(&result), variantstr(expected) );
657  ok_(__FILE__,line)( is_expected_variant( left, &old_left ), "Modified left argument %s / %s\n",
658  variantstr(&old_left), variantstr(left));
659  ok_(__FILE__,line)( is_expected_variant( right, &old_right ), "Modified right argument %s / %s\n",
660  variantstr(&old_right), variantstr(right));
661  VariantClear( &result );
662 }
GLenum func
Definition: glext.h:6028
static BOOL is_expected_variant(const VARIANT *result, const VARIANT *expected)
Definition: vartest.c:585
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLint left
Definition: glext.h:7726
static const char * variantstr(const VARIANT *var)
Definition: vartest.c:546
GLdouble GLdouble right
Definition: glext.h:10859
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define S_OK
Definition: intsafe.h:59
GLuint64EXT * result
Definition: glext.h:11304
#define memset(x, y, z)
Definition: compat.h:39
BOOL expected
Definition: store.c:2063
#define ok_(x1, x2)
Definition: atltest.h:61

◆ test_VarAbs()

static void test_VarAbs ( void  )
static

Definition at line 2282 of file vartest.c.

2283 {
2284  static WCHAR szNum[] = {'-','1','.','1','\0' };
2285  char buff[8];
2286  HRESULT hres;
2287  VARIANT v, vDst, exp;
2288  size_t i;
2289 
2290  CHECKPTR(VarAbs);
2291 
2292  /* Test all possible V_VT values.
2293  */
2294  for (i = 0; i < ARRAY_SIZE(ExtraFlags); i++)
2295  {
2296  VARTYPE vt;
2297 
2298  for (vt = 0; vt <= VT_BSTR_BLOB; vt++)
2299  {
2300  HRESULT hExpected = DISP_E_BADVARTYPE;
2301 
2302  SKIPTESTS(vt);
2303 
2304  memset(&v, 0, sizeof(v));
2305  V_VT(&v) = vt | ExtraFlags[i];
2306  V_VT(&vDst) = VT_EMPTY;
2307 
2308  hres = pVarAbs(&v,&vDst);
2309  if (ExtraFlags[i] & VT_ARRAY ||
2310  (!ExtraFlags[i] && (vt == VT_UNKNOWN || vt == VT_BSTR ||
2311  vt == VT_DISPATCH || vt == VT_ERROR || vt == VT_RECORD)))
2312  {
2313  hExpected = DISP_E_TYPEMISMATCH;
2314  }
2315  else if (ExtraFlags[i] || vt >= VT_CLSID || vt == VT_VARIANT)
2316  {
2317  hExpected = DISP_E_BADVARTYPE;
2318  }
2319  else if (IsValidVariantClearVT(vt, ExtraFlags[i]))
2320  hExpected = S_OK;
2321 
2322  /* Native always fails on some vartypes that should be valid. don't
2323  * check that Wine does the same; these are bugs in native.
2324  */
2325  if (vt == VT_I8 || vt == VT_UI8 || vt == VT_INT || vt == VT_UINT ||
2326  vt == VT_I1 || vt == VT_UI2 || vt == VT_UI4)
2327  continue;
2328  ok(hres == hExpected, "VarAbs: expected 0x%X, got 0x%X for vt %d | 0x%X\n",
2329  hExpected, hres, vt, ExtraFlags[i]);
2330  }
2331  }
2332 
2333  /* BOOL->I2, BSTR->R8, all others remain the same */
2334  VARABS(BOOL,VARIANT_TRUE,I2,-VARIANT_TRUE);
2335  VARABS(BOOL,VARIANT_FALSE,I2,VARIANT_FALSE);
2336  VARABS(EMPTY,0,I2,0);
2337  VARABS(EMPTY,1,I2,0);
2338  VARABS(NULL,0,NULL,0);
2339  VARABS(NULL,1,NULL,0);
2340  VARABS(I2,1,I2,1);
2341  VARABS(I2,-1,I2,1);
2342  VARABS(I4,1,I4,1);
2343  VARABS(I4,-1,I4,1);
2344  VARABS(UI1,1,UI1,1);
2345  VARABS(R4,1,R4,1);
2346  VARABS(R4,-1,R4,1);
2347  VARABS(R8,1,R8,1);
2348  VARABS(R8,-1,R8,1);
2349  VARABS(DATE,1,DATE,1);
2350  VARABS(DATE,-1,DATE,1);
2351  V_VT(&v) = VT_CY;
2352  V_CY(&v).int64 = -10000;
2353  memset(&vDst,0,sizeof(vDst));
2354  hres = pVarAbs(&v,&vDst);
2355  ok(hres == S_OK && V_VT(&vDst) == VT_CY && V_CY(&vDst).int64 == 10000,
2356  "VarAbs(CY): expected 0x0 got 0x%X\n", hres);
2358  if (buff[1])
2359  {
2360  trace("Skipping VarAbs(BSTR) as decimal separator is '%s'\n", buff);
2361  return;
2362  } else {
2363  szNum[2] = buff[0];
2364  }
2365  V_VT(&v) = VT_BSTR;
2366  V_BSTR(&v) = (BSTR)szNum;
2367  memset(&vDst,0,sizeof(vDst));
2368  hres = pVarAbs(&v,&vDst);
2369  ok(hres == S_OK && V_VT(&vDst) == VT_R8 && V_R8(&vDst) == 1.1,
2370  "VarAbs: expected 0x0,%d,%g, got 0x%X,%d,%g\n", VT_R8, 1.1, hres, V_VT(&vDst), V_R8(&vDst));
2371 }
Definition: compat.h:1963
Definition: compat.h:1959
#define EMPTY(rect)
Definition: text.c:32
INT WINAPI GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
Definition: lang.c:1018
#define LOCALE_USER_DEFAULT
#define V_R8(A)
Definition: oleauto.h:262
double DATE
Definition: compat.h:1902
OLECHAR * BSTR
Definition: compat.h:1942
long long int64
Definition: platform.h:13
HRESULT WINAPI VarAbs(LPVARIANT pVarIn, LPVARIANT pVarOut)
Definition: variant.c:4266
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 V_CY(A)
Definition: oleauto.h:229
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define LOCALE_SDECIMAL
Definition: winnls.h:42
#define SKIPTESTS(a)
Definition: vartest.c:70
#define CHECKPTR(func)
Definition: vartest.c:58
#define DISP_E_TYPEMISMATCH
Definition: winerror.h:2514
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
static BOOL IsValidVariantClearVT(VARTYPE vt, VARTYPE extraFlags)
Definition: vartest.c:710
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
static const VARTYPE ExtraFlags[16]
Definition: vartest.c:689
#define DISP_E_BADVARTYPE
Definition: winerror.h:2517
#define V_VT(A)
Definition: oleauto.h:211
Definition: compat.h:1950
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
#define R4(v, w, x, y, z, i)
Definition: sha1.c:39
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
unsigned short VARTYPE
Definition: compat.h:1903
DWORD exp
Definition: msg.c:15681
#define memset(x, y, z)
Definition: compat.h:39
static unsigned char buff[32768]
Definition: fatten.c:17
Definition: compat.h:1949
#define VARABS(vt, val, rvt, rval)
Definition: vartest.c:2277

Referenced by START_TEST().

◆ test_VarAdd()

static void test_VarAdd ( void  )
static

Definition at line 5556 of file vartest.c.

5557 {
5558  VARIANT left, right, exp, result, cy, dec;
5559  VARTYPE i;
5560  BSTR lbstr, rbstr;
5561  HRESULT hres;
5562  double r;
5563 
5564  CHECKPTR(VarAdd);
5565 
5566  lbstr = SysAllocString(sz12);
5567  rbstr = SysAllocString(sz12);
5568 
5569  /* Test all possible flag/vt combinations & the resulting vt type */
5570  for (i = 0; i < ARRAY_SIZE(ExtraFlags); i++)
5571  {
5572  VARTYPE leftvt, rightvt, resvt;
5573 
5574  for (leftvt = 0; leftvt <= VT_BSTR_BLOB; leftvt++)
5575  {
5576 
5577  SKIPTESTS(leftvt);
5578 
5579  for (rightvt = 0; rightvt <= VT_BSTR_BLOB; rightvt++)
5580  {
5581  BOOL bFail = FALSE;
5582 
5583  SKIPTESTS(rightvt);
5584 
5585  if (leftvt == VT_UNKNOWN || rightvt == VT_UNKNOWN)
5586  continue;
5587 
5588  memset(&left, 0, sizeof(left));
5589  memset(&right, 0, sizeof(right));
5590  V_VT(&left) = leftvt | ExtraFlags[i];
5591  if (leftvt == VT_BSTR)
5592  V_BSTR(&left) = lbstr;
5593  V_VT(&right) = rightvt | ExtraFlags[i];
5594  if (rightvt == VT_BSTR)
5595  V_BSTR(&right) = rbstr;
5596  V_VT(&result) = VT_EMPTY;
5597  resvt = VT_ERROR;
5598 
5599  /* Don't ask me why but native VarAdd cannot handle:
5600  VT_I1, VT_UI2, VT_UI4, VT_INT, VT_UINT and VT_UI8.
5601  Tested with DCOM98, Win2k, WinXP */
5602  if (ExtraFlags[i] & VT_ARRAY || ExtraFlags[i] & VT_BYREF ||
5603  !IsValidVariantClearVT(leftvt, ExtraFlags[i]) ||
5604  !IsValidVariantClearVT(rightvt, ExtraFlags[i]) ||
5605  leftvt == VT_CLSID || rightvt == VT_CLSID ||
5606  leftvt == VT_RECORD || rightvt == VT_RECORD ||
5607  leftvt == VT_VARIANT || rightvt == VT_VARIANT ||
5608  leftvt == VT_ERROR || rightvt == VT_ERROR ||
5609  leftvt == VT_I1 || rightvt == VT_I1 ||
5610  leftvt == VT_UI2 || rightvt == VT_UI2 ||
5611  leftvt == VT_UI4 || rightvt == VT_UI4 ||
5612  leftvt == VT_UI8 || rightvt == VT_UI8 ||
5613  leftvt == VT_INT || rightvt == VT_INT ||
5614  leftvt == VT_UINT || rightvt == VT_UINT) {
5615  bFail = TRUE;
5616  }
5617 
5618  if (leftvt == VT_NULL || rightvt == VT_NULL)
5619  resvt = VT_NULL;
5620  else if (leftvt == VT_DISPATCH || rightvt == VT_DISPATCH)
5621  bFail = TRUE;
5622  else if (leftvt == VT_DECIMAL || rightvt == VT_DECIMAL)
5623  resvt = VT_DECIMAL;
5624  else if (leftvt == VT_DATE || rightvt == VT_DATE)
5625  resvt = VT_DATE;
5626  else if (leftvt == VT_CY || rightvt == VT_CY)
5627  resvt = VT_CY;
5628  else if (leftvt == VT_R8 || rightvt == VT_R8)
5629  resvt = VT_R8;
5630  else if (leftvt == VT_BSTR || rightvt == VT_BSTR) {
5631  if ((leftvt == VT_BSTR && rightvt == VT_BSTR) ||
5632  leftvt == VT_EMPTY || rightvt == VT_EMPTY)
5633  resvt = VT_BSTR;
5634  else
5635  resvt = VT_R8;
5636  } else if (leftvt == VT_R4 || rightvt == VT_R4) {
5637  if (leftvt == VT_I4 || rightvt == VT_I4 ||
5638  leftvt == VT_I8 || rightvt ==