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
bde60cb9
Commit
bde60cb9
authored
Jun 18, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Add tests for IWbemServices.
parent
9614ddb5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
1 deletion
+94
-1
Makefile.in
dlls/wbemprox/tests/Makefile.in
+2
-1
services.c
dlls/wbemprox/tests/services.c
+92
-0
No files found.
dlls/wbemprox/tests/Makefile.in
View file @
bde60cb9
...
...
@@ -2,6 +2,7 @@ TESTDLL = wbemprox.dll
IMPORTS
=
uuid oleaut32 ole32
C_SRCS
=
\
query.c
query.c
\
services.c
@MAKE_TEST_RULES@
dlls/wbemprox/tests/services.c
0 → 100644
View file @
bde60cb9
/*
* Copyright 2012 Hans Leidekker for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include <stdio.h>
#include "windows.h"
#include "objidl.h"
#include "wbemcli.h"
#include "wine/test.h"
static
void
test_IClientSecurity
(
void
)
{
static
const
WCHAR
rootW
[]
=
{
'R'
,
'O'
,
'O'
,
'T'
,
'\\'
,
'C'
,
'I'
,
'M'
,
'V'
,
'2'
,
0
};
HRESULT
hr
;
IWbemLocator
*
locator
;
IWbemServices
*
services
;
IClientSecurity
*
security
;
BSTR
path
=
SysAllocString
(
rootW
);
ULONG
refs
;
hr
=
CoCreateInstance
(
&
CLSID_WbemLocator
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWbemLocator
,
(
void
**
)
&
locator
);
if
(
hr
!=
S_OK
)
{
win_skip
(
"can't create instance of WbemLocator
\n
"
);
return
;
}
ok
(
hr
==
S_OK
,
"failed to create IWbemLocator interface %08x
\n
"
,
hr
);
refs
=
IWbemLocator_Release
(
locator
);
ok
(
refs
==
0
,
"unexpected refcount %u
\n
"
,
refs
);
hr
=
CoCreateInstance
(
&
CLSID_WbemLocator
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWbemLocator
,
(
void
**
)
&
locator
);
ok
(
hr
==
S_OK
,
"failed to create IWbemLocator interface %08x
\n
"
,
hr
);
hr
=
IWbemLocator_ConnectServer
(
locator
,
path
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
NULL
,
&
services
);
ok
(
hr
==
S_OK
,
"failed to get IWbemServices interface %08x
\n
"
,
hr
);
refs
=
IWbemServices_Release
(
services
);
ok
(
refs
==
0
,
"unexpected refcount %u
\n
"
,
refs
);
hr
=
IWbemLocator_ConnectServer
(
locator
,
path
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
NULL
,
&
services
);
ok
(
hr
==
S_OK
,
"failed to get IWbemServices interface %08x
\n
"
,
hr
);
hr
=
IWbemServices_QueryInterface
(
services
,
&
IID_IClientSecurity
,
(
void
**
)
&
security
);
ok
(
hr
==
S_OK
,
"failed to query IClientSecurity interface %08x
\n
"
,
hr
);
ok
(
(
void
*
)
services
!=
(
void
*
)
security
,
"expected pointers to be different
\n
"
);
refs
=
IClientSecurity_Release
(
security
);
ok
(
refs
==
1
,
"unexpected refcount %u
\n
"
,
refs
);
refs
=
IWbemServices_Release
(
services
);
ok
(
refs
==
0
,
"unexpected refcount %u
\n
"
,
refs
);
hr
=
IWbemLocator_ConnectServer
(
locator
,
path
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
NULL
,
&
services
);
ok
(
hr
==
S_OK
,
"failed to get IWbemServices interface %08x
\n
"
,
hr
);
hr
=
IWbemServices_QueryInterface
(
services
,
&
IID_IClientSecurity
,
(
void
**
)
&
security
);
ok
(
hr
==
S_OK
,
"failed to query IClientSecurity interface %08x
\n
"
,
hr
);
ok
(
(
void
*
)
services
!=
(
void
*
)
security
,
"expected pointers to be different
\n
"
);
refs
=
IWbemServices_Release
(
services
);
todo_wine
ok
(
refs
==
1
,
"unexpected refcount %u
\n
"
,
refs
);
refs
=
IWbemServices_Release
(
security
);
todo_wine
ok
(
refs
==
0
,
"unexpected refcount %u
\n
"
,
refs
);
IWbemLocator_Release
(
locator
);
SysFreeString
(
path
);
}
START_TEST
(
services
)
{
CoInitialize
(
NULL
);
test_IClientSecurity
();
CoUninitialize
();
}
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