Author: akhaldi
Date: Sat Jul 2 13:01:07 2016
New Revision: 71729
URL:
http://svn.reactos.org/svn/reactos?rev=71729&view=rev
Log:
[VERSION_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368
Modified:
trunk/rostests/winetests/version/CMakeLists.txt
trunk/rostests/winetests/version/install.c
Modified: trunk/rostests/winetests/version/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/version/CMakeLi…
==============================================================================
--- trunk/rostests/winetests/version/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/winetests/version/CMakeLists.txt [iso-8859-1] Sat Jul 2 13:01:07 2016
@@ -8,7 +8,7 @@
add_executable(version_winetest ${SOURCE} version.rc)
set_module_type(version_winetest win32cui)
-add_importlibs(version_winetest version msvcrt kernel32)
+add_importlibs(version_winetest shell32 version msvcrt kernel32)
if(MSVC)
add_importlibs(version_winetest ntdll)
Modified: trunk/rostests/winetests/version/install.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/version/install…
==============================================================================
--- trunk/rostests/winetests/version/install.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/version/install.c [iso-8859-1] Sat Jul 2 13:01:07 2016
@@ -24,11 +24,13 @@
#include "winbase.h"
#include "winerror.h"
#include "winver.h"
+#include "shlobj.h"
static void test_find_file(void)
{
DWORD ret;
UINT dwCur, dwOut ;
+ char tmp[MAX_PATH];
char appdir[MAX_PATH];
char curdir[MAX_PATH];
char filename[MAX_PATH];
@@ -115,10 +117,11 @@
}
}
}
- if(!GetModuleFileNameA(NULL, filename, MAX_PATH) ||
- !GetSystemDirectoryA(windir, MAX_PATH) ||
- !GetTempPathA(MAX_PATH, appdir))
- trace("GetModuleFileNameA, GetSystemDirectoryA or GetTempPathA
failed\n");
+ if(!GetSystemDirectoryA(windir, MAX_PATH) ||
+ !SHGetSpecialFolderPathA(0, appdir, CSIDL_PROGRAM_FILES, FALSE) ||
+ !GetTempPathA(MAX_PATH, tmp) ||
+ !GetTempFileNameA(tmp, "tes", 0, filename))
+ ok(0, "GetSystemDirectoryA, SHGetSpecialFolderPathA, GetTempPathA or
GetTempFileNameA failed\n");
else {
char *p = strrchr(filename, '\\');
if(p) {
@@ -150,7 +153,7 @@
memset(outBuf, 0, MAX_PATH);
memset(curdir, 0, MAX_PATH);
ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, appdir, curdir, &dwCur,
outBuf, &dwOut);
- todo_wine ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected
VFF_CURNEDEST\n", ret);
+ ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected
VFF_CURNEDEST\n", ret);
ok(dwOut == 1 + strlen(windir), "Wrong length of buffer for current
location: "
"got %d(%s) expected %d\n", dwOut, outBuf, lstrlenA(windir)+1);
@@ -159,9 +162,145 @@
memset(outBuf, 0, MAX_PATH);
memset(curdir, 0, MAX_PATH);
ret = VerFindFileA(0, filename, NULL, appdir, curdir, &dwCur, outBuf,
&dwOut);
- todo_wine ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected
VFF_CURNEDEST\n", ret);
+ ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected
VFF_CURNEDEST\n", ret);
ok(dwOut == 1 + strlen(appdir), "Wrong length of buffer for current
location: "
"got %d(%s) expected %d\n", dwOut, outBuf, lstrlenA(appdir)+1);
+
+ /* search for filename */
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, filename, NULL, NULL, curdir, &dwCur, outBuf,
&dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, filename, NULL, empty, curdir, &dwCur, outBuf,
&dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, filename, NULL, appdir, curdir, &dwCur, outBuf,
&dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, NULL, curdir, &dwCur,
outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, empty, curdir, &dwCur,
outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, appdir, curdir, &dwCur,
outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ /* search for regedit */
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "regedit", NULL, NULL, curdir, &dwCur,
outBuf, &dwOut);
+ ok(!ret, "Wrong return value got %x expected 0\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "regedit", NULL, empty, curdir, &dwCur,
outBuf, &dwOut);
+ ok(!ret, "Wrong return value got %x expected 0\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "regedit", NULL, appdir, curdir, &dwCur,
outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit", NULL, NULL, curdir,
&dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit", NULL, empty, curdir,
&dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit", NULL, appdir, curdir,
&dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ /* search for regedit.exe */
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "regedit.exe", NULL, NULL, curdir, &dwCur,
outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "regedit.exe", NULL, empty, curdir, &dwCur,
outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "regedit.exe", NULL, appdir, curdir, &dwCur,
outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit.exe", NULL, NULL,
curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit.exe", NULL, empty,
curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit.exe", NULL, appdir,
curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ /* nonexistent filename */
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "doesnotexist.exe", NULL, NULL, curdir,
&dwCur, outBuf, &dwOut);
+ ok(!ret, "Wrong return value got %x expected 0\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "doesnotexist.exe", NULL, empty, curdir,
&dwCur, outBuf, &dwOut);
+ ok(!ret, "Wrong return value got %x expected 0\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "doesnotexist.exe", NULL, appdir, curdir,
&dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "doesnotexist.exe", NULL,
"C:\\random_path_does_not_exist", curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "doesnotexist.exe", NULL, NULL,
curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "doesnotexist.exe", NULL, empty,
curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "doesnotexist.exe", NULL, appdir,
curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "doesnotexist.exe", NULL,
"C:\\random_path_does_not_exist", curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected
VFF_CURNEDEST set\n", ret);
+
+ DeleteFileA(filename);
}
}