[PATCH 5/6] lz32/tests: WinME sometimes returns short filenames.

Saulius Krasuckas saulius.krasuckas at ieee.org
Tue Oct 10 11:38:13 CDT 2006


The reason is unknown for me.  During debug process the test also fails 
with different results often at simple numerical checks on WinME.  May be 
some kind of overflow bug in the dll of Windows Millenium.

---

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

f57e96a189435dceb2491edc280af08241c40593
diff --git a/dlls/lz32/tests/lzexpand_main.c b/dlls/lz32/tests/lzexpand_main.c
index f820a94..bc69720 100644
--- a/dlls/lz32/tests/lzexpand_main.c
+++ b/dlls/lz32/tests/lzexpand_main.c
@@ -353,6 +353,7 @@ static void test_LZOpenFileA(void)
   INT file;
   static char badfilename_[] = "badfilename_";
   char expected[MAX_PATH];
+  char short_expected[MAX_PATH];
 
   SetLastError(0xfaceabee);
   /* Check for nonexistent file. */
@@ -384,6 +385,7 @@ static void test_LZOpenFileA(void)
 
   /* Check various opening options: */
   memset(&test, 0xA5, sizeof(test));
+  full_file_path_name_in_a_CWD(filename_, short_expected, TRUE);
 
   /* a, for reading. */
   file = LZOpenFileA(filename_, &test, OF_READ);
@@ -392,9 +394,10 @@ static void test_LZOpenFileA(void)
      "LZOpenFileA set test.cBytes to %d\n", test.cBytes);
   ok(test.nErrCode == ERROR_SUCCESS,
      "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode);
-  ok(lstrcmpA(test.szPathName, expected) == 0,
-     "LZOpenFileA returned '%s', but was expected to return '%s'\n",
-     test.szPathName, expected);
+  ok(lstrcmpA(test.szPathName, expected) == 0 ||
+     lstrcmpA(test.szPathName, short_expected) == 0, /* Win9x */
+     "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n",
+     test.szPathName, expected, short_expected);
   LZClose(file);
 
   memset(&test, 0xA5, sizeof(test));
@@ -406,9 +409,10 @@ static void test_LZOpenFileA(void)
      "LZOpenFileA set test.cBytes to %d\n", test.cBytes);
   ok(test.nErrCode == ERROR_SUCCESS,
      "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode);
-  ok(lstrcmpA(test.szPathName, expected) == 0,
-     "LZOpenFileA returned '%s', but was expected to return '%s'\n",
-     test.szPathName, expected);
+  ok(lstrcmpA(test.szPathName, expected) == 0 ||
+     lstrcmpA(test.szPathName, short_expected) == 0, /* Win9x */
+     "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n",
+     test.szPathName, expected, short_expected);
   LZClose(file);
 
   memset(&test, 0xA5, sizeof(test));
@@ -420,9 +424,10 @@ static void test_LZOpenFileA(void)
      "LZOpenFileA set test.cBytes to %d\n", test.cBytes);
   ok(test.nErrCode == ERROR_SUCCESS,
      "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode);
-  ok(lstrcmpA(test.szPathName, expected) == 0,
-     "LZOpenFileA returned '%s', but was expected to return '%s'\n",
-     test.szPathName, expected);
+  ok(lstrcmpA(test.szPathName, expected) == 0 ||
+     lstrcmpA(test.szPathName, short_expected) == 0, /* Win9x */
+     "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n",
+     test.szPathName, expected, short_expected);
   LZClose(file);
 
   memset(&test, 0xA5, sizeof(test));
@@ -434,9 +439,10 @@ static void test_LZOpenFileA(void)
      "LZOpenFileA set test.cBytes to %d\n", test.cBytes);
   ok(test.nErrCode == ERROR_SUCCESS,
      "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode);
-  ok(lstrcmpA(test.szPathName, expected) == 0,
-     "LZOpenFileA returned '%s', but was expected to return '%s'\n",
-     test.szPathName, expected);
+  ok(lstrcmpA(test.szPathName, expected) == 0 ||
+     lstrcmpA(test.szPathName, short_expected) == 0, /* Win9x */
+     "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n",
+     test.szPathName, expected, short_expected);
   LZClose(file);
 
   memset(&test, 0xA5, sizeof(test));
@@ -448,9 +454,10 @@ static void test_LZOpenFileA(void)
      "LZOpenFileA set test.cBytes to %d\n", test.cBytes);
   ok(test.nErrCode == ERROR_SUCCESS,
      "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode);
-  ok(lstrcmpA(test.szPathName, expected) == 0,
-     "LZOpenFileA returned '%s', but was expected to return '%s'\n",
-     test.szPathName, expected);
+  ok(lstrcmpA(test.szPathName, expected) == 0 ||
+     lstrcmpA(test.szPathName, short_expected) == 0, /* Win9x */
+     "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n",
+     test.szPathName, expected, short_expected);
   LZClose(file);
 
   retval = GetFileAttributesA(filename_);
-- 
1.3.3



More information about the wine-patches mailing list