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
ef5864fc
Commit
ef5864fc
authored
15 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
mstask/tests: Use the global wine_dbgstr_w instead of a local variant.
parent
86f9fce7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/mstask/tests/task.c
+30
-61
30 additions, 61 deletions
dlls/mstask/tests/task.c
with
30 additions
and
61 deletions
dlls/mstask/tests/task.c
+
30
−
61
View file @
ef5864fc
...
...
@@ -28,37 +28,6 @@ static ITaskScheduler *test_task_scheduler;
static
ITask
*
test_task
;
static
const
WCHAR
empty
[]
=
{
0
};
/* allocate some tmp string space */
/* FIXME: this is not 100% thread-safe */
static
char
*
get_tmp_space
(
int
size
)
{
static
char
*
list
[
16
];
static
long
pos
;
char
*
ret
;
int
idx
;
idx
=
++
pos
%
(
sizeof
(
list
)
/
sizeof
(
list
[
0
]));
if
(
list
[
idx
])
ret
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
list
[
idx
],
size
);
else
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
ret
)
list
[
idx
]
=
ret
;
return
ret
;
}
static
const
char
*
dbgstr_w
(
LPCWSTR
str
)
{
char
*
buf
;
int
len
;
if
(
!
str
)
return
"(null)"
;
len
=
lstrlenW
(
str
)
+
1
;
buf
=
get_tmp_space
(
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
buf
,
len
,
NULL
,
NULL
);
return
buf
;
}
static
BOOL
setup_task
(
void
)
{
HRESULT
hres
;
...
...
@@ -126,7 +95,7 @@ static void test_SetApplicationName_GetApplicationName(void)
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpiW
(
stored_name
,
empty
),
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
stored_name
));
"Got %s, expected empty string
\n
"
,
wine_
dbgstr_w
(
stored_name
));
CoTaskMemFree
(
stored_name
);
}
...
...
@@ -134,14 +103,14 @@ static void test_SetApplicationName_GetApplicationName(void)
* the application name that is actually stored */
hres
=
ITask_SetApplicationName
(
test_task
,
non_application_name
);
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
dbgstr_w
(
non_application_name
),
hres
);
wine_
dbgstr_w
(
non_application_name
),
hres
);
hres
=
ITask_GetApplicationName
(
test_task
,
&
stored_name
);
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
full_name
=
path_resolve_name
(
non_application_name
);
ok
(
!
lstrcmpiW
(
stored_name
,
full_name
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
stored_name
),
dbgstr_w
(
full_name
));
wine_
dbgstr_w
(
stored_name
),
wine_
dbgstr_w
(
full_name
));
CoTaskMemFree
(
stored_name
);
}
...
...
@@ -149,21 +118,21 @@ static void test_SetApplicationName_GetApplicationName(void)
* get the stored name */
hres
=
ITask_SetApplicationName
(
test_task
,
notepad_exe
);
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
dbgstr_w
(
notepad_exe
),
hres
);
wine_
dbgstr_w
(
notepad_exe
),
hres
);
hres
=
ITask_GetApplicationName
(
test_task
,
&
stored_name
);
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
full_name
=
path_resolve_name
(
notepad_exe
);
ok
(
!
lstrcmpiW
(
stored_name
,
full_name
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
stored_name
),
dbgstr_w
(
full_name
));
wine_
dbgstr_w
(
stored_name
),
wine_
dbgstr_w
(
full_name
));
CoTaskMemFree
(
stored_name
);
}
/* Set a valid application name without program type extension and
* then get the stored name */
hres
=
ITask_SetApplicationName
(
test_task
,
notepad
);
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
dbgstr_w
(
notepad
),
hres
);
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
wine_
dbgstr_w
(
notepad
),
hres
);
hres
=
ITask_GetApplicationName
(
test_task
,
&
stored_name
);
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
...
...
@@ -173,7 +142,7 @@ static void test_SetApplicationName_GetApplicationName(void)
{
full_name
=
path_resolve_name
(
notepad
);
ok
(
!
lstrcmpiW
(
stored_name
,
full_name
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
stored_name
),
dbgstr_w
(
full_name
));
wine_
dbgstr_w
(
stored_name
),
wine_
dbgstr_w
(
full_name
));
}
CoTaskMemFree
(
stored_name
);
}
...
...
@@ -183,26 +152,26 @@ static void test_SetApplicationName_GetApplicationName(void)
* actually stored */
hres
=
ITask_SetApplicationName
(
test_task
,
non_application_name
);
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
dbgstr_w
(
non_application_name
),
hres
);
wine_
dbgstr_w
(
non_application_name
),
hres
);
hres
=
ITask_GetApplicationName
(
test_task
,
&
stored_name
);
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
full_name
=
path_resolve_name
(
non_application_name
);
ok
(
!
lstrcmpiW
(
stored_name
,
full_name
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
stored_name
),
dbgstr_w
(
full_name
));
wine_
dbgstr_w
(
stored_name
),
wine_
dbgstr_w
(
full_name
));
CoTaskMemFree
(
stored_name
);
}
/* Clear application name */
hres
=
ITask_SetApplicationName
(
test_task
,
empty
);
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
dbgstr_w
(
empty
),
hres
);
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
wine_
dbgstr_w
(
empty
),
hres
);
hres
=
ITask_GetApplicationName
(
test_task
,
&
stored_name
);
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpiW
(
stored_name
,
empty
),
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
stored_name
));
"Got %s, expected empty string
\n
"
,
wine_
dbgstr_w
(
stored_name
));
CoTaskMemFree
(
stored_name
);
}
...
...
@@ -261,46 +230,46 @@ static void test_SetParameters_GetParameters(void)
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpW
(
parameters
,
empty
),
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
parameters
));
"Got %s, expected empty string
\n
"
,
wine_
dbgstr_w
(
parameters
));
CoTaskMemFree
(
parameters
);
}
/* Set parameters to a simple string */
hres
=
ITask_SetParameters
(
test_task
,
parameters_a
);
ok
(
hres
==
S_OK
,
"Failed setting parameters %s: %08x
\n
"
,
dbgstr_w
(
parameters_a
),
hres
);
wine_
dbgstr_w
(
parameters_a
),
hres
);
hres
=
ITask_GetParameters
(
test_task
,
&
parameters
);
ok
(
hres
==
S_OK
,
"GetParameters failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpW
(
parameters
,
parameters_a
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
parameters
),
dbgstr_w
(
parameters_a
));
wine_
dbgstr_w
(
parameters
),
wine_
dbgstr_w
(
parameters_a
));
CoTaskMemFree
(
parameters
);
}
/* Update parameters to a different simple string */
hres
=
ITask_SetParameters
(
test_task
,
parameters_b
);
ok
(
hres
==
S_OK
,
"Failed setting parameters %s: %08x
\n
"
,
dbgstr_w
(
parameters_b
),
hres
);
wine_
dbgstr_w
(
parameters_b
),
hres
);
hres
=
ITask_GetParameters
(
test_task
,
&
parameters
);
ok
(
hres
==
S_OK
,
"GetParameters failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpW
(
parameters
,
parameters_b
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
parameters
),
dbgstr_w
(
parameters_b
));
wine_
dbgstr_w
(
parameters
),
wine_
dbgstr_w
(
parameters_b
));
CoTaskMemFree
(
parameters
);
}
/* Clear parameters */
hres
=
ITask_SetParameters
(
test_task
,
empty
);
ok
(
hres
==
S_OK
,
"Failed setting parameters %s: %08x
\n
"
,
dbgstr_w
(
empty
),
hres
);
wine_
dbgstr_w
(
empty
),
hres
);
hres
=
ITask_GetParameters
(
test_task
,
&
parameters
);
ok
(
hres
==
S_OK
,
"GetParameters failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpW
(
parameters
,
empty
),
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
parameters
));
"Got %s, expected empty string
\n
"
,
wine_
dbgstr_w
(
parameters
));
CoTaskMemFree
(
parameters
);
}
...
...
@@ -331,46 +300,46 @@ static void test_SetComment_GetComment(void)
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpW
(
comment
,
empty
),
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
comment
));
"Got %s, expected empty string
\n
"
,
wine_
dbgstr_w
(
comment
));
CoTaskMemFree
(
comment
);
}
/* Set comment to a simple string */
hres
=
ITask_SetComment
(
test_task
,
comment_a
);
ok
(
hres
==
S_OK
,
"Failed setting comment %s: %08x
\n
"
,
dbgstr_w
(
comment_a
),
hres
);
wine_
dbgstr_w
(
comment_a
),
hres
);
hres
=
ITask_GetComment
(
test_task
,
&
comment
);
ok
(
hres
==
S_OK
,
"GetComment failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpW
(
comment
,
comment_a
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
comment
),
dbgstr_w
(
comment_a
));
wine_
dbgstr_w
(
comment
),
wine_
dbgstr_w
(
comment_a
));
CoTaskMemFree
(
comment
);
}
/* Update comment to a different simple string */
hres
=
ITask_SetComment
(
test_task
,
comment_b
);
ok
(
hres
==
S_OK
,
"Failed setting comment %s: %08x
\n
"
,
dbgstr_w
(
comment_b
),
hres
);
wine_
dbgstr_w
(
comment_b
),
hres
);
hres
=
ITask_GetComment
(
test_task
,
&
comment
);
ok
(
hres
==
S_OK
,
"GetComment failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpW
(
comment
,
comment_b
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
comment
),
dbgstr_w
(
comment_b
));
wine_
dbgstr_w
(
comment
),
wine_
dbgstr_w
(
comment_b
));
CoTaskMemFree
(
comment
);
}
/* Clear comment */
hres
=
ITask_SetComment
(
test_task
,
empty
);
ok
(
hres
==
S_OK
,
"Failed setting comment %s: %08x
\n
"
,
dbgstr_w
(
empty
),
hres
);
wine_
dbgstr_w
(
empty
),
hres
);
hres
=
ITask_GetComment
(
test_task
,
&
comment
);
ok
(
hres
==
S_OK
,
"GetComment failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpW
(
comment
,
empty
),
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
comment
));
"Got %s, expected empty string
\n
"
,
wine_
dbgstr_w
(
comment
));
CoTaskMemFree
(
comment
);
}
...
...
@@ -481,8 +450,8 @@ static void test_SetAccountInformation_GetAccountInformation(void)
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpW
(
account_name
,
dummy_account_name
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
account_name
),
dbgstr_w
(
dummy_account_name
));
"Got %s, expected %s
\n
"
,
wine_
dbgstr_w
(
account_name
),
wine_
dbgstr_w
(
dummy_account_name
));
CoTaskMemFree
(
account_name
);
}
...
...
@@ -500,8 +469,8 @@ static void test_SetAccountInformation_GetAccountInformation(void)
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpW
(
account_name
,
dummy_account_name_b
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
account_name
),
dbgstr_w
(
dummy_account_name_b
));
"Got %s, expected %s
\n
"
,
wine_
dbgstr_w
(
account_name
),
wine_
dbgstr_w
(
dummy_account_name_b
));
CoTaskMemFree
(
account_name
);
}
...
...
@@ -516,7 +485,7 @@ static void test_SetAccountInformation_GetAccountInformation(void)
if
(
hres
==
S_OK
)
{
ok
(
!
lstrcmpW
(
account_name
,
empty
),
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
account_name
));
"Got %s, expected empty string
\n
"
,
wine_
dbgstr_w
(
account_name
));
CoTaskMemFree
(
account_name
);
}
...
...
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