Author: akhaldi
Date: Mon Dec 10 14:29:16 2012
New Revision: 57862
URL:
http://svn.reactos.org/svn/reactos?rev=57862&view=rev
Log:
[ADVPACK_WINETEST]: Sync with Wine 1.5.19.
Modified:
trunk/rostests/winetests/advpack/CMakeLists.txt
trunk/rostests/winetests/advpack/files.c
trunk/rostests/winetests/advpack/install.c
Modified: trunk/rostests/winetests/advpack/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/advpack/CMakeLi…
==============================================================================
--- trunk/rostests/winetests/advpack/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/winetests/advpack/CMakeLists.txt [iso-8859-1] Mon Dec 10 14:29:16 2012
@@ -1,7 +1,5 @@
-add_definitions(
- -D__ROS_LONG64__
- -D_DLL -D__USE_CRTIMP)
+add_definitions(-D__ROS_LONG64__)
list(APPEND SOURCE
advpack.c
@@ -10,9 +8,7 @@
testlist.c)
add_executable(advpack_winetest ${SOURCE})
-
target_link_libraries(advpack_winetest wine)
-
set_module_type(advpack_winetest win32cui)
-add_importlibs(advpack_winetest cabinet advapi32 msvcrt kernel32 ntdll)
+add_importlibs(advpack_winetest advpack cabinet advapi32 msvcrt kernel32 ntdll)
add_cd_file(TARGET advpack_winetest DESTINATION reactos/bin FOR all)
Modified: trunk/rostests/winetests/advpack/files.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/advpack/files.c…
==============================================================================
--- trunk/rostests/winetests/advpack/files.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/advpack/files.c [iso-8859-1] Mon Dec 10 14:29:16 2012
@@ -32,6 +32,7 @@
static HMODULE hAdvPack;
static HRESULT (WINAPI *pAddDelBackupEntry)(LPCSTR, LPCSTR, LPCSTR, DWORD);
static HRESULT (WINAPI *pExtractFiles)(LPCSTR, LPCSTR, DWORD, LPCSTR, LPVOID, DWORD);
+static HRESULT (WINAPI *pExtractFilesW)(const WCHAR*,const WCHAR*,DWORD,const
WCHAR*,void*,DWORD);
static HRESULT (WINAPI *pAdvInstallFile)(HWND,LPCSTR,LPCSTR,LPCSTR,LPCSTR,DWORD,DWORD);
static CHAR CURR_DIR[MAX_PATH];
@@ -44,6 +45,7 @@
{
pAddDelBackupEntry = (void *)GetProcAddress(hAdvPack,
"AddDelBackupEntry");
pExtractFiles = (void *)GetProcAddress(hAdvPack, "ExtractFiles");
+ pExtractFilesW = (void *)GetProcAddress(hAdvPack, "ExtractFilesW");
pAdvInstallFile = (void*)GetProcAddress(hAdvPack, "AdvInstallFile");
}
}
@@ -468,13 +470,29 @@
ok(!DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to not
exist\n");
ok(!DeleteFileA("dest\\testdir\\c.txt"), "Expected
dest\\testdir\\c.txt to not exist\n");
ok(!RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to not
exist\n");
+
+ if(pExtractFilesW) {
+ static const WCHAR extract_cabW[] =
{'e','x','t','r','a','c','t','.','c','a','b',0};
+ static const WCHAR destW[] =
{'d','e','s','t',0};
+ static const WCHAR file_listW[] =
+
{'a','.','t','x','t',':','t','e','s','t','d','i','r','\\','c','.','t','x','t',0};
+
+ hr = pExtractFilesW(extract_cabW, destW, 0, file_listW, NULL, 0);
+ ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to
exist\n");
+ ok(DeleteFileA("dest\\testdir\\c.txt"), "Expected
dest\\testdir\\c.txt to exist\n");
+ ok(RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to
exist\n");
+ ok(!DeleteFileA("dest\\b.txt"), "Expected dest\\b.txt to not
exist\n");
+ ok(!DeleteFileA("dest\\testdir\\d.txt"), "Expected
dest\\testdir\\d.txt to not exist\n");
+ }else {
+ win_skip("ExtractFilesW not available\n");
+ }
}
static void test_AdvInstallFile(void)
{
HRESULT hr;
HMODULE hmod;
- char CURR_DIR[MAX_PATH];
char destFolder[MAX_PATH];
hmod = LoadLibrary("setupapi.dll");
@@ -485,8 +503,6 @@
}
FreeLibrary(hmod);
-
- GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
lstrcpyA(destFolder, CURR_DIR);
lstrcatA(destFolder, "\\");
Modified: trunk/rostests/winetests/advpack/install.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/advpack/install…
==============================================================================
--- trunk/rostests/winetests/advpack/install.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/advpack/install.c [iso-8859-1] Mon Dec 10 14:29:16 2012
@@ -259,6 +259,12 @@
if (!init_function_pointers())
return;
+ if (!IsNTAdmin(0, NULL))
+ {
+ skip("Most tests need admin rights\n");
+ return;
+ }
+
GetCurrentDirectoryA(MAX_PATH, prev_path);
GetTempPath(MAX_PATH, temp_path);
SetCurrentDirectoryA(temp_path);