Release 0.9.39.
[wine/gsoc-2012-control.git] / dlls / advpack / tests / files.c
blobcbbbd3afd87d653f2eb3d4543cc023f2f5c92bdb
1 /*
2 * Unit tests for advpack.dll file functions
4 * Copyright (C) 2006 James Hawkins
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdio.h>
22 #include <windows.h>
23 #include <advpub.h>
24 #include <fci.h>
25 #include "wine/test.h"
27 /* make the max size large so there is only one cab file */
28 #define MEDIA_SIZE 999999999
29 #define FOLDER_THRESHOLD 900000
31 /* function pointers */
32 HMODULE hAdvPack;
33 static HRESULT (WINAPI *pAddDelBackupEntry)(LPCSTR, LPCSTR, LPCSTR, DWORD);
34 static HRESULT (WINAPI *pExtractFiles)(LPCSTR, LPCSTR, DWORD, LPCSTR, LPVOID, DWORD);
35 static HRESULT (WINAPI *pAdvInstallFile)(HWND,LPCSTR,LPCSTR,LPCSTR,LPCSTR,DWORD,DWORD);
37 CHAR CURR_DIR[MAX_PATH];
39 static void init_function_pointers(void)
41 hAdvPack = LoadLibraryA("advpack.dll");
43 if (hAdvPack)
45 pAddDelBackupEntry = (void *)GetProcAddress(hAdvPack, "AddDelBackupEntry");
46 pExtractFiles = (void *)GetProcAddress(hAdvPack, "ExtractFiles");
47 pAdvInstallFile = (void*)GetProcAddress(hAdvPack, "AdvInstallFile");
51 /* creates a file with the specified name for tests */
52 static void createTestFile(const CHAR *name)
54 HANDLE file;
55 DWORD written;
57 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
58 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
59 WriteFile(file, name, strlen(name), &written, NULL);
60 WriteFile(file, "\n", strlen("\n"), &written, NULL);
61 CloseHandle(file);
64 static void create_test_files(void)
66 int len;
68 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
69 len = lstrlenA(CURR_DIR);
71 if(len && (CURR_DIR[len-1] == '\\'))
72 CURR_DIR[len-1] = 0;
74 createTestFile("a.txt");
75 createTestFile("b.txt");
76 CreateDirectoryA("testdir", NULL);
77 createTestFile("testdir\\c.txt");
78 createTestFile("testdir\\d.txt");
79 CreateDirectoryA("dest", NULL);
82 static void delete_test_files(void)
84 DeleteFileA("a.txt");
85 DeleteFileA("b.txt");
86 DeleteFileA("testdir\\c.txt");
87 DeleteFileA("testdir\\d.txt");
88 RemoveDirectoryA("testdir");
89 RemoveDirectoryA("dest");
91 DeleteFileA("extract.cab");
94 static BOOL check_ini_file_attr(LPSTR filename)
96 BOOL ret;
97 DWORD expected = FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY;
98 DWORD attr = GetFileAttributesA(filename);
100 ret = (attr & expected) && (attr != INVALID_FILE_ATTRIBUTES);
101 SetFileAttributesA(filename, FILE_ATTRIBUTE_NORMAL);
103 return ret;
106 #define FIELD_LEN 16
108 static BOOL check_ini_contents(LPSTR filename, BOOL add)
110 CHAR field[FIELD_LEN];
111 BOOL ret = TRUE, match;
113 GetPrivateProfileStringA("backup", "one", NULL, field, FIELD_LEN, filename);
114 match = !lstrcmpA(field, "-1,0,0,0,0,0,-1");
115 if ((add && !match) || (!add && match))
116 ret = FALSE;
118 GetPrivateProfileStringA("backup", "two", NULL, field, FIELD_LEN, filename);
119 if (lstrcmpA(field, "-1,0,0,0,0,0,-1"))
120 ret = FALSE;
122 GetPrivateProfileStringA("backup", "three", NULL, field, FIELD_LEN, filename);
123 match = !lstrcmpA(field, "-1,0,0,0,0,0,-1");
124 if ((add && !match) || (!add && match))
125 ret = FALSE;
127 return ret;
130 static void test_AddDelBackupEntry(void)
132 HRESULT res;
133 CHAR path[MAX_PATH];
134 CHAR windir[MAX_PATH];
136 lstrcpyA(path, CURR_DIR);
137 lstrcatA(path, "\\backup\\basename.INI");
139 /* native AddDelBackupEntry crashes if lpcszBaseName is NULL */
141 /* try a NULL file list */
142 res = pAddDelBackupEntry(NULL, "backup", "basename", AADBE_ADD_ENTRY);
143 ok(res == S_OK, "Expected S_OK, got %d\n", res);
144 ok(!DeleteFileA(path), "Expected path to not exist\n");
146 lstrcpyA(path, CURR_DIR);
147 lstrcatA(path, "\\backup\\.INI");
149 /* try an empty base name */
150 res = pAddDelBackupEntry("one\0two\0three\0", "backup", "", AADBE_ADD_ENTRY);
151 ok(res == S_OK, "Expected S_OK, got %d\n", res);
152 ok(!DeleteFileA(path), "Expected path to not exist\n");
154 lstrcpyA(path, CURR_DIR);
155 lstrcatA(path, "\\basename.INI");
157 /* try an invalid flag */
158 res = pAddDelBackupEntry("one\0two\0three\0", NULL, "basename", 0);
159 ok(res == S_OK, "Expected S_OK, got %d\n", res);
160 ok(!DeleteFileA(path), "Expected path to not exist\n");
162 lstrcpyA(path, "c:\\basename.INI");
164 /* create the INF file */
165 res = pAddDelBackupEntry("one\0two\0three\0", "c:\\", "basename", AADBE_ADD_ENTRY);
166 ok(res == S_OK, "Expected S_OK, got %d\n", res);
167 ok(check_ini_file_attr(path), "Expected ini file to be hidden\n");
168 ok(check_ini_contents(path, TRUE), "Expected ini contents to match\n");
169 ok(DeleteFileA(path), "Expected path to exist\n");
171 lstrcpyA(path, CURR_DIR);
172 lstrcatA(path, "\\backup\\basename.INI");
174 /* try to create the INI file in a nonexistent directory */
175 RemoveDirectoryA("backup");
176 res = pAddDelBackupEntry("one\0two\0three\0", "backup", "basename", AADBE_ADD_ENTRY);
177 ok(res == S_OK, "Expected S_OK, got %d\n", res);
178 ok(!check_ini_file_attr(path), "Expected ini file to not be hidden\n");
179 ok(!check_ini_contents(path, TRUE), "Expected ini contents to not match\n");
180 ok(!DeleteFileA(path), "Expected path to not exist\n");
182 /* try an existent, relative backup directory */
183 CreateDirectoryA("backup", NULL);
184 res = pAddDelBackupEntry("one\0two\0three\0", "backup", "basename", AADBE_ADD_ENTRY);
185 ok(res == S_OK, "Expected S_OK, got %d\n", res);
186 ok(check_ini_file_attr(path), "Expected ini file to be hidden\n");
187 ok(check_ini_contents(path, TRUE), "Expected ini contents to match\n");
188 ok(DeleteFileA(path), "Expected path to exist\n");
189 RemoveDirectoryA("backup");
191 GetWindowsDirectoryA(windir, sizeof(windir));
192 sprintf(path, "%s\\basename.INI", windir);
194 /* try a NULL backup dir, INI is created in the windows directory */
195 res = pAddDelBackupEntry("one\0two\0three\0", NULL, "basename", AADBE_ADD_ENTRY);
196 ok(res == S_OK, "Expected S_OK, got %d\n", res);
197 ok(check_ini_contents(path, TRUE), "Expected ini contents to match\n");
199 /* remove the entries with AADBE_DEL_ENTRY */
200 SetFileAttributesA(path, FILE_ATTRIBUTE_NORMAL);
201 res = pAddDelBackupEntry("one\0three\0", NULL, "basename", AADBE_DEL_ENTRY);
202 SetFileAttributesA(path, FILE_ATTRIBUTE_NORMAL);
203 ok(res == S_OK, "Expected S_OK, got %d\n", res);
204 ok(check_ini_contents(path, FALSE), "Expected ini contents to match\n");
205 ok(DeleteFileA(path), "Expected path to exist\n");
208 /* the FCI callbacks */
210 static void *mem_alloc(ULONG cb)
212 return HeapAlloc(GetProcessHeap(), 0, cb);
215 static void mem_free(void *memory)
217 HeapFree(GetProcessHeap(), 0, memory);
220 static BOOL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
222 return TRUE;
225 static long progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
227 return 0;
230 static int file_placed(PCCAB pccab, char *pszFile, long cbFile,
231 BOOL fContinuation, void *pv)
233 return 0;
236 static INT_PTR fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
238 HANDLE handle;
239 DWORD dwAccess = 0;
240 DWORD dwShareMode = 0;
241 DWORD dwCreateDisposition = OPEN_EXISTING;
243 dwAccess = GENERIC_READ | GENERIC_WRITE;
244 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
245 dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
247 if (GetFileAttributesA(pszFile) != INVALID_FILE_ATTRIBUTES)
248 dwCreateDisposition = OPEN_EXISTING;
249 else
250 dwCreateDisposition = CREATE_NEW;
252 handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
253 dwCreateDisposition, 0, NULL);
255 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszFile);
257 return (INT_PTR)handle;
260 static UINT fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
262 HANDLE handle = (HANDLE)hf;
263 DWORD dwRead;
264 BOOL res;
266 res = ReadFile(handle, memory, cb, &dwRead, NULL);
267 ok(res, "Failed to ReadFile\n");
269 return dwRead;
272 static UINT fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
274 HANDLE handle = (HANDLE)hf;
275 DWORD dwWritten;
276 BOOL res;
278 res = WriteFile(handle, memory, cb, &dwWritten, NULL);
279 ok(res, "Failed to WriteFile\n");
281 return dwWritten;
284 static int fci_close(INT_PTR hf, int *err, void *pv)
286 HANDLE handle = (HANDLE)hf;
287 ok(CloseHandle(handle), "Failed to CloseHandle\n");
289 return 0;
292 static long fci_seek(INT_PTR hf, long dist, int seektype, int *err, void *pv)
294 HANDLE handle = (HANDLE)hf;
295 DWORD ret;
297 ret = SetFilePointer(handle, dist, NULL, seektype);
298 ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
300 return ret;
303 static int fci_delete(char *pszFile, int *err, void *pv)
305 BOOL ret = DeleteFileA(pszFile);
306 ok(ret, "Failed to DeleteFile %s\n", pszFile);
308 return 0;
311 static BOOL get_temp_file(char *pszTempName, int cbTempName, void *pv)
313 LPSTR tempname;
315 tempname = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
316 GetTempFileNameA(".", "xx", 0, tempname);
318 if (tempname && (strlen(tempname) < (unsigned)cbTempName))
320 lstrcpyA(pszTempName, tempname);
321 HeapFree(GetProcessHeap(), 0, tempname);
322 return TRUE;
325 HeapFree(GetProcessHeap(), 0, tempname);
327 return FALSE;
330 static INT_PTR get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
331 USHORT *pattribs, int *err, void *pv)
333 BY_HANDLE_FILE_INFORMATION finfo;
334 FILETIME filetime;
335 HANDLE handle;
336 DWORD attrs;
337 BOOL res;
339 handle = CreateFile(pszName, GENERIC_READ, FILE_SHARE_READ, NULL,
340 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
342 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszName);
344 res = GetFileInformationByHandle(handle, &finfo);
345 ok(res, "Expected GetFileInformationByHandle to succeed\n");
347 FileTimeToLocalFileTime(&finfo.ftLastWriteTime, &filetime);
348 FileTimeToDosDateTime(&filetime, pdate, ptime);
350 attrs = GetFileAttributes(pszName);
351 ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n");
353 return (INT_PTR)handle;
356 static void add_file(HFCI hfci, char *file)
358 char path[MAX_PATH];
359 BOOL res;
361 lstrcpyA(path, CURR_DIR);
362 lstrcatA(path, "\\");
363 lstrcatA(path, file);
365 res = FCIAddFile(hfci, path, file, FALSE, get_next_cabinet, progress,
366 get_open_info, tcompTYPE_MSZIP);
367 ok(res, "Expected FCIAddFile to succeed\n");
370 static void set_cab_parameters(PCCAB pCabParams)
372 ZeroMemory(pCabParams, sizeof(CCAB));
374 pCabParams->cb = MEDIA_SIZE;
375 pCabParams->cbFolderThresh = FOLDER_THRESHOLD;
376 pCabParams->setID = 0xbeef;
377 lstrcpyA(pCabParams->szCabPath, CURR_DIR);
378 lstrcatA(pCabParams->szCabPath, "\\");
379 lstrcpyA(pCabParams->szCab, "extract.cab");
382 static void create_cab_file(void)
384 CCAB cabParams;
385 HFCI hfci;
386 ERF erf;
387 static CHAR a_txt[] = "a.txt",
388 b_txt[] = "b.txt",
389 testdir_c_txt[] = "testdir\\c.txt",
390 testdir_d_txt[] = "testdir\\d.txt";
391 BOOL res;
393 set_cab_parameters(&cabParams);
395 hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
396 fci_read, fci_write, fci_close, fci_seek, fci_delete,
397 get_temp_file, &cabParams, NULL);
399 ok(hfci != NULL, "Failed to create an FCI context\n");
401 add_file(hfci, a_txt);
402 add_file(hfci, b_txt);
403 add_file(hfci, testdir_c_txt);
404 add_file(hfci, testdir_d_txt);
406 res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
407 ok(res, "Failed to flush the cabinet\n");
409 res = FCIDestroy(hfci);
410 ok(res, "Failed to destroy the cabinet\n");
413 static void test_ExtractFiles(void)
415 HRESULT hr;
416 char destFolder[MAX_PATH];
418 lstrcpyA(destFolder, CURR_DIR);
419 lstrcatA(destFolder, "\\");
420 lstrcatA(destFolder, "dest");
422 /* try NULL cab file */
423 hr = pExtractFiles(NULL, destFolder, 0, NULL, NULL, 0);
424 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d\n", hr);
425 ok(RemoveDirectoryA("dest"), "Expected dest to exist\n");
427 /* try NULL destination */
428 hr = pExtractFiles("extract.cab", NULL, 0, NULL, NULL, 0);
429 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d\n", hr);
430 ok(!RemoveDirectoryA("dest"), "Expected dest to not exist\n");
432 /* extract all files in the cab to nonexistent destination directory */
433 hr = pExtractFiles("extract.cab", destFolder, 0, NULL, NULL, 0);
434 ok(hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND),
435 "Expected %d, got %d\n", HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), hr);
436 ok(!DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to not exist\n");
437 ok(!DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to not exist\n");
438 ok(!RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to not exist\n");
439 ok(!RemoveDirectoryA("dest"), "Expected dest to not exist\n");
441 /* extract all files in the cab to the destination directory */
442 CreateDirectoryA("dest", NULL);
443 hr = pExtractFiles("extract.cab", destFolder, 0, NULL, NULL, 0);
444 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
445 ok(DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to exist\n");
446 ok(DeleteFileA("dest\\b.txt"), "Expected dest\\b.txt to exist\n");
447 ok(DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to exist\n");
448 ok(DeleteFileA("dest\\testdir\\d.txt"), "Expected dest\\testdir\\d.txt to exist\n");
449 ok(RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to exist\n");
451 /* extract all files to a relative destination directory */
452 hr = pExtractFiles("extract.cab", "dest", 0, NULL, NULL, 0);
453 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
454 ok(DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to exist\n");
455 ok(DeleteFileA("dest\\b.txt"), "Expected dest\\b.txt to exist\n");
456 ok(DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to exist\n");
457 ok(DeleteFileA("dest\\testdir\\d.txt"), "Expected dest\\testdir\\d.txt to exist\n");
458 ok(RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to exist\n");
460 /* only extract two of the files from the cab */
461 hr = pExtractFiles("extract.cab", "dest", 0, "a.txt:testdir\\c.txt", NULL, 0);
462 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
463 ok(DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to exist\n");
464 ok(DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to exist\n");
465 ok(RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to exist\n");
466 ok(!DeleteFileA("dest\\b.txt"), "Expected dest\\b.txt to not exist\n");
467 ok(!DeleteFileA("dest\\testdir\\d.txt"), "Expected dest\\testdir\\d.txt to not exist\n");
469 /* use valid chars before and after file list */
470 hr = pExtractFiles("extract.cab", "dest", 0, " :\t: a.txt:testdir\\c.txt \t:", NULL, 0);
471 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
472 ok(DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to exist\n");
473 ok(DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to exist\n");
474 ok(RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to exist\n");
475 ok(!DeleteFileA("dest\\b.txt"), "Expected dest\\b.txt to not exist\n");
476 ok(!DeleteFileA("dest\\testdir\\d.txt"), "Expected dest\\testdir\\d.txt to not exist\n");
478 /* use invalid chars before and after file list */
479 hr = pExtractFiles("extract.cab", "dest", 0, " +-\\ a.txt:testdir\\c.txt a_:", NULL, 0);
480 ok(hr == E_FAIL, "Expected E_FAIL, got %d\n", hr);
481 ok(!DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to not exist\n");
482 ok(!DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to not exist\n");
483 ok(!RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to not exist\n");
485 /* try an empty file list */
486 hr = pExtractFiles("extract.cab", "dest", 0, "", NULL, 0);
487 ok(hr == E_FAIL, "Expected E_FAIL, got %d\n", hr);
488 ok(!DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to not exist\n");
489 ok(!RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to not exist\n");
491 /* try a nonexistent file in the file list */
492 hr = pExtractFiles("extract.cab", "dest", 0, "a.txt:idontexist:testdir\\c.txt", NULL, 0);
493 ok(hr == E_FAIL, "Expected E_FAIL, got %d\n", hr);
494 ok(!DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to not exist\n");
495 ok(!DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to not exist\n");
496 ok(!RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to not exist\n");
499 static void test_AdvInstallFile(void)
501 HRESULT hr;
502 char CURR_DIR[MAX_PATH];
503 char destFolder[MAX_PATH];
505 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
507 lstrcpyA(destFolder, CURR_DIR);
508 lstrcatA(destFolder, "\\");
509 lstrcatA(destFolder, "dest");
511 createTestFile("source.txt");
513 /* try invalid source directory */
514 hr = pAdvInstallFile(NULL, NULL, "source.txt", destFolder, "destination.txt", 0, 0);
515 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d\n", hr);
516 ok(!DeleteFileA("dest\\destination.txt"), "Expected dest\\destination.txt to not exist\n");
518 /* try invalid source file */
519 hr = pAdvInstallFile(NULL, CURR_DIR, NULL, destFolder, "destination.txt", 0, 0);
520 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d\n", hr);
521 ok(!DeleteFileA("dest\\destination.txt"), "Expected dest\\destination.txt to not exist\n");
523 /* try invalid destination directory */
524 hr = pAdvInstallFile(NULL, CURR_DIR, "source.txt", NULL, "destination.txt", 0, 0);
525 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d\n", hr);
526 ok(!DeleteFileA("dest\\destination.txt"), "Expected dest\\destination.txt to not exist\n");
528 /* try copying to nonexistent destination directory */
529 hr = pAdvInstallFile(NULL, CURR_DIR, "source.txt", destFolder, "destination.txt", 0, 0);
530 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
531 ok(DeleteFileA("dest\\destination.txt"), "Expected dest\\destination.txt to exist\n");
533 /* native windows screws up if the source file doesn't exist */
535 /* test AIF_NOOVERWRITE behavior, asks the user to overwrite if AIF_QUIET is not specified */
536 createTestFile("dest\\destination.txt");
537 hr = pAdvInstallFile(NULL, CURR_DIR, "source.txt", destFolder,
538 "destination.txt", AIF_NOOVERWRITE | AIF_QUIET, 0);
539 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
540 ok(DeleteFileA("dest\\destination.txt"), "Expected dest\\destination.txt to exist\n");
541 ok(RemoveDirectoryA("dest"), "Expected dest to exist\n");
543 DeleteFileA("source.txt");
546 START_TEST(files)
548 init_function_pointers();
549 create_test_files();
550 create_cab_file();
552 test_AddDelBackupEntry();
553 test_ExtractFiles();
554 test_AdvInstallFile();
556 delete_test_files();