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
ef5864fc
Commit
ef5864fc
authored
Aug 19, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mstask/tests: Use the global wine_dbgstr_w instead of a local variant.
parent
86f9fce7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
61 deletions
+30
-61
task.c
dlls/mstask/tests/task.c
+30
-61
No files found.
dlls/mstask/tests/task.c
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
);
}
...
...
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