Author: cwittich Date: Tue Oct 20 23:40:20 2009 New Revision: 43659
URL: http://svn.reactos.org/svn/reactos?rev=43659&view=rev Log: -sync mapi32_winetest with wine 1.1.31
Added: trunk/rostests/winetests/mapi32/mapi32_test.h (with props) Modified: trunk/rostests/winetests/mapi32/imalloc.c trunk/rostests/winetests/mapi32/mapi32.rbuild trunk/rostests/winetests/mapi32/prop.c trunk/rostests/winetests/mapi32/util.c
Modified: trunk/rostests/winetests/mapi32/imalloc.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mapi32/imalloc.c... ============================================================================== --- trunk/rostests/winetests/mapi32/imalloc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/mapi32/imalloc.c [iso-8859-1] Tue Oct 20 23:40:20 2009 @@ -26,6 +26,7 @@ #include "winerror.h" #include "winnt.h" #include "mapiutil.h" +#include "mapi32_test.h"
static HMODULE hMapi32 = 0;
@@ -88,6 +89,12 @@ { SCODE ret;
+ if (!HaveDefaultMailClient()) + { + win_skip("No default mail client installed\n"); + return; + } + hMapi32 = LoadLibraryA("mapi32.dll");
pScInitMapiUtil = (void*)GetProcAddress(hMapi32, "ScInitMapiUtil@4"); @@ -106,6 +113,12 @@ FreeLibrary(hMapi32); return; } + else if ((ret == E_FAIL) && (GetLastError() == ERROR_INVALID_HANDLE)) + { + win_skip("ScInitMapiUtil doesn't work on some Win98 and WinME systems\n"); + FreeLibrary(hMapi32); + return; + }
test_IMalloc();
Modified: trunk/rostests/winetests/mapi32/mapi32.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mapi32/mapi32.rb... ============================================================================== --- trunk/rostests/winetests/mapi32/mapi32.rbuild [iso-8859-1] (original) +++ trunk/rostests/winetests/mapi32/mapi32.rbuild [iso-8859-1] Tue Oct 20 23:40:20 2009 @@ -10,6 +10,7 @@ <file>testlist.c</file> <library>wine</library> <library>kernel32</library> + <library>advapi32</library> <library>uuid</library> <library>ntdll</library> </module>
Added: trunk/rostests/winetests/mapi32/mapi32_test.h URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mapi32/mapi32_te... ============================================================================== --- trunk/rostests/winetests/mapi32/mapi32_test.h (added) +++ trunk/rostests/winetests/mapi32/mapi32_test.h [iso-8859-1] Tue Oct 20 23:40:20 2009 @@ -1,0 +1,62 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* + * Return FALSE if no default mail client is installed. + */ +static BOOL HaveDefaultMailClient(void) +{ + HKEY Key; + DWORD Type, Size; + BYTE Buffer[64]; + BOOL HasHKCUKey; + + /* We check the default value of both HKCU\Software\Clients\Mail and + * HKLM\Software\Clients\Mail, if one of them is present there is a default + * mail client. If neither of these keys is present, we might be running + * on an old Windows version (W95, NT4) and we assume a default mail client + * might be available. Only if one of the keys is present, but there is + * no default value do we assume there is no default client. */ + if (RegOpenKeyExA(HKEY_CURRENT_USER, "SOFTWARE\Clients\Mail", 0, KEY_QUERY_VALUE, &Key) == ERROR_SUCCESS) + { + Size = sizeof(Buffer); + /* Any return value besides ERROR_FILE_NOT_FOUND (including success, + ERROR_MORE_DATA) indicates the value is present */ + if (RegQueryValueExA(Key, NULL, NULL, &Type, Buffer, &Size) != ERROR_FILE_NOT_FOUND) + { + RegCloseKey(Key); + return TRUE; + } + RegCloseKey(Key); + HasHKCUKey = TRUE; + } + else + HasHKCUKey = FALSE; + + if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\Clients\Mail", 0, KEY_QUERY_VALUE, &Key) == ERROR_SUCCESS) + { + Size = sizeof(Buffer); + if (RegQueryValueExA(Key, NULL, NULL, &Type, Buffer, &Size) != ERROR_FILE_NOT_FOUND) + { + RegCloseKey(Key); + return TRUE; + } + RegCloseKey(Key); + return FALSE; + } + + return ! HasHKCUKey; +}
Propchange: trunk/rostests/winetests/mapi32/mapi32_test.h ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/rostests/winetests/mapi32/prop.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mapi32/prop.c?re... ============================================================================== --- trunk/rostests/winetests/mapi32/prop.c [iso-8859-1] (original) +++ trunk/rostests/winetests/mapi32/prop.c [iso-8859-1] Tue Oct 20 23:40:20 2009 @@ -27,6 +27,7 @@ #include "initguid.h" #include "mapiutil.h" #include "mapitags.h" +#include "mapi32_test.h"
static HMODULE hMapi32 = 0;
@@ -239,7 +240,7 @@ }
res = pUlPropSize(&pv); - ok(res == exp || broken(!res) /* Win9x */, + ok(res == exp, "pt= %d: Expected %d, got %d\n", pt, exp, res); } } @@ -281,30 +282,30 @@ pvRight.Value.lpszA = szFull;
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING); - ok(bRet == TRUE || broken(!bRet) /* Win9x */, "(full,full)[] match failed\n"); + ok(bRet == TRUE, "(full,full)[] match failed\n"); pvRight.Value.lpszA = szPrefix; bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING); ok(bRet == FALSE, "(full,prefix)[] match failed\n"); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX); ok(bRet == TRUE, "(full,prefix)[PREFIX] match failed\n"); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING); - ok(bRet == TRUE || broken(!bRet) /* Win9x */, "(full,prefix)[SUBSTRING] match failed\n"); + ok(bRet == TRUE, "(full,prefix)[SUBSTRING] match failed\n"); pvRight.Value.lpszA = szPrefixLower; bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX); ok(bRet == FALSE, "(full,prefixlow)[PREFIX] match failed\n"); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING); ok(bRet == FALSE, "(full,prefixlow)[SUBSTRING] match failed\n"); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX|FL_IGNORECASE); - ok(bRet == TRUE || broken(!bRet) /* Win9x */, "(full,prefixlow)[PREFIX|IGNORECASE] match failed\n"); + ok(bRet == TRUE, "(full,prefixlow)[PREFIX|IGNORECASE] match failed\n"); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING|FL_IGNORECASE); - ok(bRet == TRUE || broken(!bRet) /* Win9x */, "(full,prefixlow)[SUBSTRING|IGNORECASE] match failed\n"); + ok(bRet == TRUE, "(full,prefixlow)[SUBSTRING|IGNORECASE] match failed\n"); pvRight.Value.lpszA = szSubstring; bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING); ok(bRet == FALSE, "(full,substr)[] match failed\n"); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX); ok(bRet == FALSE, "(full,substr)[PREFIX] match failed\n"); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING); - ok(bRet == TRUE || broken(!bRet) /* Win9x */, "(full,substr)[SUBSTRING] match failed\n"); + ok(bRet == TRUE, "(full,substr)[SUBSTRING] match failed\n"); pvRight.Value.lpszA = szSubstringLower; bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX); ok(bRet == FALSE, "(full,substrlow)[PREFIX] match failed\n"); @@ -313,10 +314,10 @@ bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX|FL_IGNORECASE); ok(bRet == FALSE, "(full,substrlow)[PREFIX|IGNORECASE] match failed\n"); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING|FL_IGNORECASE); - ok(bRet == TRUE || broken(!bRet) /* Win9x */, "(full,substrlow)[SUBSTRING|IGNORECASE] match failed\n"); + ok(bRet == TRUE, "(full,substrlow)[SUBSTRING|IGNORECASE] match failed\n"); pvRight.Value.lpszA = szFullLower; bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING|FL_IGNORECASE); - ok(bRet == TRUE || broken(!bRet) /* Win9x */, "(full,fulllow)[IGNORECASE] match failed\n"); + ok(bRet == TRUE, "(full,fulllow)[IGNORECASE] match failed\n");
pvLeft.ulPropTag = pvRight.ulPropTag = PT_BINARY; pvLeft.Value.bin.lpb = (LPBYTE)szFull; @@ -324,15 +325,15 @@ pvLeft.Value.bin.cb = pvRight.Value.bin.cb = strlen(szFull);
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING); - ok(bRet == TRUE || broken(!bRet) /* Win9x */, "bin(full,full)[] match failed\n"); + ok(bRet == TRUE, "bin(full,full)[] match failed\n"); pvRight.Value.bin.lpb = (LPBYTE)szPrefix; pvRight.Value.bin.cb = strlen(szPrefix); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING); ok(bRet == FALSE, "bin(full,prefix)[] match failed\n"); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX); - ok(bRet == TRUE || broken(!bRet) /* Win9x */, "bin(full,prefix)[PREFIX] match failed\n"); + ok(bRet == TRUE, "bin(full,prefix)[PREFIX] match failed\n"); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING); - ok(bRet == TRUE || broken(!bRet) /* Win9x */, "bin(full,prefix)[SUBSTRING] match failed\n"); + ok(bRet == TRUE, "bin(full,prefix)[SUBSTRING] match failed\n"); pvRight.Value.bin.lpb = (LPBYTE)szPrefixLower; pvRight.Value.bin.cb = strlen(szPrefixLower); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX); @@ -350,7 +351,7 @@ bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX); ok(bRet == FALSE, "bin(full,substr)[PREFIX] match failed\n"); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING); - ok(bRet == TRUE || broken(!bRet) /* Win9x */, "bin(full,substr)[SUBSTRING] match failed\n"); + ok(bRet == TRUE, "bin(full,substr)[SUBSTRING] match failed\n"); pvRight.Value.bin.lpb = (LPBYTE)szSubstringLower; pvRight.Value.bin.cb = strlen(szSubstringLower); bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX); @@ -503,7 +504,7 @@ }
bRet = pFPropCompareProp(&pvLeft, FPCProp_Results[j].relOp, &pvRight); - ok(bRet == bExp || broken(!bRet) /* Win9x */, + ok(bRet == bExp, "pt %d (%d,%d,%s): expected %d, got %d\n", ptTypes[i], FPCProp_Results[j].lVal, FPCProp_Results[j].rVal, relops[FPCProp_Results[j].relOp], bExp, bRet); @@ -627,7 +628,7 @@ }
iRet = pLPropCompareProp(&pvLeft, &pvRight); - ok(iRet == iExp || broken(iRet == 0) /* Win9x */, + ok(iRet == iExp, "pt %d (%d,%d): expected %d, got %d\n", ptTypes[i], LPCProp_Results[j].lVal, LPCProp_Results[j].rVal, iExp, iRet); } @@ -649,7 +650,7 @@ pvProp.ulPropTag = ptTypes[i];
pRet = pPpropFindProp(&pvProp, 1u, ptTypes[i]); - ok(pRet == &pvProp || broken(pRet != &pvProp) /* Win9x */, + ok(pRet == &pvProp, "PpropFindProp[%d]: Didn't find existing propery\n", ptTypes[i]);
@@ -886,7 +887,7 @@ pvProp.ulPropTag = PROP_TAG(ptTypes[i], 1u);
pRet = pLpValFindProp(PROP_TAG(ptTypes[i], 1u), 1u, &pvProp); - ok(pRet == &pvProp || broken(pRet != &pvProp) /* Win9x */, + ok(pRet == &pvProp, "LpValFindProp[%d]: Didn't find existing propery id/type\n", ptTypes[i]);
@@ -899,7 +900,7 @@ ptTypes[i]);
pRet = pLpValFindProp(PROP_TAG(PT_NULL, 1u), 1u, &pvProp); - ok(pRet == &pvProp || broken(pRet != &pvProp) /* Win9x */, + ok(pRet == &pvProp, "LpValFindProp[%d]: Didn't find existing propery id\n", ptTypes[i]); } @@ -996,7 +997,7 @@ if (bBad) ok(res != 0, "pt= %d: Expected non-zero, got 0\n", pt); else - ok(res == 0 || broken(res) /* Win9x */, + ok(res == 0, "pt= %d: Expected zero, got %d\n", pt, res); } } @@ -1086,7 +1087,7 @@ if (bBad) ok(res != 0, "pt= %d: Expected non-zero, got 0\n", pt); else - ok(res == 0 || broken(res) /* Win9x */, + ok(res == 0, "pt= %d: Expected zero, got %d\n", pt, res); } } @@ -1138,7 +1139,7 @@ if (bBad) ok(res != 0, "pt= %d: Expected non-zero, got 0\n", pt); else - ok(res == 0 || broken(res) /* Win9x */, + ok(res == 0, "pt= %d: Expected zero, got %d\n", pt, res); } } @@ -1360,6 +1361,12 @@ { SCODE ret;
+ if (!HaveDefaultMailClient()) + { + win_skip("No default mail client installed\n"); + return; + } + if(!InitFuncPtrs()) { win_skip("Needed functions are not available\n"); @@ -1371,6 +1378,12 @@ if ((ret != S_OK) && (GetLastError() == ERROR_PROC_NOT_FOUND)) { win_skip("ScInitMapiUtil is not implemented\n"); + FreeLibrary(hMapi32); + return; + } + else if ((ret == E_FAIL) && (GetLastError() == ERROR_INVALID_HANDLE)) + { + win_skip("ScInitMapiUtil doesn't work on some Win98 and WinME systems\n"); FreeLibrary(hMapi32); return; }
Modified: trunk/rostests/winetests/mapi32/util.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mapi32/util.c?re... ============================================================================== --- trunk/rostests/winetests/mapi32/util.c [iso-8859-1] (original) +++ trunk/rostests/winetests/mapi32/util.c [iso-8859-1] Tue Oct 20 23:40:20 2009 @@ -26,6 +26,7 @@ #include "winnt.h" #include "mapiutil.h" #include "mapitags.h" +#include "mapi32_test.h"
static HMODULE hMapi32 = 0;
@@ -51,8 +52,7 @@ shorts[1] = 0x10ff; shorts[2] = 0x2001; pSwapPword(shorts, 2); - ok((shorts[0] == 0x01ff && shorts[1] == 0xff10 && shorts[2] == 0x2001) || - broken(shorts[0] == 0xff01 && shorts[1] == 0x10ff && shorts[2] == 0x2001) /* Win9x */, + ok((shorts[0] == 0x01ff && shorts[1] == 0xff10 && shorts[2] == 0x2001), "Expected {0x01ff,0xff10,0x2001}, got {0x%04x,0x%04x,0x%04x}\n", shorts[0], shorts[1], shorts[2]); } @@ -69,8 +69,7 @@ longs[1] = 0x1000ffff; longs[2] = 0x20000001; pSwapPlong(longs, 2); - ok((longs[0] == 0x0100ffff && longs[1] == 0xffff0010 && longs[2] == 0x20000001) || - broken(longs[0] == 0xffff0001 && longs[1] == 0x1000ffff && longs[2] == 0x20000001) /* Win9x */, + ok((longs[0] == 0x0100ffff && longs[1] == 0xffff0010 && longs[2] == 0x20000001), "Expected {0x0100ffff,0xffff0010,0x20000001}, got {0x%08x,0x%08x,0x%08x}\n", longs[0], longs[1], longs[2]); } @@ -153,7 +152,7 @@ memset(buff, '\0', sizeof(buff)); memset(buff, '?', i); ulRet = pCbOfEncoded(buff); - ok(ulRet == ulExpected || broken(ulRet == 0) /* Win9x */, + ok(ulRet == ulExpected, "CbOfEncoded(length %d): expected %d, got %d\n", i, ulExpected, ulRet); } @@ -174,6 +173,12 @@ { SCODE ret;
+ if (!HaveDefaultMailClient()) + { + win_skip("No default mail client installed\n"); + return; + } + hMapi32 = LoadLibraryA("mapi32.dll");
pScInitMapiUtil = (void*)GetProcAddress(hMapi32, "ScInitMapiUtil@4"); @@ -190,6 +195,12 @@ if ((ret != S_OK) && (GetLastError() == ERROR_PROC_NOT_FOUND)) { win_skip("ScInitMapiUtil is not implemented\n"); + FreeLibrary(hMapi32); + return; + } + else if ((ret == E_FAIL) && (GetLastError() == ERROR_INVALID_HANDLE)) + { + win_skip("ScInitMapiUtil doesn't work on some Win98 and WinME systems\n"); FreeLibrary(hMapi32); return; }