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
e375f0d4
Commit
e375f0d4
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 wsprintfA %S conversion tests.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e4dbd567
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
1 deletion
+49
-1
wsprintf.c
dlls/user32/tests/wsprintf.c
+49
-1
No files found.
dlls/user32/tests/wsprintf.c
View file @
e375f0d4
...
...
@@ -52,7 +52,28 @@ static const struct
static
void
wsprintfATest
(
void
)
{
char
buf
[
25
];
char
buf
[
25
],
star
[
4
],
partial
[
4
];
static
const
WCHAR
starW
[]
=
{
0x2606
,
0
};
static
const
WCHAR
fffeW
[]
=
{
0xfffe
,
0
};
static
const
WCHAR
wineW
[]
=
{
0xd83c
,
0xdf77
,
0
};
/* U+1F377: wine glass */
const
struct
{
const
void
*
input
;
const
char
*
fmt
;
const
char
*
str
;
int
rc
;
BOOL
todo_rc
;
BOOL
todo_str
;
}
testcase
[]
=
{
{
starW
,
"%.1S"
,
partial
,
1
,
TRUE
,
TRUE
},
{
starW
,
"%.2S"
,
star
,
2
,
FALSE
,
TRUE
},
{
starW
,
"%.3S"
,
star
,
2
,
FALSE
,
TRUE
},
{
fffeW
,
"%.1S"
,
"?"
,
1
,
FALSE
,
TRUE
},
{
fffeW
,
"%.2S"
,
"?"
,
1
,
FALSE
,
TRUE
},
{
wineW
,
"%.2S"
,
"??"
,
2
,
FALSE
,
TRUE
},
{
star
,
"%.1s"
,
partial
,
1
},
};
CPINFO
cpinfo
;
unsigned
int
i
;
int
rc
;
...
...
@@ -72,6 +93,33 @@ static void wsprintfATest(void)
ok
(
rc
==
strlen
(
i64_formats
[
i
].
res
),
"%u: wsprintfA length failure: rc=%d
\n
"
,
i
,
rc
);
ok
(
!
strcmp
(
buf
,
i64_formats
[
i
].
res
),
"%u: wrong result [%s]
\n
"
,
i
,
buf
);
}
if
(
!
GetCPInfo
(
CP_ACP
,
&
cpinfo
)
||
cpinfo
.
MaxCharSize
<=
1
)
{
skip
(
"Multi-byte wsprintfA test isn't available for the current codepage
\n
"
);
return
;
}
rc
=
WideCharToMultiByte
(
CP_ACP
,
0
,
starW
,
-
1
,
star
,
sizeof
(
star
),
NULL
,
NULL
);
ok
(
rc
==
3
,
"unexpected rc, got %d
\n
"
,
rc
);
partial
[
0
]
=
star
[
0
];
partial
[
1
]
=
'\0'
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
testcase
);
i
++
)
{
memset
(
buf
,
0x11
,
sizeof
(
buf
));
rc
=
wsprintfA
(
buf
,
testcase
[
i
].
fmt
,
testcase
[
i
].
input
);
todo_wine_if
(
testcase
[
i
].
todo_rc
)
ok
(
rc
==
testcase
[
i
].
rc
,
"%u: expected %d, got %d
\n
"
,
i
,
testcase
[
i
].
rc
,
rc
);
todo_wine_if
(
testcase
[
i
].
todo_str
)
ok
(
!
strcmp
(
buf
,
testcase
[
i
].
str
),
"%u: expected %s, got %s
\n
"
,
i
,
wine_dbgstr_a
(
testcase
[
i
].
str
),
wine_dbgstr_an
(
buf
,
rc
));
}
}
static
void
wsprintfWTest
(
void
)
...
...
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