lz32/tests: Compare result to predefined compressed file name, not calculated one. [1/4]

Saulius Krasuckas saulius2 at ar.fi.lt
Mon Sep 25 12:59:23 CDT 2006


---

 dlls/lz32/tests/lzexpand_main.c |   33 +++++++++++++++------------------
 1 files changed, 15 insertions(+), 18 deletions(-)

c12dbbd378727169b5c29f2fd524cb7b7926c23b
diff --git a/dlls/lz32/tests/lzexpand_main.c b/dlls/lz32/tests/lzexpand_main.c
index fe1ae83..d8845a6 100644
--- a/dlls/lz32/tests/lzexpand_main.c
+++ b/dlls/lz32/tests/lzexpand_main.c
@@ -27,8 +27,9 @@
 
 #include "wine/test.h"
 
+/* Compressed file names end with underscore. */
+static char filename [] = "testfile.xxx";
 static char filename_[] = "testfile.xx_";
-static char filename[] = "testfile.xxx";
 static char filename2[] = "testfile.yyy";
 
 static WCHAR filename_W[] = {'t','e','s','t','f','i','l','e','.','x','x','_',0};
@@ -55,6 +56,17 @@ static const DWORD uncompressed_data_siz
 
 static char *buf;
 
+static void full_file_path_name_in_a_CWD(const char *src, char *dst)
+{
+  DWORD retval;
+
+  retval = GetCurrentDirectoryA(MAX_PATH, dst);
+  ok(retval > 0, "GetCurrentDirectoryA returned %ld, GLE=0x%lx\n", 
+     retval, GetLastError());
+  lstrcatA(dst, "\\");
+  lstrcatA(dst, src);
+}
+
 static void test_LZOpenFileA(void)
 {
   OFSTRUCT test;
@@ -99,14 +111,7 @@ static void test_LZOpenFileA(void)
      check for the file "foo.xx_" and open that -- at least on some
      operating systems.  Doesn't seem to on my copy of Win98.   
    */
-  retval = GetCurrentDirectoryA(MAX_PATH, expected);
-  ok(retval > 0, "GetCurrentDirectoryA returned %ld, GLE=0x%lx\n", 
-     retval, GetLastError());
-  lstrcatA(expected, "\\");
-  lstrcatA(expected, filename);
-  /* Compressed file name ends with underscore. */
-  retval = lstrlenA(expected);
-  expected[retval-1] = '_';
+  full_file_path_name_in_a_CWD(filename_, expected);
   memset(&filled_0xA5, 0xA5, OFS_MAXPATHNAME);
   memset(&test, 0xA5, sizeof(test));
 
@@ -271,15 +276,7 @@ static void test_LZOpenFileW(void)
      check for the file "foo.xx_" and open that -- at least on some
      operating systems.  Doesn't seem to on my copy of Win98.   
    */
-  retval = GetCurrentDirectoryA(MAX_PATH, expected);
-  ok(retval > 0, "GetCurrentDirectoryW returned %ld, GLE=0x%lx\n", 
-     retval, GetLastError());
-  lstrcatA(expected, "\\");
-  /* It's probably better to use WideCharToMultiByte() on filenameW: */
-  lstrcatA(expected, filename);
-  /* Compressed file name ends with underscore. */
-  retval = lstrlenA(expected);
-  expected[retval-1] = '_';
+  full_file_path_name_in_a_CWD(filename_, expected);
   memset(&test, 0xA5, sizeof(test));
 
   /* Try to open compressed file. */
-- 
1.0.4



More information about the wine-patches mailing list