Author: cwittich
Date: Sun Jan 17 09:23:35 2010
New Revision: 45118

URL: http://svn.reactos.org/svn/reactos?rev=45118&view=rev
Log:
[cabinet_winetest]
update cabinet winetest to wine 1.1.36

Modified:
    trunk/rostests/winetests/cabinet/extract.c

Modified: trunk/rostests/winetests/cabinet/extract.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/cabinet/extract.c?rev=45118&r1=45117&r2=45118&view=diff
==============================================================================
--- trunk/rostests/winetests/cabinet/extract.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/cabinet/extract.c [iso-8859-1] Sun Jan 17 09:23:35 
2010
@@ -329,6 +329,26 @@
     return TRUE;
 }
 
+static void free_file_node(struct FILELIST *node)
+{
+    HeapFree(GetProcessHeap(), 0, node->FileName);
+    HeapFree(GetProcessHeap(), 0, node);
+}
+
+static void free_file_list(SESSION* session)
+{
+    struct FILELIST *next, *curr = session->FileList;
+
+    while (curr)
+    {
+        next = curr->next;
+        free_file_node(curr);
+        curr = next;
+    }
+
+    session->FileList = NULL;
+}
+
 static void test_Extract(void)
 {
     SESSION session;
@@ -370,6 +390,7 @@
     ok(check_list(&node, "testdir\\c.txt", FALSE), "list entry wrong\n");
     ok(check_list(&node, "b.txt", FALSE), "list entry wrong\n");
     ok(check_list(&node, "a.txt", FALSE), "list entry wrong\n");
+    free_file_list(&session);
 
     /* try fill file list operation */
     ZeroMemory(&session, sizeof(SESSION));
@@ -454,7 +475,10 @@
     ok(check_list(&node, "a.txt", FALSE), "list entry wrong\n");
 
     /* remove two of the files in the list */
+    node = session.FileList->next;
     session.FileList->next = session.FileList->next->next;
+    free_file_node(node);
+    free_file_node(session.FileList->next->next);
     session.FileList->next->next = NULL;
     session.FilterList = NULL;
     CreateDirectoryA("dest", NULL);
@@ -482,6 +506,7 @@
     ok(!check_list(&node, "testdir\\c.txt", FALSE), "list entry wrong\n");
     ok(check_list(&node, "b.txt", FALSE), "list entry wrong\n");
     ok(!check_list(&node, "a.txt", FALSE), "list entry wrong\n");
+    free_file_list(&session);
 
     session.Operation = EXTRACT_FILLFILELIST;
     session.FileList = NULL;
@@ -564,6 +589,7 @@
     ok(check_list(&node, "testdir\\c.txt", FALSE), "list entry wrong\n");
     ok(check_list(&node, "b.txt", FALSE), "list entry wrong\n");
     ok(check_list(&node, "a.txt", FALSE), "list entry wrong\n");
+    free_file_list(&session);
 
     /* cabinet does not exist */
     ZeroMemory(&session, sizeof(SESSION));
@@ -593,6 +619,7 @@
     ok(!check_list(&node, "testdir\\c.txt", FALSE), "list entry should not 
exist\n");
     ok(!check_list(&node, "b.txt", FALSE), "list entry should not exist\n");
     ok(!check_list(&node, "a.txt", FALSE), "list entry should not exist\n");
+    free_file_list(&session);
 
     /* first file exists */
     createTestFile("dest\\a.txt");
@@ -631,6 +658,7 @@
         ok(!check_list(&node, "b.txt", FALSE), "list entry should not 
exist\n");
     }
     ok(!check_list(&node, "a.txt", FALSE), "list entry should not exist\n");
+    free_file_list(&session);
 
     SetFileAttributesA("dest\\a.txt", FILE_ATTRIBUTE_NORMAL);
     DeleteFileA("dest\\a.txt");
@@ -670,7 +698,8 @@
     ok(!check_list(&node, "testdir\\d.txt", FALSE), "list entry should not 
exist\n");
     ok(!check_list(&node, "testdir\\c.txt", FALSE), "list entry wrong\n");
     ok(!check_list(&node, "b.txt", FALSE), "list entry wrong\n");
-    ok(check_list(&node, "a.txt", TRUE), "list entry wrong\n");
+    ok(!check_list(&node, "a.txt", TRUE), "list entry wrong\n");
+    free_file_list(&session);
 
     SetFileAttributesA("dest\\testdir\\c.txt", FILE_ATTRIBUTE_NORMAL);
     DeleteFileA("dest\\testdir\\c.txt");


Reply via email to