Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
55ad9da9
Commit
55ad9da9
authored
11 years ago
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
taskschd/tests: Add some tests for ITaskService::Connect.
parent
6da6f186
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+1
-0
1 addition, 0 deletions
configure
configure.ac
+1
-0
1 addition, 0 deletions
configure.ac
dlls/taskschd/tests/Makefile.in
+5
-0
5 additions, 0 deletions
dlls/taskschd/tests/Makefile.in
dlls/taskschd/tests/scheduler.c
+118
-0
118 additions, 0 deletions
dlls/taskschd/tests/scheduler.c
with
125 additions
and
0 deletions
configure
+
1
−
0
View file @
55ad9da9
...
...
@@ -17068,6 +17068,7 @@ wine_fn_config_dll system.drv16 enable_win16
wine_fn_config_dll t2embed enable_t2embed
wine_fn_config_dll tapi32 enable_tapi32 implib
wine_fn_config_dll taskschd enable_taskschd clean
wine_fn_config_test dlls/taskschd/tests taskschd_test
wine_fn_config_dll toolhelp.dll16 enable_win16
wine_fn_config_dll traffic enable_traffic
wine_fn_config_dll twain.dll16 enable_win16
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
1
−
0
View file @
55ad9da9
...
...
@@ -3121,6 +3121,7 @@ WINE_CONFIG_DLL(system.drv16,enable_win16)
WINE_CONFIG_DLL(t2embed)
WINE_CONFIG_DLL(tapi32,,[implib])
WINE_CONFIG_DLL(taskschd,,[clean])
WINE_CONFIG_TEST(dlls/taskschd/tests)
WINE_CONFIG_DLL(toolhelp.dll16,enable_win16)
WINE_CONFIG_DLL(traffic)
WINE_CONFIG_DLL(twain.dll16,enable_win16)
...
...
This diff is collapsed.
Click to expand it.
dlls/taskschd/tests/Makefile.in
0 → 100644
+
5
−
0
View file @
55ad9da9
TESTDLL
=
taskschd.dll
IMPORTS
=
oleaut32 ole32
C_SRCS
=
\
scheduler.c
This diff is collapsed.
Click to expand it.
dlls/taskschd/tests/scheduler.c
0 → 100644
+
118
−
0
View file @
55ad9da9
/*
* Copyright 2014 Dmitry Timoshkov
*
* 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
*/
#include
<stdarg.h>
#define COBJMACROS
#include
"windef.h"
#include
"winbase.h"
#include
"initguid.h"
#include
"objbase.h"
#include
"taskschd.h"
#include
<wine/test.h>
static
void
test_Connect
(
void
)
{
static
const
WCHAR
deadbeefW
[]
=
{
'd'
,
'e'
,
'a'
,
'd'
,
'b'
,
'e'
,
'e'
,
'f'
,
0
};
WCHAR
comp_name
[
MAX_COMPUTERNAME_LENGTH
+
1
];
DWORD
len
;
HRESULT
hr
;
BSTR
bstr
;
VARIANT
v_null
,
v_comp
;
VARIANT_BOOL
vbool
;
ITaskService
*
service
;
hr
=
CoCreateInstance
(
&
CLSID_TaskScheduler
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_ITaskService
,
(
void
**
)
&
service
);
if
(
hr
!=
S_OK
)
{
win_skip
(
"CoCreateInstance(CLSID_TaskScheduler) error %#x
\n
"
,
hr
);
return
;
}
vbool
=
0xdead
;
hr
=
ITaskService_get_Connected
(
service
,
&
vbool
);
todo_wine
ok
(
hr
==
S_OK
,
"get_Connected error %#x
\n
"
,
hr
);
todo_wine
ok
(
vbool
==
VARIANT_FALSE
,
"expected VARIANT_FALSE, got %d
\n
"
,
vbool
);
hr
=
ITaskService_get_TargetServer
(
service
,
&
bstr
);
todo_wine
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_ONLY_IF_CONNECTED
),
"expected ERROR_ONLY_IF_CONNECTED, got %#x
\n
"
,
hr
);
/* Win7 doesn't support UNC \\ prefix, but according to a user
* comment on MSDN Win8 supports both ways.
*/
len
=
sizeof
(
comp_name
)
/
sizeof
(
comp_name
[
0
]);
GetComputerNameW
(
comp_name
,
&
len
);
V_VT
(
&
v_null
)
=
VT_NULL
;
V_VT
(
&
v_comp
)
=
VT_BSTR
;
V_BSTR
(
&
v_comp
)
=
SysAllocString
(
comp_name
);
hr
=
ITaskService_Connect
(
service
,
v_comp
,
v_null
,
v_null
,
v_null
);
todo_wine
ok
(
hr
==
S_OK
||
hr
==
E_ACCESSDENIED
/* not an administrator */
,
"Connect error %#x
\n
"
,
hr
);
SysFreeString
(
V_BSTR
(
&
v_comp
));
V_BSTR
(
&
v_comp
)
=
SysAllocString
(
deadbeefW
);
hr
=
ITaskService_Connect
(
service
,
v_comp
,
v_null
,
v_null
,
v_null
);
todo_wine
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_BAD_NETPATH
),
"expected ERROR_BAD_NETPATH, got %#x
\n
"
,
hr
);
vbool
=
0xdead
;
hr
=
ITaskService_get_Connected
(
service
,
&
vbool
);
todo_wine
ok
(
hr
==
S_OK
,
"get_Connected error %#x
\n
"
,
hr
);
todo_wine
ok
(
vbool
==
VARIANT_TRUE
,
"expected VARIANT_TRUE, got %d
\n
"
,
vbool
);
hr
=
ITaskService_Connect
(
service
,
v_null
,
v_null
,
v_null
,
v_null
);
todo_wine
ok
(
hr
==
S_OK
,
"Connect error %#x
\n
"
,
hr
);
vbool
=
0xdead
;
hr
=
ITaskService_get_Connected
(
service
,
&
vbool
);
todo_wine
ok
(
hr
==
S_OK
,
"get_Connected error %#x
\n
"
,
hr
);
todo_wine
ok
(
vbool
==
VARIANT_TRUE
,
"expected VARIANT_TRUE, got %d
\n
"
,
vbool
);
hr
=
ITaskService_get_TargetServer
(
service
,
&
bstr
);
todo_wine
ok
(
hr
==
S_OK
,
"get_TargetServer error %#x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
ok
(
!
lstrcmpW
(
comp_name
,
bstr
),
"compname %s != server name %s
\n
"
,
wine_dbgstr_w
(
comp_name
),
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
}
SysFreeString
(
V_BSTR
(
&
v_comp
));
}
START_TEST
(
scheduler
)
{
OleInitialize
(
NULL
);
test_Connect
();
OleUninitialize
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment