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
840d1e15
Commit
840d1e15
authored
May 30, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
May 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ucrtbase/tests: Use the available ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3f3083d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
misc.c
dlls/ucrtbase/tests/misc.c
+3
-3
printf.c
dlls/ucrtbase/tests/printf.c
+9
-9
No files found.
dlls/ucrtbase/tests/misc.c
View file @
840d1e15
...
...
@@ -703,7 +703,7 @@ static void test_math_errors(void)
/* necessary so that exp(1e100)==INFINITY on glibc, we can remove this if we change our implementation */
p_fesetround
(
FE_TONEAREST
);
for
(
i
=
0
;
i
<
sizeof
(
testsd
)
/
sizeof
(
testsd
[
0
]
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
testsd
);
i
++
)
{
p_funcd
=
(
void
*
)
GetProcAddress
(
module
,
testsd
[
i
].
func
);
*
p_errno
()
=
-
1
;
exception
.
type
=
-
1
;
...
...
@@ -717,7 +717,7 @@ static void test_math_errors(void)
"%s(%f) got exception arg1 %f
\n
"
,
testsd
[
i
].
func
,
testsd
[
i
].
x
,
exception
.
arg1
);
}
for
(
i
=
0
;
i
<
sizeof
(
tests2d
)
/
sizeof
(
tests2d
[
0
]
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests2d
);
i
++
)
{
p_func2d
=
(
void
*
)
GetProcAddress
(
module
,
tests2d
[
i
].
func
);
*
p_errno
()
=
-
1
;
exception
.
type
=
-
1
;
...
...
@@ -733,7 +733,7 @@ static void test_math_errors(void)
"%s(%f, %f) got exception arg2 %f
\n
"
,
tests2d
[
i
].
func
,
tests2d
[
i
].
a
,
tests2d
[
i
].
b
,
exception
.
arg2
);
}
for
(
i
=
0
;
i
<
sizeof
(
testsdl
)
/
sizeof
(
testsdl
[
0
]
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
testsdl
);
i
++
)
{
p_funcdl
=
(
void
*
)
GetProcAddress
(
module
,
testsdl
[
i
].
func
);
*
p_errno
()
=
-
1
;
exception
.
type
=
-
1
;
...
...
dlls/ucrtbase/tests/printf.c
View file @
840d1e15
...
...
@@ -171,7 +171,7 @@ static void test_snprintf (void)
unsigned
int
i
;
/* Legacy _snprintf style termination */
for
(
i
=
0
;
i
<
sizeof
tests
/
sizeof
tests
[
0
]
;
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
)
;
i
++
)
{
const
char
*
fmt
=
tests
[
i
];
const
int
expect
=
strlen
(
fmt
)
>
bufsiz
?
-
1
:
strlen
(
fmt
);
const
int
n
=
vsprintf_wrapper
(
UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION
,
buffer
,
bufsiz
,
fmt
);
...
...
@@ -184,7 +184,7 @@ static void test_snprintf (void)
}
/* C99 snprintf style termination */
for
(
i
=
0
;
i
<
sizeof
tests
/
sizeof
tests
[
0
]
;
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
)
;
i
++
)
{
const
char
*
fmt
=
tests
[
i
];
const
int
expect
=
strlen
(
fmt
);
const
int
n
=
vsprintf_wrapper
(
UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR
,
buffer
,
bufsiz
,
fmt
);
...
...
@@ -199,7 +199,7 @@ static void test_snprintf (void)
}
/* swprintf style termination */
for
(
i
=
0
;
i
<
sizeof
tests
/
sizeof
tests
[
0
]
;
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
)
;
i
++
)
{
const
char
*
fmt
=
tests
[
i
];
const
int
expect
=
strlen
(
fmt
)
>=
bufsiz
?
-
2
:
strlen
(
fmt
);
const
int
n
=
vsprintf_wrapper
(
0
,
buffer
,
bufsiz
,
fmt
);
...
...
@@ -242,11 +242,11 @@ static void test_swprintf (void)
wchar_t
buffer
[
8
];
char
narrow
[
8
],
narrow_fmt
[
16
];
const
int
bufsiz
=
sizeof
buffer
/
sizeof
buffer
[
0
]
;
const
int
bufsiz
=
ARRAY_SIZE
(
buffer
)
;
unsigned
int
i
;
/* Legacy _snprintf style termination */
for
(
i
=
0
;
i
<
sizeof
tests
/
sizeof
tests
[
0
]
;
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
)
;
i
++
)
{
const
wchar_t
*
fmt
=
tests
[
i
];
const
int
expect
=
wcslen
(
fmt
)
>
bufsiz
?
-
1
:
wcslen
(
fmt
);
const
int
n
=
vswprintf_wrapper
(
UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION
,
buffer
,
bufsiz
,
fmt
);
...
...
@@ -261,7 +261,7 @@ static void test_swprintf (void)
}
/* C99 snprintf style termination */
for
(
i
=
0
;
i
<
sizeof
tests
/
sizeof
tests
[
0
]
;
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
)
;
i
++
)
{
const
wchar_t
*
fmt
=
tests
[
i
];
const
int
expect
=
wcslen
(
fmt
);
const
int
n
=
vswprintf_wrapper
(
UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR
,
buffer
,
bufsiz
,
fmt
);
...
...
@@ -278,7 +278,7 @@ static void test_swprintf (void)
}
/* swprintf style termination */
for
(
i
=
0
;
i
<
sizeof
tests
/
sizeof
tests
[
0
]
;
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
)
;
i
++
)
{
const
wchar_t
*
fmt
=
tests
[
i
];
const
int
expect
=
wcslen
(
fmt
)
>=
bufsiz
?
-
2
:
wcslen
(
fmt
);
const
int
n
=
vswprintf_wrapper
(
0
,
buffer
,
bufsiz
,
fmt
);
...
...
@@ -411,12 +411,12 @@ static void test_fwprintf(void)
p_fclose
(
fp
);
fp
=
p_fopen
(
file_name
,
"rb"
);
p_fgetws
(
bufw
,
sizeof
(
bufw
)
/
sizeof
(
bufw
[
0
]
),
fp
);
p_fgetws
(
bufw
,
ARRAY_SIZE
(
bufw
),
fp
);
ret
=
p_ftell
(
fp
);
ok
(
ret
==
24
,
"ftell returned %d
\n
"
,
ret
);
ok
(
!
wcscmp
(
bufw
,
simple
),
"buf = %s
\n
"
,
wine_dbgstr_w
(
bufw
));
p_fgetws
(
bufw
,
sizeof
(
bufw
)
/
sizeof
(
bufw
[
0
]
),
fp
);
p_fgetws
(
bufw
,
ARRAY_SIZE
(
bufw
),
fp
);
ret
=
p_ftell
(
fp
);
ok
(
ret
==
52
,
"ret = %d
\n
"
,
ret
);
ok
(
!
memcmp
(
bufw
,
cont
,
28
),
"buf = %s
\n
"
,
wine_dbgstr_w
(
bufw
));
...
...
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