On 01/30/2011 07:29 PM, Alexandre Goujon wrote:
dlls/avifil32/tests/api.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/dlls/avifil32/tests/api.c b/dlls/avifil32/tests/api.c index 14ad4b4..c1ba878 100644 --- a/dlls/avifil32/tests/api.c +++ b/dlls/avifil32/tests/api.c @@ -338,6 +338,12 @@ static void create_avi_file(const COMMON_AVI_HEADERS *cah, char *filename)
ok(hFile != INVALID_HANDLE_VALUE, "Couldn't create file\n");
- if(hFile == INVALID_HANDLE_VALUE)
- {
win_skip("Could not create the AVI file\n");
return;
- }
WriteFile(hFile,&cah->fh, sizeof(deffh),&written, NULL); WriteFile(hFile,&cah->mah, sizeof(MainAVIHeader),&written, NULL); WriteFile(hFile, streamlist, sizeof(streamlist),&written, NULL);
@@ -380,6 +386,12 @@ static void test_default_data(void) ok(res != REGDB_E_CLASSNOTREG, "Unable to open file: error5=%u\n", REGDB_E_CLASSNOTREG); ok(res == 0, "Unable to open file: error=%u\n", res);
- if(res != 0)
- {
win_skip("Could not open the file.\n");
return;
- }
res = AVIFileGetStream(pFile,&pStream0, 0, 0); ok(res == 0, "Unable to open video stream: error=%u\n", res);
I know I sent this patch about two weeks ago but I thought it was pending because of the 1.3.13 release. So, does anyone has an idea how to make this patch applied in the current tree ?
The context is that we don't fail when we couldn't create or open the AVI file. (I think the title of the patch is explicit) Thus, we call "WriteFile(hFile" in the first part of the test even if hFile == INVALID_HANDLE_VALUE. In the second part, we call "AVIFileGetStream(pFile" even if "AVIFileOpen(&pFile" failed.
I can also resend this appending [resent]. Just let me know what to do.
Thanks !
GOUJON Alexandre wrote:
I know I sent this patch about two weeks ago but I thought it was pending because of the 1.3.13 release. So, does anyone has an idea how to make this patch applied in the current tree ?
The context is that we don't fail when we couldn't create or open the AVI file. (I think the title of the patch is explicit) Thus, we call "WriteFile(hFile" in the first part of the test even if hFile == INVALID_HANDLE_VALUE. In the second part, we call "AVIFileGetStream(pFile" even if "AVIFileOpen(&pFile" failed.
Is there a specific situation in which the file creation fails? I expected the temporary directory would always be writable when I created it like that. Maybe that is not a good assumption when writing tests though?
Thanks, Julius
On 02/11/2011 12:10 AM, Julius Schwartzenberg wrote:
Is there a specific situation in which the file creation fails? I expected the temporary directory would always be writable when I created it like that. Maybe that is not a good assumption when writing tests though?
I wrote the patch because of the crash seen here : http://test.winehq.org/data/020245bba10e15e2a1b415f4a4a08d43f9fb1025/xp_naol...
However, I contacted the user who submitted it and it was in fact a "stripped" version of Windows. Nevertheless, I do think the case could happen again (not enough disk space for instance). Moreover, it's basically a "if" "win_skip" and "return" so it won't slow down the test.
What do you think ? Does it worth applying my patch ? Well, it's up to you; you know my point of view.
Thanks
Nevertheless, I do think the case could happen again (not enough disk space for instance).
IMO, cases like this aren't worth worrying about. They're like out of memory conditions: sure, they can happen, but there's not much we can do about them. The disk space requirements of the tests aren't large, so testers should ensure they have a reasonable amount available. --Juan