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
7ed8ad76
Commit
7ed8ad76
authored
Jun 05, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase/tests: Use the available ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bdc91b91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
path.c
dlls/kernelbase/tests/path.c
+8
-8
No files found.
dlls/kernelbase/tests/path.c
View file @
7ed8ad76
...
...
@@ -102,7 +102,7 @@ static void test_PathCchCombineEx(void)
"Combination of %s + %s returned %s, expected %s
\n
"
,
wine_dbgstr_w
(
p1
),
wine_dbgstr_w
(
p2
),
wine_dbgstr_w
(
output
),
wine_dbgstr_w
(
expected
));
for
(
i
=
0
;
i
<
sizeof
(
combine_test
)
/
sizeof
(
combine_test
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
combine_test
);
i
++
)
{
MultiByteToWideChar
(
CP_ACP
,
0
,
combine_test
[
i
].
path1
,
-
1
,
p1
,
MAX_PATH
);
MultiByteToWideChar
(
CP_ACP
,
0
,
combine_test
[
i
].
path2
,
-
1
,
p2
,
MAX_PATH
);
...
...
@@ -168,16 +168,16 @@ static void test_PathCchAddBackslash(void)
ok
(
hr
==
S_FALSE
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
pathW
[
0
]
==
0
,
"Unexpected path.
\n
"
);
for
(
i
=
0
;
i
<
sizeof
(
addbackslash_tests
)
/
sizeof
(
addbackslash_tests
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
addbackslash_tests
);
i
++
)
{
const
struct
addbackslash_test
*
test
=
&
addbackslash_tests
[
i
];
char
path
[
MAX_PATH
];
MultiByteToWideChar
(
CP_ACP
,
0
,
test
->
path
,
-
1
,
pathW
,
sizeof
(
pathW
)
/
sizeof
(
pathW
[
0
]
));
MultiByteToWideChar
(
CP_ACP
,
0
,
test
->
path
,
-
1
,
pathW
,
ARRAY_SIZE
(
pathW
));
hr
=
pPathCchAddBackslash
(
pathW
,
test
->
size
);
ok
(
hr
==
test
->
hr
,
"%u: unexpected return value %#x.
\n
"
,
i
,
hr
);
WideCharToMultiByte
(
CP_ACP
,
0
,
pathW
,
-
1
,
path
,
sizeof
(
path
)
/
sizeof
(
path
[
0
]
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
pathW
,
-
1
,
path
,
ARRAY_SIZE
(
path
),
NULL
,
NULL
);
ok
(
!
strcmp
(
path
,
test
->
result
),
"%u: unexpected resulting path %s.
\n
"
,
i
,
path
);
}
}
...
...
@@ -215,21 +215,21 @@ static void test_PathCchAddBackslashEx(void)
ok
(
hr
==
S_FALSE
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
pathW
[
0
]
==
0
,
"Unexpected path.
\n
"
);
for
(
i
=
0
;
i
<
sizeof
(
addbackslash_tests
)
/
sizeof
(
addbackslash_tests
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
addbackslash_tests
);
i
++
)
{
const
struct
addbackslash_test
*
test
=
&
addbackslash_tests
[
i
];
char
path
[
MAX_PATH
];
MultiByteToWideChar
(
CP_ACP
,
0
,
test
->
path
,
-
1
,
pathW
,
sizeof
(
pathW
)
/
sizeof
(
pathW
[
0
]
));
MultiByteToWideChar
(
CP_ACP
,
0
,
test
->
path
,
-
1
,
pathW
,
ARRAY_SIZE
(
pathW
));
hr
=
pPathCchAddBackslashEx
(
pathW
,
test
->
size
,
NULL
,
NULL
);
ok
(
hr
==
test
->
hr
,
"%u: unexpected return value %#x.
\n
"
,
i
,
hr
);
WideCharToMultiByte
(
CP_ACP
,
0
,
pathW
,
-
1
,
path
,
sizeof
(
path
)
/
sizeof
(
path
[
0
]
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
pathW
,
-
1
,
path
,
ARRAY_SIZE
(
path
),
NULL
,
NULL
);
ok
(
!
strcmp
(
path
,
test
->
result
),
"%u: unexpected resulting path %s.
\n
"
,
i
,
path
);
ptrW
=
(
void
*
)
0xdeadbeef
;
remaining
=
123
;
MultiByteToWideChar
(
CP_ACP
,
0
,
test
->
path
,
-
1
,
pathW
,
sizeof
(
pathW
)
/
sizeof
(
pathW
[
0
]
));
MultiByteToWideChar
(
CP_ACP
,
0
,
test
->
path
,
-
1
,
pathW
,
ARRAY_SIZE
(
pathW
));
hr
=
pPathCchAddBackslashEx
(
pathW
,
test
->
size
,
&
ptrW
,
&
remaining
);
ok
(
hr
==
test
->
hr
,
"%u: unexpected return value %#x.
\n
"
,
i
,
hr
);
if
(
SUCCEEDED
(
hr
))
...
...
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