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
c8f46313
Commit
c8f46313
authored
Feb 09, 2020
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Feb 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add wsprintfW %S conversion tests.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6c692dc1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
wsprintf.c
dlls/user32/tests/wsprintf.c
+48
-0
No files found.
dlls/user32/tests/wsprintf.c
View file @
c8f46313
...
...
@@ -123,7 +123,25 @@ static void wsprintfWTest(void)
static
const
WCHAR
fmt_010ld
[]
=
{
'%'
,
'0'
,
'1'
,
'0'
,
'l'
,
'd'
,
'\0'
};
static
const
WCHAR
res_010ld
[]
=
{
'-'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'1'
,
'\0'
};
static
const
WCHAR
fmt_I64x
[]
=
{
'%'
,
'I'
,
'6'
,
'4'
,
'x'
,
0
};
static
const
WCHAR
fmt_dot3S
[]
=
{
'%'
,
'.'
,
'3'
,
'S'
,
0
};
static
const
WCHAR
fmt__4S
[]
=
{
'%'
,
'-'
,
'4'
,
'S'
,
0
};
static
const
WCHAR
stars
[]
=
{
'*'
,
0x2606
,
0x2605
,
0
};
static
const
WCHAR
nul_spc
[]
=
{
'*'
,
0
,
' '
,
' '
,
0
};
WCHAR
def_spc
[]
=
{
'*'
,
'?'
,
0x2605
,
' '
,
0
};
WCHAR
buf
[
25
],
fmt
[
25
],
res
[
25
];
char
stars_mb
[
8
],
partial00
[
8
],
partialFF
[
8
];
const
struct
{
const
char
*
input
;
const
WCHAR
*
fmt
;
const
WCHAR
*
str
;
int
rc
;
}
testcase
[]
=
{
{
stars_mb
,
fmt_dot3S
,
stars
,
3
},
{
partial00
,
fmt__4S
,
nul_spc
,
4
},
{
partialFF
,
fmt__4S
,
def_spc
,
4
},
};
CPINFOEXW
cpinfoex
;
unsigned
int
i
;
int
rc
;
...
...
@@ -150,6 +168,36 @@ static void wsprintfWTest(void)
ok
(
rc
==
lstrlenW
(
res
),
"%u: wsprintfW length failure: rc=%d
\n
"
,
i
,
rc
);
ok
(
!
lstrcmpW
(
buf
,
res
),
"%u: wrong result [%s]
\n
"
,
i
,
wine_dbgstr_w
(
buf
));
}
if
(
!
GetCPInfoExW
(
CP_ACP
,
0
,
&
cpinfoex
)
||
cpinfoex
.
MaxCharSize
<=
1
)
{
skip
(
"Multi-byte wsprintfW test isn't available for the current codepage
\n
"
);
return
;
}
def_spc
[
1
]
=
cpinfoex
.
UnicodeDefaultChar
;
rc
=
WideCharToMultiByte
(
CP_ACP
,
0
,
stars
,
-
1
,
stars_mb
,
sizeof
(
stars_mb
),
NULL
,
NULL
);
ok
(
rc
==
6
,
"expected 6, got %d
\n
"
,
rc
);
strcpy
(
partial00
,
stars_mb
);
partial00
[
2
]
=
'\0'
;
strcpy
(
partialFF
,
stars_mb
);
partialFF
[
2
]
=
0xff
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
testcase
);
i
++
)
{
memset
(
buf
,
0x11
,
sizeof
(
buf
));
rc
=
wsprintfW
(
buf
,
testcase
[
i
].
fmt
,
testcase
[
i
].
input
);
todo_wine_if
(
i
==
2
)
ok
(
rc
==
testcase
[
i
].
rc
,
"%u: expected %d, got %d
\n
"
,
i
,
testcase
[
i
].
rc
,
rc
);
todo_wine
ok
(
!
memcmp
(
buf
,
testcase
[
i
].
str
,
(
testcase
[
i
].
rc
+
1
)
*
sizeof
(
WCHAR
)),
"%u: expected %s, got %s
\n
"
,
i
,
wine_dbgstr_wn
(
testcase
[
i
].
str
,
testcase
[
i
].
rc
+
1
),
wine_dbgstr_wn
(
buf
,
rc
+
1
));
}
}
/* Test if the CharUpper / CharLower functions return true 16 bit results,
...
...
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