advpack: Remove a test that fails inconsistently on several platforms.
[wine] / dlls / advpack / tests / files.c
1 /*
2  * Unit tests for advpack.dll file functions
3  *
4  * Copyright (C) 2006 James Hawkins
5  *
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.
10  *
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.
15  *
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
19  */
20
21 #include <stdio.h>
22 #include <windows.h>
23 #include <advpub.h>
24 #include <fci.h>
25 #include "wine/test.h"
26
27 /* make the max size large so there is only one cab file */
28 #define MEDIA_SIZE          999999999
29 #define FOLDER_THRESHOLD    900000
30
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);
36
37 CHAR CURR_DIR[MAX_PATH];
38
39 static void init_function_pointers(void)
40 {
41     hAdvPack = LoadLibraryA("advpack.dll");
42
43     if (hAdvPack)
44     {
45         pAddDelBackupEntry = (void *)GetProcAddress(hAdvPack, "AddDelBackupEntry");
46         pExtractFiles = (void *)GetProcAddress(hAdvPack, "ExtractFiles");
47         pAdvInstallFile = (void*)GetProcAddress(hAdvPack, "AdvInstallFile");
48     }
49 }
50
51 /* creates a file with the specified name for tests */
52 static void createTestFile(const CHAR *name)
53 {
54     HANDLE file;
55     DWORD written;
56
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);
62 }
63
64 static void create_test_files(void)
65 {
66     int len;
67
68     GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
69     len = lstrlenA(CURR_DIR);
70
71     if(len && (CURR_DIR[len-1] == '\\'))
72         CURR_DIR[len-1] = 0;
73
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);
80 }
81
82 static void delete_test_files(void)
83 {
84     DeleteFileA("a.txt");
85     DeleteFileA("b.txt");
86     DeleteFileA("testdir\\c.txt");
87     DeleteFileA("testdir\\d.txt");
88     RemoveDirectoryA("testdir");
89     RemoveDirectoryA("dest");
90
91     DeleteFileA("extract.cab");
92 }
93
94 static BOOL check_ini_file_attr(LPSTR filename)
95 {
96     BOOL ret;
97     DWORD expected = FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY;
98     DWORD attr = GetFileAttributesA(filename);
99
100     ret = (attr & expected) && (attr != INVALID_FILE_ATTRIBUTES);
101     SetFileAttributesA(filename, FILE_ATTRIBUTE_NORMAL);
102
103     return ret;
104 }
105
106 static void test_AddDelBackupEntry(void)
107 {
108     HRESULT res;
109     CHAR path[MAX_PATH];
110     CHAR windir[MAX_PATH];
111
112     lstrcpyA(path, CURR_DIR);
113     lstrcatA(path, "\\backup\\basename.INI");
114
115     /* native AddDelBackupEntry crashes if lpcszBaseName is NULL */
116
117     /* try a NULL file list */
118     res = pAddDelBackupEntry(NULL, "backup", "basename", AADBE_ADD_ENTRY);
119     ok(res == S_OK, "Expected S_OK, got %d\n", res);
120     ok(!DeleteFileA(path), "Expected path to not exist\n");
121
122     lstrcpyA(path, CURR_DIR);
123     lstrcatA(path, "\\backup\\.INI");
124
125     /* try an empty base name */
126     res = pAddDelBackupEntry("one\0two\0three\0", "backup", "", AADBE_ADD_ENTRY);
127     ok(res == S_OK, "Expected S_OK, got %d\n", res);
128     ok(!DeleteFileA(path), "Expected path to not exist\n");
129
130     lstrcpyA(path, CURR_DIR);
131     lstrcatA(path, "\\basename.INI");
132
133     /* try an invalid flag */
134     res = pAddDelBackupEntry("one\0two\0three\0", NULL, "basename", 0);
135     ok(res == S_OK, "Expected S_OK, got %d\n", res);
136     ok(!DeleteFileA(path), "Expected path to not exist\n");
137
138     lstrcpyA(path, "c:\\basename.INI");
139
140     /* create the INF file */
141     res = pAddDelBackupEntry("one\0two\0three\0", "c:\\", "basename", AADBE_ADD_ENTRY);
142     ok(res == S_OK, "Expected S_OK, got %d\n", res);
143     ok(check_ini_file_attr(path), "Expected ini file to be hidden\n");
144     ok(DeleteFileA(path), "Expected path to exist\n");
145
146     lstrcpyA(path, CURR_DIR);
147     lstrcatA(path, "\\backup\\basename.INI");
148
149     /* try to create the INI file in a nonexistent directory */
150     RemoveDirectoryA("backup");
151     res = pAddDelBackupEntry("one\0two\0three\0", "backup", "basename", AADBE_ADD_ENTRY);
152     ok(res == S_OK, "Expected S_OK, got %d\n", res);
153     ok(!check_ini_file_attr(path), "Expected ini file to not be hidden\n");
154     ok(!DeleteFileA(path), "Expected path to not exist\n");
155
156     /* try an existent, relative backup directory */
157     CreateDirectoryA("backup", NULL);
158     res = pAddDelBackupEntry("one\0two\0three\0", "backup", "basename", AADBE_ADD_ENTRY);
159     ok(res == S_OK, "Expected S_OK, got %d\n", res);
160     ok(check_ini_file_attr(path), "Expected ini file to be hidden\n");
161     ok(DeleteFileA(path), "Expected path to exist\n");
162     RemoveDirectoryA("backup");
163
164     GetWindowsDirectoryA(windir, sizeof(windir));
165     sprintf(path, "%s\\basename.INI", windir);
166
167     /* try a NULL backup dir, INI is created in the windows directory */
168     res = pAddDelBackupEntry("one\0two\0three\0", NULL, "basename", AADBE_ADD_ENTRY);
169     ok(res == S_OK, "Expected S_OK, got %d\n", res);
170
171     /* remove the entries with AADBE_DEL_ENTRY */
172     SetFileAttributesA(path, FILE_ATTRIBUTE_NORMAL);
173     res = pAddDelBackupEntry("one\0three\0", NULL, "basename", AADBE_DEL_ENTRY);
174     SetFileAttributesA(path, FILE_ATTRIBUTE_NORMAL);
175     ok(res == S_OK, "Expected S_OK, got %d\n", res);
176     ok(DeleteFileA(path), "Expected path to exist\n");
177 }
178
179 /* the FCI callbacks */
180
181 static void *mem_alloc(ULONG cb)
182 {
183     return HeapAlloc(GetProcessHeap(), 0, cb);
184 }
185
186 static void mem_free(void *memory)
187 {
188     HeapFree(GetProcessHeap(), 0, memory);
189 }
190
191 static BOOL get_next_cabinet(PCCAB pccab, ULONG  cbPrevCab, void *pv)
192 {
193     return TRUE;
194 }
195
196 static long progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
197 {
198     return 0;
199 }
200
201 static int file_placed(PCCAB pccab, char *pszFile, long cbFile,
202                        BOOL fContinuation, void *pv)
203 {
204     return 0;
205 }
206
207 static INT_PTR fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
208 {
209     HANDLE handle;
210     DWORD dwAccess = 0;
211     DWORD dwShareMode = 0;
212     DWORD dwCreateDisposition = OPEN_EXISTING;
213     
214     dwAccess = GENERIC_READ | GENERIC_WRITE;
215     /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
216     dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
217
218     if (GetFileAttributesA(pszFile) != INVALID_FILE_ATTRIBUTES)
219         dwCreateDisposition = OPEN_EXISTING;
220     else
221         dwCreateDisposition = CREATE_NEW;
222
223     handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
224                          dwCreateDisposition, 0, NULL);
225
226     ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszFile);
227
228     return (INT_PTR)handle;
229 }
230
231 static UINT fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
232 {
233     HANDLE handle = (HANDLE)hf;
234     DWORD dwRead;
235     BOOL res;
236     
237     res = ReadFile(handle, memory, cb, &dwRead, NULL);
238     ok(res, "Failed to ReadFile\n");
239
240     return dwRead;
241 }
242
243 static UINT fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
244 {
245     HANDLE handle = (HANDLE)hf;
246     DWORD dwWritten;
247     BOOL res;
248
249     res = WriteFile(handle, memory, cb, &dwWritten, NULL);
250     ok(res, "Failed to WriteFile\n");
251
252     return dwWritten;
253 }
254
255 static int fci_close(INT_PTR hf, int *err, void *pv)
256 {
257     HANDLE handle = (HANDLE)hf;
258     ok(CloseHandle(handle), "Failed to CloseHandle\n");
259
260     return 0;
261 }
262
263 static long fci_seek(INT_PTR hf, long dist, int seektype, int *err, void *pv)
264 {
265     HANDLE handle = (HANDLE)hf;
266     DWORD ret;
267     
268     ret = SetFilePointer(handle, dist, NULL, seektype);
269     ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
270
271     return ret;
272 }
273
274 static int fci_delete(char *pszFile, int *err, void *pv)
275 {
276     BOOL ret = DeleteFileA(pszFile);
277     ok(ret, "Failed to DeleteFile %s\n", pszFile);
278
279     return 0;
280 }
281
282 static BOOL get_temp_file(char *pszTempName, int cbTempName, void *pv)
283 {
284     LPSTR tempname;
285
286     tempname = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
287     GetTempFileNameA(".", "xx", 0, tempname);
288
289     if (tempname && (strlen(tempname) < (unsigned)cbTempName))
290     {
291         lstrcpyA(pszTempName, tempname);
292         HeapFree(GetProcessHeap(), 0, tempname);
293         return TRUE;
294     }
295
296     HeapFree(GetProcessHeap(), 0, tempname);
297
298     return FALSE;
299 }
300
301 static INT_PTR get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
302                              USHORT *pattribs, int *err, void *pv)
303 {
304     BY_HANDLE_FILE_INFORMATION finfo;
305     FILETIME filetime;
306     HANDLE handle;
307     DWORD attrs;
308     BOOL res;
309
310     handle = CreateFile(pszName, GENERIC_READ, FILE_SHARE_READ, NULL,
311                         OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
312
313     ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszName);
314
315     res = GetFileInformationByHandle(handle, &finfo);
316     ok(res, "Expected GetFileInformationByHandle to succeed\n");
317    
318     FileTimeToLocalFileTime(&finfo.ftLastWriteTime, &filetime);
319     FileTimeToDosDateTime(&filetime, pdate, ptime);
320
321     attrs = GetFileAttributes(pszName);
322     ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n");
323
324     return (INT_PTR)handle;
325 }
326
327 static void add_file(HFCI hfci, char *file)
328 {
329     char path[MAX_PATH];
330     BOOL res;
331
332     lstrcpyA(path, CURR_DIR);
333     lstrcatA(path, "\\");
334     lstrcatA(path, file);
335
336     res = FCIAddFile(hfci, path, file, FALSE, get_next_cabinet, progress,
337                      get_open_info, tcompTYPE_MSZIP);
338     ok(res, "Expected FCIAddFile to succeed\n");
339 }
340
341 static void set_cab_parameters(PCCAB pCabParams)
342 {
343     ZeroMemory(pCabParams, sizeof(CCAB));
344
345     pCabParams->cb = MEDIA_SIZE;
346     pCabParams->cbFolderThresh = FOLDER_THRESHOLD;
347     pCabParams->setID = 0xbeef;
348     lstrcpyA(pCabParams->szCabPath, CURR_DIR);
349     lstrcatA(pCabParams->szCabPath, "\\");
350     lstrcpyA(pCabParams->szCab, "extract.cab");
351 }
352
353 static void create_cab_file(void)
354 {
355     CCAB cabParams;
356     HFCI hfci;
357     ERF erf;
358     static CHAR a_txt[] = "a.txt",
359                 b_txt[] = "b.txt",
360                 testdir_c_txt[] = "testdir\\c.txt",
361                 testdir_d_txt[] = "testdir\\d.txt";
362     BOOL res;
363
364     set_cab_parameters(&cabParams);
365
366     hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
367                       fci_read, fci_write, fci_close, fci_seek, fci_delete,
368                       get_temp_file, &cabParams, NULL);
369
370     ok(hfci != NULL, "Failed to create an FCI context\n");
371
372     add_file(hfci, a_txt);
373     add_file(hfci, b_txt);
374     add_file(hfci, testdir_c_txt);
375     add_file(hfci, testdir_d_txt);
376
377     res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
378     ok(res, "Failed to flush the cabinet\n");
379
380     res = FCIDestroy(hfci);
381     ok(res, "Failed to destroy the cabinet\n");
382 }
383
384 static void test_ExtractFiles(void)
385 {
386     HRESULT hr;
387     char destFolder[MAX_PATH];
388
389     lstrcpyA(destFolder, CURR_DIR);
390     lstrcatA(destFolder, "\\");
391     lstrcatA(destFolder, "dest");
392
393     /* try NULL cab file */
394     hr = pExtractFiles(NULL, destFolder, 0, NULL, NULL, 0);
395     ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d\n", hr);
396     ok(RemoveDirectoryA("dest"), "Expected dest to exist\n");
397     
398     /* try NULL destination */
399     hr = pExtractFiles("extract.cab", NULL, 0, NULL, NULL, 0);
400     ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d\n", hr);
401     ok(!RemoveDirectoryA("dest"), "Expected dest to not exist\n");
402
403     /* extract all files in the cab to nonexistent destination directory */
404     hr = pExtractFiles("extract.cab", destFolder, 0, NULL, NULL, 0);
405     ok(hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND),
406        "Expected %d, got %d\n", HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), hr);
407     ok(!DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to not exist\n");
408     ok(!DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to not exist\n");
409     ok(!RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to not exist\n");
410     ok(!RemoveDirectoryA("dest"), "Expected dest to not exist\n");
411
412     /* extract all files in the cab to the destination directory */
413     CreateDirectoryA("dest", NULL);
414     hr = pExtractFiles("extract.cab", destFolder, 0, NULL, NULL, 0);
415     ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
416     ok(DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to exist\n");
417     ok(DeleteFileA("dest\\b.txt"), "Expected dest\\b.txt to exist\n");
418     ok(DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to exist\n");
419     ok(DeleteFileA("dest\\testdir\\d.txt"), "Expected dest\\testdir\\d.txt to exist\n");
420     ok(RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to exist\n");
421
422     /* extract all files to a relative destination directory */
423     hr = pExtractFiles("extract.cab", "dest", 0, NULL, NULL, 0);
424     ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
425     ok(DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to exist\n");
426     ok(DeleteFileA("dest\\b.txt"), "Expected dest\\b.txt to exist\n");
427     ok(DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to exist\n");
428     ok(DeleteFileA("dest\\testdir\\d.txt"), "Expected dest\\testdir\\d.txt to exist\n");
429     ok(RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to exist\n");
430
431     /* only extract two of the files from the cab */
432     hr = pExtractFiles("extract.cab", "dest", 0, "a.txt:testdir\\c.txt", NULL, 0);
433     ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
434     ok(DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to exist\n");
435     ok(DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to exist\n");
436     ok(RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to exist\n");
437     ok(!DeleteFileA("dest\\b.txt"), "Expected dest\\b.txt to not exist\n");
438     ok(!DeleteFileA("dest\\testdir\\d.txt"), "Expected dest\\testdir\\d.txt to not exist\n");
439
440     /* use valid chars before and after file list */
441     hr = pExtractFiles("extract.cab", "dest", 0, " :\t: a.txt:testdir\\c.txt  \t:", NULL, 0);
442     ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
443     ok(DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to exist\n");
444     ok(DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to exist\n");
445     ok(RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to exist\n");
446     ok(!DeleteFileA("dest\\b.txt"), "Expected dest\\b.txt to not exist\n");
447     ok(!DeleteFileA("dest\\testdir\\d.txt"), "Expected dest\\testdir\\d.txt to not exist\n");
448
449     /* use invalid chars before and after file list */
450     hr = pExtractFiles("extract.cab", "dest", 0, " +-\\ a.txt:testdir\\c.txt  a_:", NULL, 0);
451     ok(hr == E_FAIL, "Expected E_FAIL, got %d\n", hr);
452     ok(!DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to not exist\n");
453     ok(!DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to not exist\n");
454     ok(!RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to not exist\n");
455
456     /* try an empty file list */
457     hr = pExtractFiles("extract.cab", "dest", 0, "", NULL, 0);
458     ok(hr == E_FAIL, "Expected E_FAIL, got %d\n", hr);
459     ok(!DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to not exist\n");
460     ok(!RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to not exist\n");
461
462     /* try a nonexistent file in the file list */
463     hr = pExtractFiles("extract.cab", "dest", 0, "a.txt:idontexist:testdir\\c.txt", NULL, 0);
464     ok(hr == E_FAIL, "Expected E_FAIL, got %d\n", hr);
465     ok(!DeleteFileA("dest\\a.txt"), "Expected dest\\a.txt to not exist\n");
466     ok(!DeleteFileA("dest\\testdir\\c.txt"), "Expected dest\\testdir\\c.txt to not exist\n");
467     ok(!RemoveDirectoryA("dest\\testdir"), "Expected dest\\testdir to not exist\n");
468 }
469
470 static void test_AdvInstallFile(void)
471 {
472     HRESULT hr;
473     char CURR_DIR[MAX_PATH];
474     char destFolder[MAX_PATH];
475
476     GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
477
478     lstrcpyA(destFolder, CURR_DIR);
479     lstrcatA(destFolder, "\\");
480     lstrcatA(destFolder, "dest");
481
482     createTestFile("source.txt");
483
484     /* try invalid source directory */
485     hr = pAdvInstallFile(NULL, NULL, "source.txt", destFolder, "destination.txt", 0, 0);
486     ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d\n", hr);
487     ok(!DeleteFileA("dest\\destination.txt"), "Expected dest\\destination.txt to not exist\n");
488
489     /* try invalid source file */
490     hr = pAdvInstallFile(NULL, CURR_DIR, NULL, destFolder, "destination.txt", 0, 0);
491     ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d\n", hr);
492     ok(!DeleteFileA("dest\\destination.txt"), "Expected dest\\destination.txt to not exist\n");
493
494     /* try invalid destination directory */
495     hr = pAdvInstallFile(NULL, CURR_DIR, "source.txt", NULL, "destination.txt", 0, 0);
496     ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d\n", hr);
497     ok(!DeleteFileA("dest\\destination.txt"), "Expected dest\\destination.txt to not exist\n");
498
499     /* try copying to nonexistent destination directory */
500     hr = pAdvInstallFile(NULL, CURR_DIR, "source.txt", destFolder, "destination.txt", 0, 0);
501     ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
502     ok(DeleteFileA("dest\\destination.txt"), "Expected dest\\destination.txt to exist\n");
503
504     /* native windows screws up if the source file doesn't exist */
505
506     /* test AIF_NOOVERWRITE behavior, asks the user to overwrite if AIF_QUIET is not specified */
507     createTestFile("dest\\destination.txt");
508     hr = pAdvInstallFile(NULL, CURR_DIR, "source.txt", destFolder,
509                          "destination.txt", AIF_NOOVERWRITE | AIF_QUIET, 0);
510     ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
511     ok(DeleteFileA("dest\\destination.txt"), "Expected dest\\destination.txt to exist\n");
512     ok(RemoveDirectoryA("dest"), "Expected dest to exist\n");
513
514     DeleteFileA("source.txt");
515 }
516
517 START_TEST(files)
518 {
519     init_function_pointers();
520     create_test_files();
521     create_cab_file();
522
523     test_AddDelBackupEntry();
524     test_ExtractFiles();
525     test_AdvInstallFile();
526
527     delete_test_files();
528
529     FreeLibrary(hAdvPack);
530 }