Re: lz32: remove dead code from the LZOpenFileW test.
Saulius Krasuckas wrote:
+ ok(file >= 0, "LZOpenFileW failed on switching to a compressed file name\n"); .. + ok(test.nErrCode == 0, "LZOpenFileW set test.nErrCode to %d\n", + test.nErrCode);
Did you mean "test.nErrCode == ERROR_SUCCESS"? You test the Errorcode here, but you did not use SetLastError() before LZOpenFileW.
+ ok(lstrcmpA(test.szPathName, expected) == 0, + "LZOpenFileW returned '%s', but was expected to return '%s'\n", + test.szPathName, expected);
This is strange: An ANSI-Compare for an UNICODE-Function. After reading the source and OFSTRUCT, this is correct. I suggest a command before the above "ok()". An extra Patch with the WINAPI-Documentation for the Implementation would be nice. This should include a note, that the ANSI-String "szPathName" in "OFSTRUCT" is the correct Parameter for the UNICODE-Implementation. ---- cut ---- This part from your previous Patch is already in the tree, but:
+ /* Delete the file then make sure it doesn't exist anymore. */ + file = LZOpenFileW(filename_W, &test, OF_DELETE); + ok(file >= 0, "LZOpenFileA failed on delete\n");
+ retval = GetFileAttributesW(filename_W); + ok(retval == INVALID_FILE_ATTRIBUTES, + "GetFileAttributesA succeeded on deleted file\n");
The Messages in the "W"-Tests have ANSI Function-Names -- By By ... ... Detlef
* On Tue, 20 Jun 2006, Detlef Riekenberg wrote:
* Saulius Krasuckas wrote:
+ ok(file >= 0, "LZOpenFileW failed on switching to a compressed file name\n"); .. + ok(test.nErrCode == 0, "LZOpenFileW set test.nErrCode to %d\n", + test.nErrCode);
Did you mean "test.nErrCode == ERROR_SUCCESS"?
Yes, should I use the constant name in a case of success?
You test the Errorcode here, but you did not use SetLastError() before LZOpenFileW.
Well, I didn't because I don't test using GetLastError(). But you are right, I was too fast (falling asleep) and removed this needed line tonight: - memset(&test, 0xA5, sizeof(test)); Will put that back.
An extra Patch with the WINAPI-Documentation for the Implementation would be nice.
It was planned to be added as soon as I get on the stuff that LZOpenFile* does :)
This should include a note, that the ANSI-String "szPathName" in "OFSTRUCT" is the correct Parameter for the UNICODE-Implementation.
Uhu, quite confusing, isn't it? I was trying to eliminate LZOpenFileW -> LZOpenFileA crosscall and this confusion was a reason to write tests.
The Messages in the "W"-Tests have ANSI Function-Names
Aha, copy&paste quirks. Thanks, Detlef.
participants (2)
-
Detlef Riekenberg -
Saulius Krasuckas