comctl32/tests: Removed sign comparison warning in dpa tests.
This commit is contained in:
parent
486783626f
commit
b76e2daec2
|
@ -96,13 +96,13 @@ static BOOL InitFunctionPtrs(HMODULE hcomctl32)
|
||||||
/* Callbacks */
|
/* Callbacks */
|
||||||
static INT CALLBACK CB_CmpLT(PVOID p1, PVOID p2, LPARAM lp)
|
static INT CALLBACK CB_CmpLT(PVOID p1, PVOID p2, LPARAM lp)
|
||||||
{
|
{
|
||||||
ok(lp == 0xdeadbeef, "lp=%ld\n", lp);
|
ok(lp == 0x1abe11ed, "lp=%ld\n", lp);
|
||||||
return p1 < p2 ? -1 : p1 > p2 ? 1 : 0;
|
return p1 < p2 ? -1 : p1 > p2 ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INT CALLBACK CB_CmpGT(PVOID p1, PVOID p2, LPARAM lp)
|
static INT CALLBACK CB_CmpGT(PVOID p1, PVOID p2, LPARAM lp)
|
||||||
{
|
{
|
||||||
ok(lp == 0xdeadbeef, "lp=%ld\n", lp);
|
ok(lp == 0x1abe11ed, "lp=%ld\n", lp);
|
||||||
return p1 > p2 ? -1 : p1 < p2 ? 1 : 0;
|
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)
|
static PVOID CALLBACK CB_MergeInsertSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp)
|
||||||
{
|
{
|
||||||
nMessages[op]++;
|
nMessages[op]++;
|
||||||
ok(lp == 0xdeadbeef, "lp=%ld\n", lp);
|
ok(lp == 0x1abe11ed, "lp=%ld\n", lp);
|
||||||
return p1;
|
return p1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PVOID CALLBACK CB_MergeDeleteOddSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp)
|
static PVOID CALLBACK CB_MergeDeleteOddSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp)
|
||||||
{
|
{
|
||||||
nMessages[op]++;
|
nMessages[op]++;
|
||||||
ok(lp == 0xdeadbeef, "lp=%ld\n", lp);
|
ok(lp == 0x1abe11ed, "lp=%ld\n", lp);
|
||||||
return ((PCHAR)p2)+1;
|
return ((PCHAR)p2)+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,12 +247,12 @@ static void test_dpa(void)
|
||||||
INT j, k;
|
INT j, k;
|
||||||
k = pDPA_GetPtrIndex(dpa, (PVOID)(INT_PTR)i);
|
k = pDPA_GetPtrIndex(dpa, (PVOID)(INT_PTR)i);
|
||||||
/* Linear searches should work on unsorted DPAs */
|
/* Linear searches should work on unsorted DPAs */
|
||||||
j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, 0, CB_CmpLT, 0xdeadbeef, 0);
|
j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, 0, CB_CmpLT, 0x1abe11ed, 0);
|
||||||
ok(j == k, "j=%d k=%d\n", j, k);
|
ok(j == k, "j=%d k=%d\n", j, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sort DPA */
|
/* Sort DPA */
|
||||||
ok(pDPA_Sort(dpa, CB_CmpGT, 0xdeadbeef), "\n");
|
ok(pDPA_Sort(dpa, CB_CmpGT, 0x1abe11ed), "\n");
|
||||||
rc=CheckDPA(dpa, 0x654321, &dw);
|
rc=CheckDPA(dpa, 0x654321, &dw);
|
||||||
ok(rc, "dw=0x%x\n", dw);
|
ok(rc, "dw=0x%x\n", dw);
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ static void test_dpa(void)
|
||||||
/* The old data should have been preserved */
|
/* The old data should have been preserved */
|
||||||
rc=CheckDPA(dpa2, 0x654321, &dw2);
|
rc=CheckDPA(dpa2, 0x654321, &dw2);
|
||||||
ok(rc, "dw=0x%x\n", dw2);
|
ok(rc, "dw=0x%x\n", dw2);
|
||||||
ok(pDPA_Sort(dpa, CB_CmpLT, 0xdeadbeef), "\n");
|
ok(pDPA_Sort(dpa, CB_CmpLT, 0x1abe11ed), "\n");
|
||||||
|
|
||||||
/* Test if the DPA itself was really copied */
|
/* Test if the DPA itself was really copied */
|
||||||
rc=CheckDPA(dpa, 0x123456, &dw);
|
rc=CheckDPA(dpa, 0x123456, &dw);
|
||||||
|
@ -284,14 +284,14 @@ static void test_dpa(void)
|
||||||
/* The array is in order so ptr == index+1 */
|
/* The array is in order so ptr == index+1 */
|
||||||
j = pDPA_GetPtrIndex(dpa, (PVOID)(INT_PTR)i);
|
j = pDPA_GetPtrIndex(dpa, (PVOID)(INT_PTR)i);
|
||||||
ok(j+1 == i, "j=%d i=%d\n", j, i);
|
ok(j+1 == i, "j=%d i=%d\n", j, i);
|
||||||
j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, 0, CB_CmpLT, 0xdeadbeef, DPAS_SORTED);
|
j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, 0, CB_CmpLT, 0x1abe11ed, DPAS_SORTED);
|
||||||
ok(j+1 == i, "j=%d i=%d\n", j, i);
|
ok(j+1 == i, "j=%d i=%d\n", j, i);
|
||||||
|
|
||||||
/* Linear searches respect iStart ... */
|
/* Linear searches respect iStart ... */
|
||||||
j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, i+1, CB_CmpLT, 0xdeadbeef, 0);
|
j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, i+1, CB_CmpLT, 0x1abe11ed, 0);
|
||||||
ok(j == DPA_ERR, "j=%d\n", j);
|
ok(j == DPA_ERR, "j=%d\n", j);
|
||||||
/* ... but for a binary search it's ignored */
|
/* ... but for a binary search it's ignored */
|
||||||
j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, i+1, CB_CmpLT, 0xdeadbeef, DPAS_SORTED);
|
j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, i+1, CB_CmpLT, 0x1abe11ed, DPAS_SORTED);
|
||||||
ok(j+1 == i, "j=%d i=%d\n", j, i);
|
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 */
|
/* Check where to re-insert the deleted item */
|
||||||
i = pDPA_Search(dpa, (PVOID)3, 0,
|
i = pDPA_Search(dpa, (PVOID)3, 0,
|
||||||
CB_CmpLT, 0xdeadbeef, DPAS_SORTED|DPAS_INSERTAFTER);
|
CB_CmpLT, 0x1abe11ed, DPAS_SORTED|DPAS_INSERTAFTER);
|
||||||
ok(i == 2, "i=%d\n", i);
|
ok(i == 2, "i=%d\n", i);
|
||||||
/* DPAS_INSERTBEFORE works just like DPAS_INSERTAFTER */
|
/* DPAS_INSERTBEFORE works just like DPAS_INSERTAFTER */
|
||||||
i = pDPA_Search(dpa, (PVOID)3, 0,
|
i = pDPA_Search(dpa, (PVOID)3, 0,
|
||||||
CB_CmpLT, 0xdeadbeef, DPAS_SORTED|DPAS_INSERTBEFORE);
|
CB_CmpLT, 0x1abe11ed, DPAS_SORTED|DPAS_INSERTBEFORE);
|
||||||
ok(i == 2, "i=%d\n", i);
|
ok(i == 2, "i=%d\n", i);
|
||||||
/* without DPAS_INSERTBEFORE/AFTER */
|
/* without DPAS_INSERTBEFORE/AFTER */
|
||||||
i = pDPA_Search(dpa, (PVOID)3, 0,
|
i = pDPA_Search(dpa, (PVOID)3, 0,
|
||||||
CB_CmpLT, 0xdeadbeef, DPAS_SORTED);
|
CB_CmpLT, 0x1abe11ed, DPAS_SORTED);
|
||||||
ok(i == -1, "i=%d\n", i);
|
ok(i == -1, "i=%d\n", i);
|
||||||
|
|
||||||
/* Re-insert the item */
|
/* Re-insert the item */
|
||||||
|
@ -334,7 +334,7 @@ static void test_dpa(void)
|
||||||
* should be bogus */
|
* should be bogus */
|
||||||
for(i = 0; i < 6; i++)
|
for(i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
INT j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, 0, CB_CmpGT, 0xdeadbeef,
|
INT j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, 0, CB_CmpGT, 0x1abe11ed,
|
||||||
DPAS_SORTED|DPAS_INSERTBEFORE);
|
DPAS_SORTED|DPAS_INSERTBEFORE);
|
||||||
ok(j != i, "i=%d\n", i);
|
ok(j != i, "i=%d\n", i);
|
||||||
}
|
}
|
||||||
|
@ -396,7 +396,7 @@ static void test_DPA_Merge(void)
|
||||||
/* Delete all odd entries from dpa2 */
|
/* Delete all odd entries from dpa2 */
|
||||||
memset(nMessages, 0, sizeof(nMessages));
|
memset(nMessages, 0, sizeof(nMessages));
|
||||||
pDPA_Merge(dpa2, dpa, DPAM_INTERSECT,
|
pDPA_Merge(dpa2, dpa, DPAM_INTERSECT,
|
||||||
CB_CmpLT, CB_MergeDeleteOddSrc, 0xdeadbeef);
|
CB_CmpLT, CB_MergeDeleteOddSrc, 0x1abe11ed);
|
||||||
rc = CheckDPA(dpa2, 0x246, &dw);
|
rc = CheckDPA(dpa2, 0x246, &dw);
|
||||||
ok(rc, "dw=0x%x\n", dw);
|
ok(rc, "dw=0x%x\n", dw);
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ static void test_DPA_Merge(void)
|
||||||
/* DPAM_INTERSECT - returning source while merging */
|
/* DPAM_INTERSECT - returning source while merging */
|
||||||
memset(nMessages, 0, sizeof(nMessages));
|
memset(nMessages, 0, sizeof(nMessages));
|
||||||
pDPA_Merge(dpa2, dpa, DPAM_INTERSECT,
|
pDPA_Merge(dpa2, dpa, DPAM_INTERSECT,
|
||||||
CB_CmpLT, CB_MergeInsertSrc, 0xdeadbeef);
|
CB_CmpLT, CB_MergeInsertSrc, 0x1abe11ed);
|
||||||
rc = CheckDPA(dpa2, 0x135, &dw);
|
rc = CheckDPA(dpa2, 0x135, &dw);
|
||||||
ok(rc, "dw=0x%x\n", dw);
|
ok(rc, "dw=0x%x\n", dw);
|
||||||
|
|
||||||
|
@ -433,7 +433,7 @@ static void test_DPA_Merge(void)
|
||||||
|
|
||||||
memset(nMessages, 0, sizeof(nMessages));
|
memset(nMessages, 0, sizeof(nMessages));
|
||||||
pDPA_Merge(dpa2, dpa, DPAM_UNION,
|
pDPA_Merge(dpa2, dpa, DPAM_UNION,
|
||||||
CB_CmpLT, CB_MergeInsertSrc, 0xdeadbeef);
|
CB_CmpLT, CB_MergeInsertSrc, 0x1abe11ed);
|
||||||
rc = CheckDPA(dpa2, 0x123456, &dw);
|
rc = CheckDPA(dpa2, 0x123456, &dw);
|
||||||
ok(rc ||
|
ok(rc ||
|
||||||
broken(!rc && dw == 0x23456), /* 4.7x */
|
broken(!rc && dw == 0x23456), /* 4.7x */
|
||||||
|
@ -448,7 +448,7 @@ static void test_DPA_Merge(void)
|
||||||
/* Merge dpa3 into dpa2 and dpa */
|
/* Merge dpa3 into dpa2 and dpa */
|
||||||
memset(nMessages, 0, sizeof(nMessages));
|
memset(nMessages, 0, sizeof(nMessages));
|
||||||
pDPA_Merge(dpa, dpa3, DPAM_UNION|DPAM_SORTED,
|
pDPA_Merge(dpa, dpa3, DPAM_UNION|DPAM_SORTED,
|
||||||
CB_CmpLT, CB_MergeInsertSrc, 0xdeadbeef);
|
CB_CmpLT, CB_MergeInsertSrc, 0x1abe11ed);
|
||||||
expect(3, nMessages[DPAMM_MERGE]);
|
expect(3, nMessages[DPAMM_MERGE]);
|
||||||
expect(0, nMessages[DPAMM_DELETE]);
|
expect(0, nMessages[DPAMM_DELETE]);
|
||||||
expect(3, nMessages[DPAMM_INSERT]);
|
expect(3, nMessages[DPAMM_INSERT]);
|
||||||
|
@ -461,7 +461,7 @@ static void test_DPA_Merge(void)
|
||||||
|
|
||||||
memset(nMessages, 0, sizeof(nMessages));
|
memset(nMessages, 0, sizeof(nMessages));
|
||||||
pDPA_Merge(dpa2, dpa3, DPAM_UNION|DPAM_SORTED,
|
pDPA_Merge(dpa2, dpa3, DPAM_UNION|DPAM_SORTED,
|
||||||
CB_CmpLT, CB_MergeInsertSrc, 0xdeadbeef);
|
CB_CmpLT, CB_MergeInsertSrc, 0x1abe11ed);
|
||||||
expect(3, nMessages[DPAMM_MERGE]);
|
expect(3, nMessages[DPAMM_MERGE]);
|
||||||
expect(0, nMessages[DPAMM_DELETE]);
|
expect(0, nMessages[DPAMM_DELETE]);
|
||||||
ok(nMessages[DPAMM_INSERT] == 3 ||
|
ok(nMessages[DPAMM_INSERT] == 3 ||
|
||||||
|
@ -667,7 +667,7 @@ static void test_DPA_SaveStream(void)
|
||||||
IStream* pStm = NULL;
|
IStream* pStm = NULL;
|
||||||
DWORD dwMode, dw;
|
DWORD dwMode, dw;
|
||||||
HRESULT hRes;
|
HRESULT hRes;
|
||||||
ULONG ret;
|
INT ret;
|
||||||
INT i;
|
INT i;
|
||||||
BOOL rc;
|
BOOL rc;
|
||||||
LARGE_INTEGER liZero;
|
LARGE_INTEGER liZero;
|
||||||
|
|
Loading…
Reference in New Issue