avifil32: Skip tests when we couldn't create or open the AVI file

GOUJON Alexandre ale.goujon at gmail.com
Thu Feb 10 09:30:19 CST 2011


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 !



More information about the wine-devel mailing list