Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2f8fa39d
Commit
2f8fa39d
authored
Aug 11, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.applicationmodel/tests: Add some IPackageManager tests.
parent
04c26b45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
0 deletions
+81
-0
model.c
dlls/windows.applicationmodel/tests/model.c
+81
-0
No files found.
dlls/windows.applicationmodel/tests/model.c
View file @
2f8fa39d
...
...
@@ -30,7 +30,11 @@
#define WIDL_using_Windows_Foundation_Collections
#include "windows.foundation.h"
#define WIDL_using_Windows_ApplicationModel
#define WIDL_using_Windows_ApplicationModel_Core
#define WIDL_using_Windows_Management_Deployment
#define WIDL_using_Windows_Storage
#include "windows.applicationmodel.h"
#include "windows.management.deployment.h"
#include "wine/test.h"
...
...
@@ -47,6 +51,82 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid )
IUnknown_Release
(
unk
);
}
static
void
test_PackageManager
(
void
)
{
static
const
WCHAR
*
statics_name
=
RuntimeClass_Windows_Management_Deployment_PackageManager
;
IStorageFolder
*
storage_folder
;
IStorageItem
*
storage_item
;
IActivationFactory
*
factory
;
IIterable_Package
*
packages
;
IPackageManager
*
manager
;
IIterator_Package
*
iter
;
IPackage
*
package
;
HSTRING
str
;
HRESULT
hr
;
LONG
ref
;
hr
=
WindowsCreateString
(
statics_name
,
wcslen
(
statics_name
),
&
str
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
RoGetActivationFactory
(
str
,
&
IID_IActivationFactory
,
(
void
**
)
&
factory
);
WindowsDeleteString
(
str
);
todo_wine
ok
(
hr
==
S_OK
||
broken
(
hr
==
REGDB_E_CLASSNOTREG
),
"got hr %#lx.
\n
"
,
hr
);
if
(
hr
==
REGDB_E_CLASSNOTREG
)
{
todo_wine
win_skip
(
"%s runtimeclass not registered, skipping tests.
\n
"
,
wine_dbgstr_w
(
statics_name
)
);
return
;
}
check_interface
(
factory
,
&
IID_IUnknown
);
check_interface
(
factory
,
&
IID_IInspectable
);
check_interface
(
factory
,
&
IID_IAgileObject
);
hr
=
IActivationFactory_ActivateInstance
(
factory
,
(
IInspectable
**
)
&
manager
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
check_interface
(
manager
,
&
IID_IUnknown
);
check_interface
(
manager
,
&
IID_IInspectable
);
check_interface
(
manager
,
&
IID_IAgileObject
);
check_interface
(
manager
,
&
IID_IPackageManager
);
hr
=
IPackageManager_FindPackages
(
manager
,
&
packages
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
E_ACCESSDENIED
)
/* w8adm */
,
"got hr %#lx.
\n
"
,
hr
);
if
(
broken
(
hr
==
E_ACCESSDENIED
))
{
win_skip
(
"Unable to list packages, skipping package manager tests
\n
"
);
goto
skip_tests
;
}
hr
=
IIterable_Package_First
(
packages
,
&
iter
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
IIterator_Package_get_Current
(
iter
,
&
package
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
IPackage_get_InstalledLocation
(
package
,
&
storage_folder
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
IStorageFolder_QueryInterface
(
storage_folder
,
&
IID_IStorageItem
,
(
void
**
)
&
storage_item
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
IStorageItem_get_Path
(
storage_item
,
&
str
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
WindowsDeleteString
(
str
);
ref
=
IStorageItem_Release
(
storage_item
);
ok
(
ref
==
1
,
"got ref %ld.
\n
"
,
ref
);
ref
=
IStorageFolder_Release
(
storage_folder
);
ok
(
!
ref
,
"got ref %ld.
\n
"
,
ref
);
IPackage_Release
(
package
);
ref
=
IIterator_Package_Release
(
iter
);
ok
(
!
ref
,
"got ref %ld.
\n
"
,
ref
);
ref
=
IIterable_Package_Release
(
packages
);
ok
(
!
ref
,
"got ref %ld.
\n
"
,
ref
);
skip_tests:
ref
=
IPackageManager_Release
(
manager
);
ok
(
!
ref
,
"got ref %ld.
\n
"
,
ref
);
ref
=
IActivationFactory_Release
(
factory
);
ok
(
ref
==
1
,
"got ref %ld.
\n
"
,
ref
);
}
static
void
test_PackageStatics
(
void
)
{
static
const
WCHAR
*
package_statics_name
=
L"Windows.ApplicationModel.Package"
;
...
...
@@ -82,6 +162,7 @@ START_TEST(model)
hr
=
RoInitialize
(
RO_INIT_MULTITHREADED
);
ok
(
hr
==
S_OK
,
"RoInitialize failed, hr %#lx
\n
"
,
hr
);
test_PackageManager
();
test_PackageStatics
();
RoUninitialize
();
...
...
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