[PATCH v2 1/5] qedit/tests: Add timeline object creation tests.
Andrew Eikum
aeikum at codeweavers.com
Wed Apr 27 08:50:29 CDT 2016
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
On Tue, Apr 26, 2016 at 11:12:46PM -0600, Alex Henrie wrote:
> Cc: Andrew Eikum <aeikum at codeweavers.com>
>
> On Windows, if you try to create an AMTimelineObj with
> CoCreateInstance(&CLSID_AMTimelineObj, ...) you get REGDB_E_CLASSNOTREG.
> I thought about adding a test for this, but in the end decided that it
> wasn't worth adding a useless definition to qedit.idl.
>
> Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
> ---
> dlls/qedit/tests/Makefile.in | 3 +-
> dlls/qedit/tests/timeline.c | 90 ++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 92 insertions(+), 1 deletion(-)
> create mode 100644 dlls/qedit/tests/timeline.c
>
> diff --git a/dlls/qedit/tests/Makefile.in b/dlls/qedit/tests/Makefile.in
> index 17d027f..07dd4b0 100644
> --- a/dlls/qedit/tests/Makefile.in
> +++ b/dlls/qedit/tests/Makefile.in
> @@ -2,6 +2,7 @@ TESTDLL = qedit.dll
> IMPORTS = oleaut32 ole32
>
> C_SRCS = \
> - mediadet.c
> + mediadet.c \
> + timeline.c
>
> RC_SRCS = qedit.rc
> diff --git a/dlls/qedit/tests/timeline.c b/dlls/qedit/tests/timeline.c
> new file mode 100644
> index 0000000..6746b7d
> --- /dev/null
> +++ b/dlls/qedit/tests/timeline.c
> @@ -0,0 +1,90 @@
> +/*
> + * Unit tests for Timeline
> + *
> + * Copyright (C) 2016 Alex Henrie
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
> + */
> +
> +#define COBJMACROS
> +#define CONST_VTABLE
> +
> +#include "wine/test.h"
> +#include "qedit.h"
> +
> +static void test_timeline(void)
> +{
> + HRESULT hr;
> + IAMTimeline *timeline = NULL;
> + IAMTimeline *timeline2 = (IAMTimeline *)0xdeadbeef;
> + IAMTimelineObj *obj;
> + IAMTimelineObj obj_iface;
> + TIMELINE_MAJOR_TYPE type;
> +
> + hr = CoCreateInstance(&CLSID_AMTimeline, NULL, CLSCTX_INPROC_SERVER, &IID_IAMTimeline, (void **)&timeline);
> + ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "CoCreateInstance failed: %08x\n", hr);
> + if (!timeline) return;
> +
> + hr = IAMTimeline_CreateEmptyNode(timeline, NULL, 0);
> +todo_wine
> + ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
> +
> + hr = IAMTimeline_CreateEmptyNode(timeline, NULL, TIMELINE_MAJOR_TYPE_COMPOSITE);
> +todo_wine
> + ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
> +
> + for (type = 0; type < 256; type++)
> + {
> + obj = &obj_iface;
> + hr = IAMTimeline_CreateEmptyNode(timeline, &obj, type);
> + switch (type)
> + {
> + case TIMELINE_MAJOR_TYPE_COMPOSITE:
> + case TIMELINE_MAJOR_TYPE_TRACK:
> + case TIMELINE_MAJOR_TYPE_SOURCE:
> + case TIMELINE_MAJOR_TYPE_TRANSITION:
> + case TIMELINE_MAJOR_TYPE_EFFECT:
> + case TIMELINE_MAJOR_TYPE_GROUP:
> +todo_wine
> + ok(hr == S_OK, "CreateEmptyNode failed: %08x\n", hr);
> + if (obj != &obj_iface) IAMTimelineObj_Release(obj);
> + break;
> + default:
> +todo_wine
> + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG got %08x\n", hr);
> + ok(obj == &obj_iface, "Expected %p got %p\n", &obj_iface, obj);
> + }
> + }
> +
> + obj = NULL;
> + hr = IAMTimeline_CreateEmptyNode(timeline, &obj, TIMELINE_MAJOR_TYPE_COMPOSITE);
> +todo_wine
> + ok(hr == S_OK, "CreateEmptyNode failed: %08x\n", hr);
> + if (!obj) return;
> +
> + hr = IAMTimelineObj_QueryInterface(obj, &IID_IAMTimeline, NULL);
> + ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
> +
> + hr = IAMTimelineObj_QueryInterface(obj, &IID_IAMTimeline, (void **)&timeline2);
> + ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE got %08x\n", hr);
> + ok(!timeline2, "Expected NULL got %p\n", timeline2);
> +}
> +
> +START_TEST(timeline)
> +{
> + CoInitialize(NULL);
> + test_timeline();
> + CoUninitialize();
> +}
> --
> 2.8.0
>
More information about the wine-patches
mailing list