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
9a7cb34d
Commit
9a7cb34d
authored
Mar 22, 2018
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt/tests: Add _strupr tests.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
52415cab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
string.c
dlls/msvcrt/tests/string.c
+44
-0
No files found.
dlls/msvcrt/tests/string.c
View file @
9a7cb34d
...
...
@@ -3346,6 +3346,49 @@ static void test__memicmp_l(void)
ok
(
errno
==
0xdeadbeef
,
"errno is %d, expected 0xdeadbeef
\n
"
,
errno
);
}
static
void
test__strupr
(
void
)
{
const
char
str
[]
=
"123"
;
char
str2
[
4
];
char
*
mem
,
*
p
;
DWORD
prot
;
mem
=
VirtualAlloc
(
NULL
,
sizeof
(
str
),
MEM_COMMIT
,
PAGE_READWRITE
);
ok
(
mem
!=
NULL
,
"VirtualAlloc failed
\n
"
);
memcpy
(
mem
,
str
,
sizeof
(
str
));
ok
(
VirtualProtect
(
mem
,
sizeof
(
str
),
PAGE_READONLY
,
&
prot
),
"VirtualProtect failed
\n
"
);
strcpy
(
str2
,
"aBc"
);
p
=
_strupr
(
str2
);
ok
(
p
==
str2
,
"_strupr returned %p
\n
"
,
p
);
ok
(
!
strcmp
(
str2
,
"ABC"
),
"str2 = %s
\n
"
,
str2
);
p
=
_strupr
(
mem
);
ok
(
p
==
mem
,
"_strupr returned %p
\n
"
,
p
);
ok
(
!
strcmp
(
mem
,
"123"
),
"mem = %s
\n
"
,
mem
);
if
(
!
setlocale
(
LC_ALL
,
"english"
))
{
VirtualFree
(
mem
,
sizeof
(
str
),
MEM_RELEASE
);
win_skip
(
"English locale _strupr tests
\n
"
);
return
;
}
strcpy
(
str2
,
"aBc"
);
p
=
_strupr
(
str2
);
ok
(
p
==
str2
,
"_strupr returned %p
\n
"
,
p
);
ok
(
!
strcmp
(
str2
,
"ABC"
),
"str2 = %s
\n
"
,
str2
);
if
(
0
)
/* crashes on Windows */
{
p
=
_strupr
(
mem
);
ok
(
p
==
mem
,
"_strupr returned %p
\n
"
,
p
);
ok
(
!
strcmp
(
mem
,
"123"
),
"mem = %s
\n
"
,
mem
);
}
setlocale
(
LC_ALL
,
"C"
);
VirtualFree
(
mem
,
sizeof
(
str
),
MEM_RELEASE
);
}
START_TEST
(
string
)
{
char
mem
[
100
];
...
...
@@ -3468,4 +3511,5 @@ START_TEST(string)
test__ismbclx
();
test__memicmp
();
test__memicmp_l
();
test__strupr
();
}
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