2 * Unit test suite for AVI Functions
4 * Copyright 2008 Detlef Riekenberg
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include "wine/test.h"
31 /* ########################### */
33 static const CHAR winetest0[] = "winetest0";
34 static const CHAR winetest1[] = "winetest1";
36 /* ########################### */
38 static void test_AVISaveOptions(void)
40 AVICOMPRESSOPTIONS options[2];
41 LPAVICOMPRESSOPTIONS poptions[2];
42 PAVISTREAM streams[2] = {NULL, NULL};
47 poptions[0] = &options[0];
48 poptions[1] = &options[1];
49 ZeroMemory(options, sizeof(options));
51 SetLastError(0xdeadbeef);
52 hres = CreateEditableStream(&streams[0], NULL);
53 ok(hres == AVIERR_OK, "0: got 0x%x and %p (expected AVIERR_OK)\n", hres, streams[0]);
55 SetLastError(0xdeadbeef);
56 hres = CreateEditableStream(&streams[1], NULL);
57 ok(hres == AVIERR_OK, "1: got 0x%x and %p (expected AVIERR_OK)\n", hres, streams[1]);
59 SetLastError(0xdeadbeef);
60 hres = EditStreamSetNameA(streams[0], winetest0);
61 todo_wine ok(hres == AVIERR_OK, "0: got 0x%x (expected AVIERR_OK)\n", hres);
63 SetLastError(0xdeadbeef);
64 hres = EditStreamSetNameA(streams[1], winetest1);
65 todo_wine ok(hres == AVIERR_OK, "1: got 0x%x (expected AVIERR_OK)\n", hres);
67 if (winetest_interactive) {
68 SetLastError(0xdeadbeef);
69 res = AVISaveOptions(0, ICMF_CHOOSE_DATARATE |ICMF_CHOOSE_KEYFRAME | ICMF_CHOOSE_ALLCOMPRESSORS,
70 2, streams, poptions);
71 trace("got %u with 0x%x/%u\n", res, GetLastError(), GetLastError());
74 SetLastError(0xdeadbeef);
75 lres = AVISaveOptionsFree(2, poptions);
76 ok(lres == AVIERR_OK, "got 0x%x with 0x%x/%u\n", lres, GetLastError(), GetLastError());
78 SetLastError(0xdeadbeef);
79 res = AVIStreamRelease(streams[0]);
80 ok(res == 0, "0: got refcount %u (expected 0)\n", res);
82 SetLastError(0xdeadbeef);
83 res = AVIStreamRelease(streams[1]);
84 ok(res == 0, "1: got refcount %u (expected 0)\n", res);
88 /* ########################### */
94 test_AVISaveOptions();