From 419dec33ea50596fcf864d942b7f165197d9faeb Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Wed, 20 Jun 2012 23:34:55 +0000 Subject: [PATCH] [LZ32_WINETEST] - Sync to Wine 1.5.4 svn path=/trunk/; revision=56768 --- rostests/winetests/lz32/CMakeLists.txt | 4 +- rostests/winetests/lz32/lzexpand_main.c | 144 ++++++++---------------- 2 files changed, 45 insertions(+), 103 deletions(-) diff --git a/rostests/winetests/lz32/CMakeLists.txt b/rostests/winetests/lz32/CMakeLists.txt index e1d03fb05ad..7d7da22c9bf 100644 --- a/rostests/winetests/lz32/CMakeLists.txt +++ b/rostests/winetests/lz32/CMakeLists.txt @@ -1,7 +1,5 @@ -add_definitions( - -D__ROS_LONG64__ - -D_DLL -D__USE_CRTIMP) +add_definitions(-D__ROS_LONG64__) add_executable(lz32_winetest lzexpand_main.c testlist.c) target_link_libraries(lz32_winetest wine) diff --git a/rostests/winetests/lz32/lzexpand_main.c b/rostests/winetests/lz32/lzexpand_main.c index 3e46fb0a47c..41792d6321f 100644 --- a/rostests/winetests/lz32/lzexpand_main.c +++ b/rostests/winetests/lz32/lzexpand_main.c @@ -140,27 +140,15 @@ static void test_LZOpenFileA_existing_compressed(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. */ - if(file != LZERROR_BADINHANDLE) { - ok(file >= 0, "LZOpenFileA returns negative file descriptor for '%s'\n", filename); - ok(test.cBytes == sizeof(OFSTRUCT), - "LZOpenFileA set test.cBytes to %d\n", test.cBytes); - ok(test.nErrCode == 0, "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); - LZClose(file); - } else { /* Win9x */ - ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); - ok(test.cBytes == 0xA5, - "LZOpenFileA set test.cBytes to %d\n", test.cBytes); - ok(test.nErrCode == ERROR_FILE_NOT_FOUND, - "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); - ok(strncmp(test.szPathName, filled_0xA5, OFS_MAXPATHNAME) == 0, - "LZOpenFileA returned '%s', but was expected to return '%s'\n", - test.szPathName, filled_0xA5); - } + ok(file >= 0, "LZOpenFileA returns negative file descriptor for '%s'\n", filename); + ok(test.cBytes == sizeof(OFSTRUCT), + "LZOpenFileA set test.cBytes to %d\n", test.cBytes); + ok(test.nErrCode == 0, "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); + LZClose(file); memset(&filled_0xA5, 0xA5, OFS_MAXPATHNAME); memset(&test, 0xA5, sizeof(test)); @@ -169,29 +157,15 @@ static void test_LZOpenFileA_existing_compressed(void) /* b, using dotless file name. */ file = LZOpenFileA(dotless, &test, OF_EXIST); - if(file != LZERROR_BADINHANDLE) { - ok(file >= 0, "LZOpenFileA returns negative file descriptor for '%s'\n", dotless); - ok(test.cBytes == sizeof(OFSTRUCT), - "LZOpenFileA set test.cBytes to %d\n", test.cBytes); - ok(test.nErrCode == 0, "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); - LZClose(file); - } else { /* Win9x */ - ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); - todo_wine - ok(test.cBytes == 0xA5, - "LZOpenFileA set test.cBytes to %d\n", test.cBytes); - ok(test.nErrCode == ERROR_FILE_NOT_FOUND, - "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); - todo_wine - ok(strncmp(test.szPathName, filled_0xA5, OFS_MAXPATHNAME) == 0, - "LZOpenFileA returned '%s', but was expected to return '%s'\n", - test.szPathName, filled_0xA5); - } + ok(file >= 0, "LZOpenFileA returns negative file descriptor for '%s'\n", dotless); + ok(test.cBytes == sizeof(OFSTRUCT), + "LZOpenFileA set test.cBytes to %d\n", test.cBytes); + ok(test.nErrCode == 0, "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); + LZClose(file); memset(&filled_0xA5, 0xA5, OFS_MAXPATHNAME); memset(&test, 0xA5, sizeof(test)); @@ -200,27 +174,15 @@ static void test_LZOpenFileA_existing_compressed(void) /* c, using extensionless file name. */ file = LZOpenFileA(extless, &test, OF_EXIST); - if(file != LZERROR_BADINHANDLE) { - ok(file >= 0, "LZOpenFileA returns negative file descriptor for '%s'\n", extless); - ok(test.cBytes == sizeof(OFSTRUCT), - "LZOpenFileA set test.cBytes to %d\n", test.cBytes); - ok(test.nErrCode == 0, "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); - LZClose(file); - } else { /* Win9x */ - ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); - ok(test.cBytes == 0xA5, - "LZOpenFileA set test.cBytes to %d\n", test.cBytes); - ok(test.nErrCode == ERROR_FILE_NOT_FOUND, - "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); - ok(strncmp(test.szPathName, filled_0xA5, OFS_MAXPATHNAME) == 0, - "LZOpenFileA returned '%s', but was expected to return '%s'\n", - test.szPathName, filled_0xA5); - } + ok(file >= 0, "LZOpenFileA returns negative file descriptor for '%s'\n", extless); + ok(test.cBytes == sizeof(OFSTRUCT), + "LZOpenFileA set test.cBytes to %d\n", test.cBytes); + ok(test.nErrCode == 0, "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); + LZClose(file); memset(&filled_0xA5, 0xA5, OFS_MAXPATHNAME); memset(&test, 0xA5, sizeof(test)); @@ -230,13 +192,10 @@ static void test_LZOpenFileA_existing_compressed(void) /* d, using underscore-terminated file name. */ file = LZOpenFileA(_terminated, &test, OF_EXIST); ok(file >= 0, "LZOpenFileA failed on switching to a compressed file name\n"); - ok(test.cBytes == sizeof(OFSTRUCT) || - broken(test.cBytes == FIELD_OFFSET(OFSTRUCT, szPathName) + lstrlenA(test.szPathName)), /* win9x */ - "LZOpenFileA set test.cBytes to %d\n", test.cBytes); + ok(test.cBytes == sizeof(OFSTRUCT), "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == 0, "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); - ok(lstrcmpA(test.szPathName, expected) == 0 || - lstrcmpA(test.szPathName, short_expected) == 0, /* Win9x */ + ok(lstrcmpA(test.szPathName, expected) == 0, "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n", test.szPathName, expected, short_expected); LZClose(file); @@ -275,8 +234,7 @@ static void test_LZOpenFileA_nonexisting_compressed(void) "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_FILE_NOT_FOUND, "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); - ok(lstrcmpA(test.szPathName, expected) == 0 || - strncmp(test.szPathName, filled_0xA5, OFS_MAXPATHNAME) == 0, /* Win9x */ + ok(lstrcmpA(test.szPathName, expected) == 0, "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n", test.szPathName, expected, filled_0xA5); @@ -296,8 +254,7 @@ static void test_LZOpenFileA_nonexisting_compressed(void) "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_FILE_NOT_FOUND, "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); - ok(lstrcmpA(test.szPathName, expected) == 0 || - strncmp(test.szPathName, filled_0xA5, OFS_MAXPATHNAME) == 0, /* Win9x */ + ok(lstrcmpA(test.szPathName, expected) == 0, "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n", test.szPathName, expected, filled_0xA5); @@ -317,8 +274,7 @@ static void test_LZOpenFileA_nonexisting_compressed(void) "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_FILE_NOT_FOUND, "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); - ok(lstrcmpA(test.szPathName, expected) == 0 || - strncmp(test.szPathName, filled_0xA5, OFS_MAXPATHNAME) == 0, /* Win9x */ + ok(lstrcmpA(test.szPathName, expected) == 0, "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n", test.szPathName, expected, filled_0xA5); @@ -338,8 +294,7 @@ static void test_LZOpenFileA_nonexisting_compressed(void) "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_FILE_NOT_FOUND, "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); - ok(lstrcmpA(test.szPathName, expected) == 0 || - strncmp(test.szPathName, filled_0xA5, OFS_MAXPATHNAME) == 0, /* Win9x */ + ok(lstrcmpA(test.szPathName, expected) == 0, "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n", test.szPathName, expected, filled_0xA5); } @@ -370,8 +325,7 @@ static void test_LZOpenFileA(void) ok(file >= 0, "LZOpenFileA failed on creation\n"); ok(test.cBytes == sizeof(OFSTRUCT), "LZOpenFileA set test.cBytes to %d\n", test.cBytes); - ok(test.nErrCode == ERROR_SUCCESS || - broken(test.nErrCode != ERROR_SUCCESS), /* win9x */ + 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", @@ -389,13 +343,11 @@ static void test_LZOpenFileA(void) /* a, for reading. */ file = LZOpenFileA(filename_, &test, OF_READ); ok(file >= 0, "LZOpenFileA failed on read\n"); - ok(test.cBytes == sizeof(OFSTRUCT) || - broken(test.cBytes == FIELD_OFFSET(OFSTRUCT, szPathName) + lstrlenA(test.szPathName)), /* win9x */ + ok(test.cBytes == sizeof(OFSTRUCT), "LZOpenFileA set test.cBytes to %d '%s'('%s')\n", test.cBytes, expected, short_expected); ok(test.nErrCode == ERROR_SUCCESS, "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); - ok(lstrcmpA(test.szPathName, expected) == 0 || - lstrcmpA(test.szPathName, short_expected) == 0, /* Win9x */ + ok(lstrcmpA(test.szPathName, expected) == 0, "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n", test.szPathName, expected, short_expected); LZClose(file); @@ -405,13 +357,11 @@ static void test_LZOpenFileA(void) /* b, for writing. */ file = LZOpenFileA(filename_, &test, OF_WRITE); ok(file >= 0, "LZOpenFileA failed on write\n"); - ok(test.cBytes == sizeof(OFSTRUCT) || - broken(test.cBytes == FIELD_OFFSET(OFSTRUCT, szPathName) + lstrlenA(test.szPathName)), /* win9x */ + ok(test.cBytes == sizeof(OFSTRUCT), "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 || - lstrcmpA(test.szPathName, short_expected) == 0, /* Win9x */ + ok(lstrcmpA(test.szPathName, expected) == 0, "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n", test.szPathName, expected, short_expected); LZClose(file); @@ -421,13 +371,11 @@ static void test_LZOpenFileA(void) /* c, for reading and writing. */ file = LZOpenFileA(filename_, &test, OF_READWRITE); ok(file >= 0, "LZOpenFileA failed on read/write\n"); - ok(test.cBytes == sizeof(OFSTRUCT) || - broken(test.cBytes == FIELD_OFFSET(OFSTRUCT, szPathName) + lstrlenA(test.szPathName)), /* win9x */ + ok(test.cBytes == sizeof(OFSTRUCT), "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 || - lstrcmpA(test.szPathName, short_expected) == 0, /* Win9x */ + ok(lstrcmpA(test.szPathName, expected) == 0, "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n", test.szPathName, expected, short_expected); LZClose(file); @@ -437,13 +385,11 @@ static void test_LZOpenFileA(void) /* d, for checking file existence. */ file = LZOpenFileA(filename_, &test, OF_EXIST); ok(file >= 0, "LZOpenFileA failed on read/write\n"); - ok(test.cBytes == sizeof(OFSTRUCT) || - broken(test.cBytes == FIELD_OFFSET(OFSTRUCT, szPathName) + lstrlenA(test.szPathName)), /* win9x */ + ok(test.cBytes == sizeof(OFSTRUCT), "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 || - lstrcmpA(test.szPathName, short_expected) == 0, /* Win9x */ + ok(lstrcmpA(test.szPathName, expected) == 0, "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n", test.szPathName, expected, short_expected); LZClose(file); @@ -453,13 +399,11 @@ static void test_LZOpenFileA(void) /* Delete the file then make sure it doesn't exist anymore. */ file = LZOpenFileA(filename_, &test, OF_DELETE); ok(file >= 0, "LZOpenFileA failed on delete\n"); - ok(test.cBytes == sizeof(OFSTRUCT) || - broken(test.cBytes == FIELD_OFFSET(OFSTRUCT, szPathName) + lstrlenA(test.szPathName)), /* win9x */ + ok(test.cBytes == sizeof(OFSTRUCT), "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 || - lstrcmpA(test.szPathName, short_expected) == 0, /* Win9x */ + ok(lstrcmpA(test.szPathName, expected) == 0, "LZOpenFileA returned '%s', but was expected to return '%s' or '%s'\n", test.szPathName, expected, short_expected); LZClose(file);