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
b76e2dae
Commit
b76e2dae
authored
Oct 05, 2011
by
Marko Nikolic
Committed by
Alexandre Julliard
Oct 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Removed sign comparison warning in dpa tests.
parent
48678362
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
dpa.c
dlls/comctl32/tests/dpa.c
+20
-20
No files found.
dlls/comctl32/tests/dpa.c
View file @
b76e2dae
...
...
@@ -96,13 +96,13 @@ static BOOL InitFunctionPtrs(HMODULE hcomctl32)
/* Callbacks */
static
INT
CALLBACK
CB_CmpLT
(
PVOID
p1
,
PVOID
p2
,
LPARAM
lp
)
{
ok
(
lp
==
0x
deadbeef
,
"lp=%ld
\n
"
,
lp
);
ok
(
lp
==
0x
1abe11ed
,
"lp=%ld
\n
"
,
lp
);
return
p1
<
p2
?
-
1
:
p1
>
p2
?
1
:
0
;
}
static
INT
CALLBACK
CB_CmpGT
(
PVOID
p1
,
PVOID
p2
,
LPARAM
lp
)
{
ok
(
lp
==
0x
deadbeef
,
"lp=%ld
\n
"
,
lp
);
ok
(
lp
==
0x
1abe11ed
,
"lp=%ld
\n
"
,
lp
);
return
p1
>
p2
?
-
1
:
p1
<
p2
?
1
:
0
;
}
...
...
@@ -115,14 +115,14 @@ static INT nMessages[4];
static
PVOID
CALLBACK
CB_MergeInsertSrc
(
UINT
op
,
PVOID
p1
,
PVOID
p2
,
LPARAM
lp
)
{
nMessages
[
op
]
++
;
ok
(
lp
==
0x
deadbeef
,
"lp=%ld
\n
"
,
lp
);
ok
(
lp
==
0x
1abe11ed
,
"lp=%ld
\n
"
,
lp
);
return
p1
;
}
static
PVOID
CALLBACK
CB_MergeDeleteOddSrc
(
UINT
op
,
PVOID
p1
,
PVOID
p2
,
LPARAM
lp
)
{
nMessages
[
op
]
++
;
ok
(
lp
==
0x
deadbeef
,
"lp=%ld
\n
"
,
lp
);
ok
(
lp
==
0x
1abe11ed
,
"lp=%ld
\n
"
,
lp
);
return
((
PCHAR
)
p2
)
+
1
;
}
...
...
@@ -247,12 +247,12 @@ static void test_dpa(void)
INT
j
,
k
;
k
=
pDPA_GetPtrIndex
(
dpa
,
(
PVOID
)(
INT_PTR
)
i
);
/* Linear searches should work on unsorted DPAs */
j
=
pDPA_Search
(
dpa
,
(
PVOID
)(
INT_PTR
)
i
,
0
,
CB_CmpLT
,
0x
deadbeef
,
0
);
j
=
pDPA_Search
(
dpa
,
(
PVOID
)(
INT_PTR
)
i
,
0
,
CB_CmpLT
,
0x
1abe11ed
,
0
);
ok
(
j
==
k
,
"j=%d k=%d
\n
"
,
j
,
k
);
}
/* Sort DPA */
ok
(
pDPA_Sort
(
dpa
,
CB_CmpGT
,
0x
deadbeef
),
"
\n
"
);
ok
(
pDPA_Sort
(
dpa
,
CB_CmpGT
,
0x
1abe11ed
),
"
\n
"
);
rc
=
CheckDPA
(
dpa
,
0x654321
,
&
dw
);
ok
(
rc
,
"dw=0x%x
\n
"
,
dw
);
...
...
@@ -262,7 +262,7 @@ static void test_dpa(void)
/* The old data should have been preserved */
rc
=
CheckDPA
(
dpa2
,
0x654321
,
&
dw2
);
ok
(
rc
,
"dw=0x%x
\n
"
,
dw2
);
ok
(
pDPA_Sort
(
dpa
,
CB_CmpLT
,
0x
deadbeef
),
"
\n
"
);
ok
(
pDPA_Sort
(
dpa
,
CB_CmpLT
,
0x
1abe11ed
),
"
\n
"
);
/* Test if the DPA itself was really copied */
rc
=
CheckDPA
(
dpa
,
0x123456
,
&
dw
);
...
...
@@ -284,14 +284,14 @@ static void test_dpa(void)
/* The array is in order so ptr == index+1 */
j
=
pDPA_GetPtrIndex
(
dpa
,
(
PVOID
)(
INT_PTR
)
i
);
ok
(
j
+
1
==
i
,
"j=%d i=%d
\n
"
,
j
,
i
);
j
=
pDPA_Search
(
dpa
,
(
PVOID
)(
INT_PTR
)
i
,
0
,
CB_CmpLT
,
0x
deadbeef
,
DPAS_SORTED
);
j
=
pDPA_Search
(
dpa
,
(
PVOID
)(
INT_PTR
)
i
,
0
,
CB_CmpLT
,
0x
1abe11ed
,
DPAS_SORTED
);
ok
(
j
+
1
==
i
,
"j=%d i=%d
\n
"
,
j
,
i
);
/* Linear searches respect iStart ... */
j
=
pDPA_Search
(
dpa
,
(
PVOID
)(
INT_PTR
)
i
,
i
+
1
,
CB_CmpLT
,
0x
deadbeef
,
0
);
j
=
pDPA_Search
(
dpa
,
(
PVOID
)(
INT_PTR
)
i
,
i
+
1
,
CB_CmpLT
,
0x
1abe11ed
,
0
);
ok
(
j
==
DPA_ERR
,
"j=%d
\n
"
,
j
);
/* ... but for a binary search it's ignored */
j
=
pDPA_Search
(
dpa
,
(
PVOID
)(
INT_PTR
)
i
,
i
+
1
,
CB_CmpLT
,
0x
deadbeef
,
DPAS_SORTED
);
j
=
pDPA_Search
(
dpa
,
(
PVOID
)(
INT_PTR
)
i
,
i
+
1
,
CB_CmpLT
,
0x
1abe11ed
,
DPAS_SORTED
);
ok
(
j
+
1
==
i
,
"j=%d i=%d
\n
"
,
j
,
i
);
}
...
...
@@ -313,15 +313,15 @@ static void test_dpa(void)
/* Check where to re-insert the deleted item */
i
=
pDPA_Search
(
dpa
,
(
PVOID
)
3
,
0
,
CB_CmpLT
,
0x
deadbeef
,
DPAS_SORTED
|
DPAS_INSERTAFTER
);
CB_CmpLT
,
0x
1abe11ed
,
DPAS_SORTED
|
DPAS_INSERTAFTER
);
ok
(
i
==
2
,
"i=%d
\n
"
,
i
);
/* DPAS_INSERTBEFORE works just like DPAS_INSERTAFTER */
i
=
pDPA_Search
(
dpa
,
(
PVOID
)
3
,
0
,
CB_CmpLT
,
0x
deadbeef
,
DPAS_SORTED
|
DPAS_INSERTBEFORE
);
CB_CmpLT
,
0x
1abe11ed
,
DPAS_SORTED
|
DPAS_INSERTBEFORE
);
ok
(
i
==
2
,
"i=%d
\n
"
,
i
);
/* without DPAS_INSERTBEFORE/AFTER */
i
=
pDPA_Search
(
dpa
,
(
PVOID
)
3
,
0
,
CB_CmpLT
,
0x
deadbeef
,
DPAS_SORTED
);
CB_CmpLT
,
0x
1abe11ed
,
DPAS_SORTED
);
ok
(
i
==
-
1
,
"i=%d
\n
"
,
i
);
/* Re-insert the item */
...
...
@@ -334,7 +334,7 @@ static void test_dpa(void)
* should be bogus */
for
(
i
=
0
;
i
<
6
;
i
++
)
{
INT
j
=
pDPA_Search
(
dpa
,
(
PVOID
)(
INT_PTR
)
i
,
0
,
CB_CmpGT
,
0x
deadbeef
,
INT
j
=
pDPA_Search
(
dpa
,
(
PVOID
)(
INT_PTR
)
i
,
0
,
CB_CmpGT
,
0x
1abe11ed
,
DPAS_SORTED
|
DPAS_INSERTBEFORE
);
ok
(
j
!=
i
,
"i=%d
\n
"
,
i
);
}
...
...
@@ -396,7 +396,7 @@ static void test_DPA_Merge(void)
/* Delete all odd entries from dpa2 */
memset
(
nMessages
,
0
,
sizeof
(
nMessages
));
pDPA_Merge
(
dpa2
,
dpa
,
DPAM_INTERSECT
,
CB_CmpLT
,
CB_MergeDeleteOddSrc
,
0x
deadbeef
);
CB_CmpLT
,
CB_MergeDeleteOddSrc
,
0x
1abe11ed
);
rc
=
CheckDPA
(
dpa2
,
0x246
,
&
dw
);
ok
(
rc
,
"dw=0x%x
\n
"
,
dw
);
...
...
@@ -413,7 +413,7 @@ static void test_DPA_Merge(void)
/* DPAM_INTERSECT - returning source while merging */
memset
(
nMessages
,
0
,
sizeof
(
nMessages
));
pDPA_Merge
(
dpa2
,
dpa
,
DPAM_INTERSECT
,
CB_CmpLT
,
CB_MergeInsertSrc
,
0x
deadbeef
);
CB_CmpLT
,
CB_MergeInsertSrc
,
0x
1abe11ed
);
rc
=
CheckDPA
(
dpa2
,
0x135
,
&
dw
);
ok
(
rc
,
"dw=0x%x
\n
"
,
dw
);
...
...
@@ -433,7 +433,7 @@ static void test_DPA_Merge(void)
memset
(
nMessages
,
0
,
sizeof
(
nMessages
));
pDPA_Merge
(
dpa2
,
dpa
,
DPAM_UNION
,
CB_CmpLT
,
CB_MergeInsertSrc
,
0x
deadbeef
);
CB_CmpLT
,
CB_MergeInsertSrc
,
0x
1abe11ed
);
rc
=
CheckDPA
(
dpa2
,
0x123456
,
&
dw
);
ok
(
rc
||
broken
(
!
rc
&&
dw
==
0x23456
),
/* 4.7x */
...
...
@@ -448,7 +448,7 @@ static void test_DPA_Merge(void)
/* Merge dpa3 into dpa2 and dpa */
memset
(
nMessages
,
0
,
sizeof
(
nMessages
));
pDPA_Merge
(
dpa
,
dpa3
,
DPAM_UNION
|
DPAM_SORTED
,
CB_CmpLT
,
CB_MergeInsertSrc
,
0x
deadbeef
);
CB_CmpLT
,
CB_MergeInsertSrc
,
0x
1abe11ed
);
expect
(
3
,
nMessages
[
DPAMM_MERGE
]);
expect
(
0
,
nMessages
[
DPAMM_DELETE
]);
expect
(
3
,
nMessages
[
DPAMM_INSERT
]);
...
...
@@ -461,7 +461,7 @@ static void test_DPA_Merge(void)
memset
(
nMessages
,
0
,
sizeof
(
nMessages
));
pDPA_Merge
(
dpa2
,
dpa3
,
DPAM_UNION
|
DPAM_SORTED
,
CB_CmpLT
,
CB_MergeInsertSrc
,
0x
deadbeef
);
CB_CmpLT
,
CB_MergeInsertSrc
,
0x
1abe11ed
);
expect
(
3
,
nMessages
[
DPAMM_MERGE
]);
expect
(
0
,
nMessages
[
DPAMM_DELETE
]);
ok
(
nMessages
[
DPAMM_INSERT
]
==
3
||
...
...
@@ -667,7 +667,7 @@ static void test_DPA_SaveStream(void)
IStream
*
pStm
=
NULL
;
DWORD
dwMode
,
dw
;
HRESULT
hRes
;
ULONG
ret
;
INT
ret
;
INT
i
;
BOOL
rc
;
LARGE_INTEGER
liZero
;
...
...
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