Commit b70a5d52 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shlwapi/tests: Compile with -D__WINESRC__.

parent 94c0604e
TESTDLL = shlwapi.dll
IMPORTS = shlwapi user32 ole32 oleaut32 advapi32
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
C_SRCS = \
assoc.c \
......
......@@ -204,17 +204,17 @@ static void test_GetAcceptLanguagesA(void)
original[0] = 0;
res_query = RegQueryValueExA(hroot, acceptlanguage, 0, NULL, (PBYTE)original, &len);
RegDeleteValue(hroot, acceptlanguage);
RegDeleteValueA(hroot, acceptlanguage);
/* Some windows versions use "lang-COUNTRY" as default */
memset(language, 0, sizeof(language));
len = GetLocaleInfoA(lcid, LOCALE_SISO639LANGNAME, language, sizeof(language));
if (len) {
lstrcat(language, "-");
lstrcatA(language, "-");
memset(buffer, 0, sizeof(buffer));
len = GetLocaleInfoA(lcid, LOCALE_SISO3166CTRYNAME, buffer, sizeof(buffer) - len - 1);
lstrcat(language, buffer);
lstrcatA(language, buffer);
}
else
{
......@@ -334,7 +334,7 @@ static void test_GetAcceptLanguagesA(void)
}
/* without a value in the registry, a default language is returned */
RegDeleteValue(hroot, acceptlanguage);
RegDeleteValueA(hroot, acceptlanguage);
len = maxlen;
memset(buffer, '#', maxlen);
......@@ -393,7 +393,7 @@ restore_original:
}
else
{
RegDeleteValue(hroot, acceptlanguage);
RegDeleteValueA(hroot, acceptlanguage);
}
RegCloseKey(hroot);
}
......@@ -1564,14 +1564,14 @@ static void test_SHSetWindowBits(void)
clsA.cbWndExtra = 0;
clsA.hInstance = GetModuleHandleA(NULL);
clsA.hIcon = 0;
clsA.hCursor = LoadCursorA(0, IDC_ARROW);
clsA.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
clsA.hbrBackground = NULL;
clsA.lpszMenuName = NULL;
clsA.lpszClassName = "Shlwapi test class";
RegisterClassA(&clsA);
hwnd = CreateWindowA("Shlwapi test class", "Test", WS_VISIBLE, 0, 0, 100, 100,
NULL, NULL, GetModuleHandle(NULL), 0);
NULL, NULL, GetModuleHandleA(NULL), 0);
ok(IsWindow(hwnd), "failed to create window\n");
/* null window */
......@@ -1687,14 +1687,14 @@ if (0)
flags = FDTF_NOAUTOREADINGORDER | FDTF_SHORTTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
ret = GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff2, sizeof(buff2));
ret = GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
flags = FDTF_NOAUTOREADINGORDER | FDTF_LONGTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
ret = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2));
ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
......@@ -1702,21 +1702,21 @@ if (0)
flags = FDTF_NOAUTOREADINGORDER | FDTF_LONGTIME | FDTF_SHORTTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
ret = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2));
ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
flags = FDTF_NOAUTOREADINGORDER | FDTF_SHORTDATE;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
flags = FDTF_NOAUTOREADINGORDER | FDTF_LONGDATE;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
......@@ -1724,7 +1724,7 @@ if (0)
flags = FDTF_NOAUTOREADINGORDER | FDTF_LONGDATE | FDTF_SHORTDATE;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
......@@ -1732,12 +1732,12 @@ if (0)
flags = FDTF_NOAUTOREADINGORDER | FDTF_LONGDATE | FDTF_SHORTTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d, length %d\n", ret, lstrlenA(buff)+1);
ret = GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3));
ret = GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3));
ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
ok(lstrcmpA(buff3, buff + lstrlenA(buff) - lstrlenA(buff3)) == 0,
"expected (%s), got (%s) for time part\n",
buff3, buff + lstrlenA(buff) - lstrlenA(buff3));
ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
buff[lstrlenA(buff2)] = '\0';
ok(lstrcmpA(buff2, buff) == 0, "expected (%s) got (%s) for date part\n",
......@@ -1746,12 +1746,12 @@ if (0)
flags = FDTF_NOAUTOREADINGORDER | FDTF_LONGDATE | FDTF_LONGTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
ret = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3));
ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3));
ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
ok(lstrcmpA(buff3, buff + lstrlenA(buff) - lstrlenA(buff3)) == 0,
"expected (%s), got (%s) for time part\n",
buff3, buff + lstrlenA(buff) - lstrlenA(buff3));
ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
buff[lstrlenA(buff2)] = '\0';
ok(lstrcmpA(buff2, buff) == 0, "expected (%s) got (%s) for date part\n",
......@@ -1760,10 +1760,10 @@ if (0)
flags = FDTF_NOAUTOREADINGORDER | FDTF_SHORTDATE | FDTF_SHORTTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
strcat(buff2, " ");
ret = GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3));
ret = GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3));
ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
strcat(buff2, buff3);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
......@@ -1771,10 +1771,10 @@ if (0)
flags = FDTF_NOAUTOREADINGORDER | FDTF_SHORTDATE | FDTF_LONGTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
strcat(buff2, " ");
ret = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3));
ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3));
ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
strcat(buff2, buff3);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
......@@ -2466,7 +2466,7 @@ static void test_SHCreateWorkerWindowA(void)
hwnd = pSHCreateWorkerWindowA(0, NULL, 0, 0, 0, 0);
ok(hwnd != 0, "expected window\n");
GetClassName(hwnd, classA, 20);
GetClassNameA(hwnd, classA, 20);
ok(lstrcmpA(classA, "WorkerA") == 0, "expected WorkerA class, got %s\n", classA);
ret = GetWindowLongPtrA(hwnd, 0);
......@@ -2474,7 +2474,7 @@ static void test_SHCreateWorkerWindowA(void)
/* class info */
memset(&cliA, 0, sizeof(cliA));
res = GetClassInfoA(GetModuleHandle("shlwapi.dll"), "WorkerA", &cliA);
res = GetClassInfoA(GetModuleHandleA("shlwapi.dll"), "WorkerA", &cliA);
ok(res, "failed to get class info\n");
ok(cliA.style == 0, "got 0x%08x\n", cliA.style);
ok(cliA.cbClsExtra == 0, "got %d\n", cliA.cbClsExtra);
......@@ -2487,7 +2487,7 @@ static void test_SHCreateWorkerWindowA(void)
hwnd = pSHCreateWorkerWindowA(0, NULL, 0, 0, 0, 0xdeadbeef);
ok(hwnd != 0, "expected window\n");
GetClassName(hwnd, classA, 20);
GetClassNameA(hwnd, classA, 20);
ok(lstrcmpA(classA, "WorkerA") == 0, "expected WorkerA class, got %s\n", classA);
ret = GetWindowLongPtrA(hwnd, 0);
......
......@@ -408,15 +408,15 @@ static void test_SHDeleteKey(void)
if (!RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY, &hKeyTest))
{
if (!RegCreateKey(hKeyTest, "ODBC", &hKeyS))
if (!RegCreateKeyA(hKeyTest, "ODBC", &hKeyS))
{
HKEY hKeyO;
if (!RegCreateKey(hKeyS, "ODBC.INI", &hKeyO))
if (!RegCreateKeyA(hKeyS, "ODBC.INI", &hKeyO))
{
RegCloseKey (hKeyO);
if (!RegCreateKey(hKeyS, "ODBCINST.INI", &hKeyO))
if (!RegCreateKeyA(hKeyS, "ODBCINST.INI", &hKeyO))
{
RegCloseKey (hKeyO);
sysfail = 0;
......
......@@ -1069,7 +1069,7 @@ if (0)
{
memset(buf, 0xbf, sizeof(buf));
strret.uType = STRRET_CSTR;
StrCpyN(U(strret).cStr, str1, MAX_PATH);
StrCpyNA(U(strret).cStr, str1, MAX_PATH);
expect_eq2(pStrRetToBufA(&strret, NULL, buf, 10), S_OK, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) /* Vista */, HRESULT, "%x");
expect_eq(buf[9], 0, CHAR, "%x");
expect_eq(buf[10], (CHAR)0xbf, CHAR, "%x");
......@@ -1484,12 +1484,12 @@ static void test_StrStrNIW(void)
START_TEST(string)
{
HMODULE hShlwapi;
TCHAR thousandDelim[8];
TCHAR decimalDelim[8];
CHAR thousandDelim[8];
CHAR decimalDelim[8];
CoInitialize(0);
GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, thousandDelim, 8);
GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimalDelim, 8);
GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, thousandDelim, 8);
GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimalDelim, 8);
hShlwapi = GetModuleHandleA("shlwapi");
pChrCmpIA = (void *)GetProcAddress(hShlwapi, "ChrCmpIA");
......
......@@ -1086,7 +1086,7 @@ static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFla
LPWSTR wszConvertedUrl;
DWORD dwSize;
DWORD dwExpectLen = lstrlen(szExpectUrl);
DWORD dwExpectLen = lstrlenA(szExpectUrl);
if (!pUrlCombineA) {
win_skip("UrlCombineA not found\n");
......@@ -1169,7 +1169,7 @@ static void test_UrlCreateFromPath(void)
len = INTERNET_MAX_URL_LENGTH;
ret = pUrlCreateFromPathA(TEST_URLFROMPATH[i].path, ret_url, &len, 0);
ok(ret == TEST_URLFROMPATH[i].ret, "ret %08x from path %s\n", ret, TEST_URLFROMPATH[i].path);
ok(!lstrcmpi(ret_url, TEST_URLFROMPATH[i].url), "url %s from path %s\n", ret_url, TEST_URLFROMPATH[i].path);
ok(!lstrcmpiA(ret_url, TEST_URLFROMPATH[i].url), "url %s from path %s\n", ret_url, TEST_URLFROMPATH[i].path);
ok(len == strlen(ret_url), "ret len %d from path %s\n", len, TEST_URLFROMPATH[i].path);
if (pUrlCreateFromPathW) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment