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
0647abc5
Commit
0647abc5
authored
May 10, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Test resulting size of strings with trailing nulls.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
68bbf6fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
clipboard.c
dlls/user32/tests/clipboard.c
+17
-6
No files found.
dlls/user32/tests/clipboard.c
View file @
0647abc5
...
...
@@ -482,19 +482,19 @@ todo_wine
static
HGLOBAL
create_textA
(
void
)
{
HGLOBAL
h
=
GlobalAlloc
(
GMEM_DDESHARE
|
GMEM_MOVEABLE
,
5
);
HGLOBAL
h
=
GlobalAlloc
(
GMEM_DDESHARE
|
GMEM_MOVEABLE
,
10
);
char
*
p
=
GlobalLock
(
h
);
strcpy
(
p
,
"test"
);
memcpy
(
p
,
"test
\0\0\0\0\0
"
,
10
);
GlobalUnlock
(
h
);
return
h
;
}
static
HGLOBAL
create_textW
(
void
)
{
static
const
WCHAR
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
HGLOBAL
h
=
GlobalAlloc
(
GMEM_DDESHARE
|
GMEM_MOVEABLE
,
5
*
sizeof
(
WCHAR
));
static
const
WCHAR
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
,
0
,
0
,
0
,
0
,
0
};
HGLOBAL
h
=
GlobalAlloc
(
GMEM_DDESHARE
|
GMEM_MOVEABLE
,
sizeof
(
testW
));
WCHAR
*
p
=
GlobalLock
(
h
);
lstrcpyW
(
p
,
testW
);
memcpy
(
p
,
testW
,
sizeof
(
testW
)
);
GlobalUnlock
(
h
);
return
h
;
}
...
...
@@ -767,7 +767,9 @@ static void test_synthesized(void)
ok
(
data
!=
NULL
||
broken
(
tests
[
i
].
format
==
CF_DIBV5
&&
cf
==
CF_DIB
),
/* >= Vista */
"%u: couldn't get data, cf %04x err %d
\n
"
,
i
,
cf
,
GetLastError
());
if
(
cf
==
CF_LOCALE
)
switch
(
cf
)
{
case
CF_LOCALE
:
{
UINT
*
ptr
=
GlobalLock
(
data
);
ok
(
GlobalSize
(
data
)
==
sizeof
(
*
ptr
),
"%u: size %lu
\n
"
,
i
,
GlobalSize
(
data
));
...
...
@@ -775,6 +777,15 @@ static void test_synthesized(void)
broken
(
*
ptr
==
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_DEFAULT
)),
"%u: CF_LOCALE %08x/%08x
\n
"
,
i
,
*
ptr
,
GetUserDefaultLCID
()
);
GlobalUnlock
(
data
);
break
;
}
case
CF_TEXT
:
case
CF_OEMTEXT
:
ok
(
GlobalSize
(
data
)
==
10
,
"wrong len %ld
\n
"
,
GlobalSize
(
data
));
break
;
case
CF_UNICODETEXT
:
ok
(
GlobalSize
(
data
)
==
10
*
sizeof
(
WCHAR
),
"wrong len %ld
\n
"
,
GlobalSize
(
data
));
break
;
}
}
if
(
!
tests
[
i
].
expected
[
j
])
...
...
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