kernel32/tests : added tests for copyfileex try7

Alexandre Julliard julliard at winehq.org
Wed Feb 6 07:57:43 CST 2013


Patrick Rudolph <siro at das-labor.org> writes:

> +    if( !GetTempPathA( MAX_PATH,tmppath ) )
> +    {
> +        win_skip("GetTempPathA failed\n");
> +        return;
> +    }
> +
> +    /* create a dummy file for copy tests */
> +    if( !GetTempFileNameA( tmppath,"IN",0,source_name ) )
> +    {
> +        win_skip("GetTempFileNameA failed\n");
> +        return;
> +    }
> +
> +    /* create a dummy file for copy tests */
> +    if( !GetTempFileNameA( tmppath,"OUT",0,dest_name ) )
> +    {
> +        win_skip("GetTempFileNameA failed\n");
> +        return;
> +    }
> +
> +    source_handle = CreateFileA( source_name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 );
> +    if( !source_handle )
> +    {
> +        win_skip("CreateFileA failed (%d)\n", GetLastError());
> +        return;
> +    }
> +
> +#define COPYFILEEXFILESIZE 10000000
> +
> +    /* set filesize to COPYFILEEXFILESIZE */
> +    TotalFileSize.QuadPart = COPYFILEEXFILESIZE;
> +
> +    if( !pSetFilePointerEx(source_handle,TotalFileSize,NULL,FILE_BEGIN) )
> +    {
> +        win_skip("SetFilePointerEx failed (%d)\n", GetLastError());
> +        return;
> +    }
> +
> +    if( !pSetEndOfFile(source_handle) )
> +    {
> +        win_skip("SetEndOfFile failed (%d)\n", GetLastError());
> +        return;
> +    }

All these calls are not supposed to fail on Windows either. win_skip is
not appropriate.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list