Kamil Hornicek <tykef@atlas.cz>

- Update tests to Wine head (as of 11th of May, 2008).

svn path=/trunk/; revision=33464
This commit is contained in:
Aleksey Bragin 2008-05-12 08:33:26 +00:00
parent 0d2bc37302
commit b17882ecd8
78 changed files with 8097 additions and 1354 deletions

View file

@ -17,7 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
/*
* TODO:
* Add test for StringTableStringFromIdEx
*/
@ -33,6 +33,8 @@
#include "wine/test.h"
/* Flags for StringTableAddString and StringTableLookUpString */
#define ST_CASE_SENSITIVE_COMPARE 0x00000001
static DWORD (WINAPI *pStringTableAddString)(HSTRING_TABLE, LPWSTR, DWORD);
static VOID (WINAPI *pStringTableDestroy)(HSTRING_TABLE);
@ -54,9 +56,7 @@ HANDLE table, table2; /* Handles pointing to our tables */
static void load_it_up(void)
{
hdll = LoadLibraryA("setupapi.dll");
if (!hdll)
return;
hdll = GetModuleHandleA("setupapi.dll");
pStringTableInitialize = (void*)GetProcAddress(hdll, "StringTableInitialize");
if (!pStringTableInitialize)
@ -96,18 +96,18 @@ static void test_StringTableAddString(void)
/* case insensitive */
hstring=pStringTableAddString(table,string,0);
ok(hstring!=-1,"Failed to add string to String Table\n");
retval=pStringTableAddString(table,String,0);
ok(retval!=-1,"Failed to add String to String Table\n");
ok(hstring==retval,"string handle %lx != String handle %lx in String Table\n", hstring, retval);
ok(retval!=-1,"Failed to add String to String Table\n");
ok(hstring==retval,"string handle %x != String handle %x in String Table\n", hstring, retval);
hfoo=pStringTableAddString(table,foo,0);
ok(hfoo!=-1,"Failed to add foo to String Table\n");
ok(hfoo!=hstring,"foo and string share the same ID %lx in String Table\n", hfoo);
/* case sensitive */
ok(hfoo!=-1,"Failed to add foo to String Table\n");
ok(hfoo!=hstring,"foo and string share the same ID %x in String Table\n", hfoo);
/* case sensitive */
hString=pStringTableAddString(table,String,ST_CASE_SENSITIVE_COMPARE);
ok(hstring!=hString,"String handle and string share same ID %lx in Table\n", hstring);
ok(hstring!=hString,"String handle and string share same ID %x in Table\n", hstring);
}
static void test_StringTableDuplicate(void)
@ -117,41 +117,41 @@ static void test_StringTableDuplicate(void)
}
static void test_StringTableLookUpString(void)
{
{
DWORD retval, retval2;
/* case insensitive */
retval=pStringTableLookUpString(table,string,0);
ok(retval!=-1,"Failed find string in String Table 1\n");
ok(retval==hstring,
"Lookup for string (%lx) does not match previous handle (%lx) in String Table 1\n",
retval, hstring);
"Lookup for string (%x) does not match previous handle (%x) in String Table 1\n",
retval, hstring);
retval=pStringTableLookUpString(table2,string,0);
ok(retval!=-1,"Failed find string in String Table 2\n");
retval=pStringTableLookUpString(table,String,0);
ok(retval!=-1,"Failed find String in String Table 1\n");
retval=pStringTableLookUpString(table2,String,0);
ok(retval!=-1,"Failed find String in String Table 2\n");
ok(retval!=-1,"Failed find String in String Table 2\n");
retval=pStringTableLookUpString(table,foo,0);
ok(retval!=-1,"Failed find foo in String Table 1\n");
ok(retval!=-1,"Failed find foo in String Table 1\n");
ok(retval==hfoo,
"Lookup for foo (%lx) does not match previous handle (%lx) in String Table 1\n",
retval, hfoo);
"Lookup for foo (%x) does not match previous handle (%x) in String Table 1\n",
retval, hfoo);
retval=pStringTableLookUpString(table2,foo,0);
ok(retval!=-1,"Failed find foo in String Table 2\n");
ok(retval!=-1,"Failed find foo in String Table 2\n");
/* case sensitive */
retval=pStringTableLookUpString(table,string,ST_CASE_SENSITIVE_COMPARE);
retval2=pStringTableLookUpString(table,String,ST_CASE_SENSITIVE_COMPARE);
retval2=pStringTableLookUpString(table,String,ST_CASE_SENSITIVE_COMPARE);
ok(retval!=retval2,"Lookup of string equals String in Table 1\n");
ok(retval2==hString,
"Lookup for String (%lx) does not match previous handle (%lx) in String Table 1\n",
retval, hString);
"Lookup for String (%x) does not match previous handle (%x) in String Table 1\n",
retval, hString);
}
static void test_StringTableStringFromId(void)
@ -162,7 +162,7 @@ static void test_StringTableStringFromId(void)
/* correct */
string2=pStringTableStringFromId(table,pStringTableLookUpString(table,string,0));
ok(string2!=NULL,"Failed to look up string by ID from String Table\n");
result=lstrcmpiW(string, string2);
ok(result==0,"StringID %p does not match requested StringID %p\n",string,string2);
@ -184,9 +184,7 @@ START_TEST(stringtable)
test_StringTableLookUpString();
test_StringTableStringFromId();
/* assume we can always distroy */
/* assume we can always destroy */
pStringTableDestroy(table);
pStringTableDestroy(table2);
FreeLibrary(hdll);
}