DPA_Create/Search may be missing
Francois Gouget
fgouget at free.fr
Fri Jan 16 04:57:27 CST 2004
On NT4 (or is that on Internet Explorer <=5?), comctl32 is missing entry
points for DPA_Create and DPA_Search. So we need to link them
dynamically if we want the rest of the tests to run.
Changelog:
* dlls/comctl32/tests/dpa.c
Use GetProcAddress for DPA_Create and DPA_Search.
Add '\n' to 'ok' calls.
Index: dlls/comctl32/tests/dpa.c
===================================================================
RCS file: /home/cvs/wine/dlls/comctl32/tests/dpa.c,v
retrieving revision 1.2
diff -u -r1.2 dpa.c
--- dlls/comctl32/tests/dpa.c 5 Sep 2003 23:08:42 -0000 1.2
+++ dlls/comctl32/tests/dpa.c 15 Jan 2004 19:34:54 -0000
@@ -29,11 +29,14 @@
#include "wine/test.h"
+static HDPA (WINAPI *pDPA_Create)(int);
+static int (WINAPI *pDPA_Search)(HDPA,void*,int,PFNDPACOMPARE,LPARAM,UINT);
+
static INT CALLBACK dpa_strcmp(LPVOID pvstr1, LPVOID pvstr2, LPARAM flags)
{
LPCSTR str1 = (LPCSTR)pvstr1;
LPCSTR str2 = (LPCSTR)pvstr2;
-
+
return lstrcmpA (str1, str2);
}
@@ -42,19 +45,28 @@
HDPA dpa_ret;
INT int_ret;
CHAR test_str0[]="test0";
-
- dpa_ret = DPA_Create(0);
- ok((dpa_ret !=0), "DPA_Create failed");
- int_ret = DPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED);
- ok((int_ret == -1), "DPA_Search found invalid item");
- int_ret = DPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED|DPAS_INSERTBEFORE);
- ok((int_ret == 0), "DPA_Search proposed bad item");
- int_ret = DPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED|DPAS_INSERTAFTER);
- ok((int_ret == 0), "DPA_Search proposed bad item");
+
+ if (!pDPA_Create || !pDPA_Search)
+ return;
+
+ dpa_ret = pDPA_Create(0);
+ ok((dpa_ret !=0), "DPA_Create failed\n");
+ int_ret = pDPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED);
+ ok((int_ret == -1), "DPA_Search found invalid item\n");
+ int_ret = pDPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED|DPAS_INSERTBEFORE);
+ ok((int_ret == 0), "DPA_Search proposed bad item\n");
+ int_ret = pDPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED|DPAS_INSERTAFTER);
+ ok((int_ret == 0), "DPA_Search proposed bad item\n");
}
START_TEST(dpa)
{
+ HMODULE hdll;
+
+ hdll=LoadLibraryA("comctl32.dll");
+ ok(hdll!=NULL,"Couldn't load kernel32.dll (%ld)\n",GetLastError());
+ pDPA_Create=(void*)GetProcAddress(hdll,"DPA_Create");
+ pDPA_Search=(void*)GetProcAddress(hdll,"DPA_Search");
+
DPA_test();
-
}
--
Francois Gouget fgouget at free.fr http://fgouget.free.fr/
Before you criticize someone, walk a mile in his shoes.
That way, if he gets angry, he'll be a mile away - and barefoot.
More information about the wine-patches
mailing list