avifile tests

Vitaliy Margolen wine-devel at kievinfo.com
Wed Dec 30 09:02:04 CST 2009


Julius Schwartzenberg wrote:
> +static void init_test_struct(COMMON_AVI_HEADERS *cah)
> +{
> +    memcpy(&cah->mah, &defmah, sizeof(defmah));
> +    memcpy(&cah->ash0, &defash0, sizeof(defash0));
> +    memcpy(&cah->ash1, &defash1, sizeof(defash1));
> +    memcpy(&cah->pcmwf, &defpcmwf, sizeof(defpcmwf));
> +}
You don't need to use memcpy to copy structures. Simple assignment is
enough. Eg: cah->mah = defmah;

> +static void create_avi_file(const COMMON_AVI_HEADERS *cah)
> +{
> +    HANDLE hFile;
> +    DWORD written;
> +
> +    hFile = CreateFile("small.avi", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
For tests you should always specify full path. Here you probably want to get
system's tmp directory.

> +static void test_default_data(void)
> +{
>
> +    res = AVIFileOpen(&pFile, "small.avi", OF_SHARE_DENY_WRITE, 0L);
Same thing here.


Vitaliy.



More information about the wine-devel mailing list