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
77376000
Commit
77376000
authored
Jun 13, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Use the available ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
39bd2c96
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
24 deletions
+25
-24
compobj.c
dlls/ole32/tests/compobj.c
+3
-3
dragdrop.c
dlls/ole32/tests/dragdrop.c
+1
-1
marshal.c
dlls/ole32/tests/marshal.c
+2
-2
moniker.c
dlls/ole32/tests/moniker.c
+10
-9
ole2.c
dlls/ole32/tests/ole2.c
+4
-4
ole_server.c
dlls/ole32/tests/ole_server.c
+1
-1
propvariant.c
dlls/ole32/tests/propvariant.c
+1
-1
storage32.c
dlls/ole32/tests/storage32.c
+3
-3
No files found.
dlls/ole32/tests/compobj.c
View file @
77376000
...
...
@@ -197,7 +197,7 @@ static BOOL create_manifest_file(const char *filename, const char *manifest)
WCHAR
path
[
MAX_PATH
];
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
path
,
MAX_PATH
);
GetFullPathNameW
(
path
,
sizeof
(
manifest_path
)
/
sizeof
(
WCHAR
),
manifest_path
,
NULL
);
GetFullPathNameW
(
path
,
ARRAY_SIZE
(
manifest_path
),
manifest_path
,
NULL
);
manifest_len
=
strlen
(
manifest
);
file
=
CreateFileW
(
path
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
...
...
@@ -2334,7 +2334,7 @@ static void test_OleRegGetUserType(void)
}
/* test using registered CLSID */
StringFromGUID2
(
&
CLSID_non_existent
,
clsidW
,
sizeof
(
clsidW
)
/
sizeof
(
clsidW
[
0
]
));
StringFromGUID2
(
&
CLSID_non_existent
,
clsidW
,
ARRAY_SIZE
(
clsidW
));
ret
=
RegCreateKeyExW
(
HKEY_CLASSES_ROOT
,
clsidkeyW
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
clsidhkey
,
&
disposition
);
if
(
!
ret
)
...
...
@@ -2522,7 +2522,7 @@ static void flush_messages(void)
static
LRESULT
CALLBACK
cowait_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
if
(
cowait_msgs_last
<
sizeof
(
cowait_msgs
)
/
sizeof
(
*
cowait_msgs
))
if
(
cowait_msgs_last
<
ARRAY_SIZE
(
cowait_msgs
))
cowait_msgs
[
cowait_msgs_last
++
]
=
msg
;
if
(
msg
==
WM_DDE_FIRST
)
return
6
;
...
...
dlls/ole32/tests/dragdrop.c
View file @
77376000
...
...
@@ -701,7 +701,7 @@ static void test_DoDragDrop(void)
GetWindowRect
(
hwnd
,
&
rect
);
ok
(
SetCursorPos
(
rect
.
left
+
50
,
rect
.
top
+
50
),
"SetCursorPos failed
\n
"
);
for
(
seq
=
0
;
seq
<
sizeof
(
call_lists
)
/
sizeof
(
call_lists
[
0
]
);
seq
++
)
for
(
seq
=
0
;
seq
<
ARRAY_SIZE
(
call_lists
);
seq
++
)
{
DWORD
effect_in
;
trace
(
"%d
\n
"
,
seq
);
...
...
dlls/ole32/tests/marshal.c
View file @
77376000
...
...
@@ -3941,8 +3941,8 @@ static const char *debugstr_iid(REFIID riid)
WCHAR
bufferW
[
39
];
char
buffer
[
39
];
LONG
name_size
=
sizeof
(
name
);
StringFromGUID2
(
riid
,
bufferW
,
sizeof
(
bufferW
)
/
sizeof
(
bufferW
[
0
]
));
WideCharToMultiByte
(
CP_ACP
,
0
,
bufferW
,
sizeof
(
bufferW
)
/
sizeof
(
bufferW
[
0
]
),
buffer
,
sizeof
(
buffer
),
NULL
,
NULL
);
StringFromGUID2
(
riid
,
bufferW
,
ARRAY_SIZE
(
bufferW
));
WideCharToMultiByte
(
CP_ACP
,
0
,
bufferW
,
ARRAY_SIZE
(
bufferW
),
buffer
,
sizeof
(
buffer
),
NULL
,
NULL
);
if
(
RegOpenKeyExA
(
HKEY_CLASSES_ROOT
,
"Interface"
,
0
,
KEY_QUERY_VALUE
,
&
hkeyInterface
)
!=
ERROR_SUCCESS
)
{
memcpy
(
name
,
buffer
,
sizeof
(
buffer
));
...
...
dlls/ole32/tests/moniker.c
View file @
77376000
...
...
@@ -38,7 +38,6 @@
#define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %d\n", cLocks)
#define ok_no_locks() ok(cLocks == 0, "Number of locks should be 0, but actually is %d\n", cLocks)
#define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error 0x%08x\n", hr)
#define COUNTOF(x) (sizeof(x) / sizeof(x[0]))
#define CHECK_EXPECTED_METHOD(method_name) \
do { \
...
...
@@ -905,7 +904,7 @@ static void test_MkParseDisplayName(void)
hr
=
CreateBindCtx
(
0
,
&
pbc
);
ok_ole_success
(
hr
,
CreateBindCtx
);
for
(
i
=
0
;
i
<
sizeof
(
invalid_parameters
)
/
sizeof
(
invalid_parameters
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
invalid_parameters
);
i
++
)
{
eaten
=
0xdeadbeef
;
pmk
=
(
IMoniker
*
)
0xdeadbeef
;
...
...
@@ -947,7 +946,7 @@ static void test_MkParseDisplayName(void)
pmk
=
NULL
;
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayName
,
&
eaten
,
&
pmk
);
ok_ole_success
(
hr
,
MkParseDisplayName
);
ok
(
eaten
==
sizeof
(
wszDisplayName
)
/
sizeof
(
WCHAR
)
-
1
,
ok
(
eaten
==
ARRAY_SIZE
(
wszDisplayName
)
-
1
,
"Processed character count should have been 43 instead of %u
\n
"
,
eaten
);
if
(
pmk
)
{
...
...
@@ -969,7 +968,7 @@ static void test_MkParseDisplayName(void)
pmk
=
NULL
;
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayNameRunning
,
&
eaten
,
&
pmk
);
ok_ole_success
(
hr
,
MkParseDisplayName
);
ok
(
eaten
==
sizeof
(
wszDisplayNameRunning
)
/
sizeof
(
WCHAR
)
-
1
,
ok
(
eaten
==
ARRAY_SIZE
(
wszDisplayNameRunning
)
-
1
,
"Processed character count should have been 15 instead of %u
\n
"
,
eaten
);
if
(
pmk
)
{
...
...
@@ -987,7 +986,7 @@ static void test_MkParseDisplayName(void)
expected_display_name
=
wszDisplayNameProgId1
;
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayNameProgId1
,
&
eaten
,
&
pmk
);
ok_ole_success
(
hr
,
MkParseDisplayName
);
ok
(
eaten
==
sizeof
(
wszDisplayNameProgId1
)
/
sizeof
(
WCHAR
)
-
1
,
ok
(
eaten
==
ARRAY_SIZE
(
wszDisplayNameProgId1
)
-
1
,
"Processed character count should have been 8 instead of %u
\n
"
,
eaten
);
if
(
pmk
)
{
...
...
@@ -999,7 +998,7 @@ static void test_MkParseDisplayName(void)
expected_display_name
=
wszDisplayNameProgId2
;
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayNameProgId2
,
&
eaten
,
&
pmk
);
ok_ole_success
(
hr
,
MkParseDisplayName
);
ok
(
eaten
==
sizeof
(
wszDisplayNameProgId2
)
/
sizeof
(
WCHAR
)
-
1
,
ok
(
eaten
==
ARRAY_SIZE
(
wszDisplayNameProgId2
)
-
1
,
"Processed character count should have been 8 instead of %u
\n
"
,
eaten
);
if
(
pmk
)
{
...
...
@@ -1021,7 +1020,8 @@ static void test_MkParseDisplayName(void)
GetSystemDirectoryA
(
szDisplayNameFile
,
sizeof
(
szDisplayNameFile
));
strcat
(
szDisplayNameFile
,
"
\\
kernel32.dll"
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szDisplayNameFile
,
-
1
,
wszDisplayNameFile
,
sizeof
(
wszDisplayNameFile
)
/
sizeof
(
wszDisplayNameFile
[
0
]));
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szDisplayNameFile
,
-
1
,
wszDisplayNameFile
,
ARRAY_SIZE
(
wszDisplayNameFile
));
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayNameFile
,
&
eaten
,
&
pmk
);
ok_ole_success
(
hr
,
MkParseDisplayName
);
ok
(
eaten
==
len
-
1
,
"Processed character count should have been %d instead of %u
\n
"
,
len
-
1
,
eaten
);
...
...
@@ -1034,7 +1034,8 @@ static void test_MkParseDisplayName(void)
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayName
,
&
eaten
,
&
pmk
);
ok_ole_success
(
hr
,
MkParseDisplayName
);
ok
(
eaten
==
sizeof
(
wszDisplayName
)
/
sizeof
(
WCHAR
)
-
1
,
"Processed character count should have been 43 instead of %u
\n
"
,
eaten
);
ok
(
eaten
==
ARRAY_SIZE
(
wszDisplayName
)
-
1
,
"Processed character count should have been 43 instead of %u
\n
"
,
eaten
);
if
(
pmk
)
{
...
...
@@ -1550,7 +1551,7 @@ static void test_file_monikers(void)
trace
(
"ACP is %u
\n
"
,
GetACP
());
for
(
i
=
0
;
i
<
COUNTOF
(
wszFile
);
++
i
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
wszFile
);
++
i
)
{
int
j
;
if
(
i
==
2
)
...
...
dlls/ole32/tests/ole2.c
View file @
77376000
...
...
@@ -1728,7 +1728,7 @@ static void test_data_cache(void)
{
NULL
,
0
}
};
GetSystemDirectoryA
(
szSystemDir
,
sizeof
(
szSystemDir
)
/
sizeof
(
szSystemDir
[
0
]
));
GetSystemDirectoryA
(
szSystemDir
,
ARRAY_SIZE
(
szSystemDir
));
expected_method_list
=
methods_cacheinitnew
;
...
...
@@ -1860,7 +1860,7 @@ static void test_data_cache(void)
hr
=
IOleCache2_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
ok_ole_success
(
hr
,
"IOleCache_Cache"
);
MultiByteToWideChar
(
CP_ACP
,
0
,
szSystemDir
,
-
1
,
wszPath
,
sizeof
(
wszPath
)
/
sizeof
(
wszPath
[
0
]
));
MultiByteToWideChar
(
CP_ACP
,
0
,
szSystemDir
,
-
1
,
wszPath
,
ARRAY_SIZE
(
wszPath
));
memcpy
(
wszPath
+
lstrlenW
(
wszPath
),
wszShell32
,
sizeof
(
wszShell32
));
fmtetc
.
cfFormat
=
CF_METAFILEPICT
;
...
...
@@ -2490,7 +2490,7 @@ static void test_data_cache_init(void)
{
&
CLSID_Picture_EnhMetafile
,
3
,
1
}
};
for
(
i
=
0
;
i
<
sizeof
(
data
)
/
sizeof
(
data
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
data
);
i
++
)
{
hr
=
CreateDataCache
(
NULL
,
data
[
i
].
clsid
,
&
IID_IOleCache2
,
(
void
**
)
&
cache
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -4541,7 +4541,7 @@ static void test_data_cache_contents(void)
{
&
stg_def_9
,
&
stg_def_9_saved
},
};
for
(
i
=
0
;
i
<
sizeof
(
test_data
)
/
sizeof
(
test_data
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
test_data
);
i
++
)
{
if
(
winetest_debug
>
1
)
trace
(
"start testing storage def %d
\n
"
,
i
);
...
...
dlls/ole32/tests/ole_server.c
View file @
77376000
...
...
@@ -69,7 +69,7 @@ static const char *debugstr_guid(const GUID *guid)
if
(
!
guid
)
return
"(null)"
;
for
(
i
=
0
;
i
<
sizeof
(
guid_name
)
/
sizeof
(
guid_name
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
guid_name
);
i
++
)
{
if
(
IsEqualIID
(
guid
,
guid_name
[
i
].
guid
))
return
guid_name
[
i
].
name
;
...
...
dlls/ole32/tests/propvariant.c
View file @
77376000
...
...
@@ -189,7 +189,7 @@ static void test_validtypes(void)
ok
(
U
(
propvar
).
uhVal
.
QuadPart
==
0
,
"expected 0, got %#x/%#x
\n
"
,
U
(
propvar
).
uhVal
.
u
.
LowPart
,
U
(
propvar
).
uhVal
.
u
.
HighPart
);
for
(
i
=
0
;
i
<
sizeof
(
valid_types
)
/
sizeof
(
valid_types
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
valid_types
);
i
++
)
{
VARTYPE
vt
;
...
...
dlls/ole32/tests/storage32.c
View file @
77376000
...
...
@@ -2084,9 +2084,9 @@ static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD
{
int
i
,
j
,
idx
=
0
;
for
(
i
=
0
;
i
<
sizeof
(
access_modes
)
/
sizeof
(
access_modes
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
access_modes
);
i
++
)
{
for
(
j
=
0
;
j
<
sizeof
(
share_modes
)
/
sizeof
(
share_modes
[
0
]
);
j
++
)
for
(
j
=
0
;
j
<
ARRAY_SIZE
(
share_modes
);
j
++
)
{
DWORD
lasterr
;
HANDLE
hfile
;
...
...
@@ -3490,7 +3490,7 @@ static void test_locking(void)
IStorage
*
stg
;
HRESULT
hr
;
for
(
i
=
0
;
i
<
sizeof
(
lock_tests
)
/
sizeof
(
lock_tests
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
lock_tests
);
i
++
)
{
const
struct
lock_test
*
current
=
&
lock_tests
[
i
];
BOOL
any_failure
=
FALSE
;
...
...
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