Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
96427780
Commit
96427780
authored
Sep 16, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
propsys/tests: Added InitVariantFromGUIDAsString tests.
parent
27ac89ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
1 deletion
+62
-1
Makefile.in
dlls/propsys/tests/Makefile.in
+1
-1
propsys.c
dlls/propsys/tests/propsys.c
+59
-0
propvarutil.h
include/propvarutil.h
+2
-0
No files found.
dlls/propsys/tests/Makefile.in
View file @
96427780
TESTDLL
=
propsys.dll
IMPORTS
=
propsys ole32
IMPORTS
=
propsys ole32
oleaut32
C_SRCS
=
\
propsys.c
...
...
dlls/propsys/tests/propsys.c
View file @
96427780
...
...
@@ -24,10 +24,13 @@
#include <stdarg.h>
#include <stdio.h>
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "propsys.h"
#include "propvarutil.h"
#include "initguid.h"
#include "wine/test.h"
...
...
@@ -46,6 +49,13 @@ static char *show_guid(const GUID *guid, char *buf)
return
buf
;
}
static
int
strcmp_wa
(
LPCWSTR
strw
,
const
char
*
stra
)
{
CHAR
buf
[
512
];
WideCharToMultiByte
(
CP_ACP
,
0
,
strw
,
-
1
,
buf
,
sizeof
(
buf
),
NULL
,
NULL
);
return
lstrcmpA
(
stra
,
buf
);
}
static
void
test_PSStringFromPropertyKey
(
void
)
{
static
const
WCHAR
fillerW
[]
=
{
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
...
...
@@ -450,9 +460,58 @@ static void test_PSRefreshPropertySchema(void)
CoUninitialize
();
}
static
void
test_InitPropVariantFromGUIDAsString
(
void
)
{
PROPVARIANT
propvar
;
VARIANT
var
;
HRESULT
hres
;
int
i
;
const
struct
{
REFGUID
guid
;
const
char
*
str
;
}
testcases
[]
=
{
{
&
IID_NULL
,
"{00000000-0000-0000-0000-000000000000}"
},
{
&
dummy_guid
,
"{DEADBEEF-DEAD-BEEF-DEAD-BEEFCAFEBABE}"
},
};
hres
=
InitPropVariantFromGUIDAsString
(
NULL
,
&
propvar
);
ok
(
hres
==
E_FAIL
,
"InitPropVariantFromGUIDAsString returned %x
\n
"
,
hres
);
if
(
0
)
{
/* Returns strange data on Win7, crashes on older systems */
InitVariantFromGUIDAsString
(
NULL
,
&
var
);
/* Crashes on windows */
InitPropVariantFromGUIDAsString
(
&
IID_NULL
,
NULL
);
InitVariantFromGUIDAsString
(
&
IID_NULL
,
NULL
);
}
for
(
i
=
0
;
i
<
sizeof
(
testcases
)
/
sizeof
(
testcases
[
0
]);
i
++
)
{
memset
(
&
propvar
,
0
,
sizeof
(
PROPVARIANT
));
hres
=
InitPropVariantFromGUIDAsString
(
testcases
[
i
].
guid
,
&
propvar
);
ok
(
hres
==
S_OK
,
"%d) InitPropVariantFromGUIDAsString returned %x
\n
"
,
i
,
hres
);
ok
(
propvar
.
vt
==
VT_LPWSTR
,
"%d) propvar.vt = %d
\n
"
,
i
,
propvar
.
vt
);
ok
(
!
strcmp_wa
(
propvar
.
u
.
pwszVal
,
testcases
[
i
].
str
),
"%d) propvar.u.pwszVal = %s
\n
"
,
i
,
wine_dbgstr_w
(
propvar
.
u
.
pwszVal
));
CoTaskMemFree
(
propvar
.
u
.
pwszVal
);
memset
(
&
var
,
0
,
sizeof
(
VARIANT
));
hres
=
InitVariantFromGUIDAsString
(
testcases
[
i
].
guid
,
&
var
);
ok
(
hres
==
S_OK
,
"%d) InitVariantFromGUIDAsString returned %x
\n
"
,
i
,
hres
);
ok
(
V_VT
(
&
var
)
==
VT_BSTR
,
"%d) V_VT(&var) = %d
\n
"
,
i
,
V_VT
(
&
var
));
ok
(
SysStringLen
(
V_BSTR
(
&
var
))
==
38
,
"SysStringLen returned %d
\n
"
,
SysStringLen
(
V_BSTR
(
&
var
)));
ok
(
!
strcmp_wa
(
V_BSTR
(
&
var
),
testcases
[
i
].
str
),
"%d) V_BSTR(&var) = %s
\n
"
,
i
,
wine_dbgstr_w
(
V_BSTR
(
&
var
)));
VariantClear
(
&
var
);
}
}
START_TEST
(
propsys
)
{
test_PSStringFromPropertyKey
();
test_PSPropertyKeyFromString
();
test_PSRefreshPropertySchema
();
test_InitPropVariantFromGUIDAsString
();
}
include/propvarutil.h
View file @
96427780
...
...
@@ -37,6 +37,8 @@ typedef int PROPVAR_CHANGE_FLAGS;
HRESULT
WINAPI
PropVariantChangeType
(
PROPVARIANT
*
ppropvarDest
,
REFPROPVARIANT
propvarSrc
,
PROPVAR_CHANGE_FLAGS
flags
,
VARTYPE
vt
);
HRESULT
WINAPI
InitPropVariantFromGUIDAsString
(
REFGUID
guid
,
PROPVARIANT
*
ppropvar
);
HRESULT
WINAPI
InitVariantFromGUIDAsString
(
REFGUID
guid
,
VARIANT
*
pvar
);
#ifdef __cplusplus
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment