ReactOS  0.4.15-dev-1070-ge1a01de
timeline.c File Reference
#include "wine/test.h"
#include "qedit.h"
Include dependency graph for timeline.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 

Functions

static void test_timeline (void)
 
static void test_timelineobj_interfaces (void)
 
 START_TEST (timeline)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file timeline.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 22 of file timeline.c.

Function Documentation

◆ START_TEST()

START_TEST ( timeline  )

Definition at line 148 of file timeline.c.

149 {
151  test_timeline();
153  CoUninitialize();
154 }
smooth NULL
Definition: ftsmooth.c:416
static void test_timeline(void)
Definition: timeline.c:27
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
static void test_timelineobj_interfaces(void)
Definition: timeline.c:114

◆ test_timeline()

static void test_timeline ( void  )
static

Definition at line 27 of file timeline.c.

28 {
29  HRESULT hr;
30  IAMTimeline *timeline = NULL;
31  IAMTimeline *timeline2 = (IAMTimeline *)0xdeadbeef;
32  IAMTimelineObj *obj = (IAMTimelineObj *)0xdeadbeef;
33  IAMTimelineObj obj_iface;
35 
36  hr = CoCreateInstance(&CLSID_AMTimeline, NULL, CLSCTX_INPROC_SERVER, &IID_IAMTimeline, (void **)&timeline);
37  ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "CoCreateInstance failed: %08x\n", hr);
38  if (!timeline) return;
39 
40  hr = IAMTimeline_QueryInterface(timeline, &IID_IAMTimelineObj, NULL);
41  ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
42 
43  hr = IAMTimeline_QueryInterface(timeline, &IID_IAMTimelineObj, (void **)&obj);
44  ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE got %08x\n", hr);
45  ok(!obj, "Expected NULL got %p\n", obj);
46 
47  hr = IAMTimeline_CreateEmptyNode(timeline, NULL, 0);
48  ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
49 
50  hr = IAMTimeline_CreateEmptyNode(timeline, NULL, TIMELINE_MAJOR_TYPE_COMPOSITE);
51  ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
52 
53  for (type = 0; type < 256; type++)
54  {
55  obj = &obj_iface;
56  hr = IAMTimeline_CreateEmptyNode(timeline, &obj, type);
57  switch (type)
58  {
65  ok(hr == S_OK, "CreateEmptyNode failed: %08x\n", hr);
66  if (obj != &obj_iface) IAMTimelineObj_Release(obj);
67  break;
68  default:
69  ok(hr == E_INVALIDARG, "Expected E_INVALIDARG got %08x\n", hr);
70  ok(obj == &obj_iface, "Expected %p got %p\n", &obj_iface, obj);
71  }
72  }
73 
74  obj = NULL;
75  hr = IAMTimeline_CreateEmptyNode(timeline, &obj, TIMELINE_MAJOR_TYPE_COMPOSITE);
76  ok(hr == S_OK, "CreateEmptyNode failed: %08x\n", hr);
77  if (!obj) return;
78 
79  hr = IAMTimelineObj_QueryInterface(obj, &IID_IAMTimeline, NULL);
80  ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
81 
82  hr = IAMTimelineObj_QueryInterface(obj, &IID_IAMTimeline, (void **)&timeline2);
83  ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE got %08x\n", hr);
84  ok(!timeline2, "Expected NULL got %p\n", timeline2);
85 
86  hr = IAMTimelineObj_GetTimelineType(obj, NULL);
87  ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
88 
89  hr = IAMTimelineObj_GetTimelineType(obj, &type);
90  ok(hr == S_OK, "GetTimelineType failed: %08x\n", hr);
91  ok(type == TIMELINE_MAJOR_TYPE_COMPOSITE, "Expected TIMELINE_MAJOR_TYPE_COMPOSITE got %d\n", type);
92 
93  for (type = 0; type < 256; type++)
94  {
95  hr = IAMTimelineObj_SetTimelineType(obj, type);
97  ok(hr == S_OK, "SetTimelineType failed: %08x\n", hr);
98  else
99  ok(hr == E_INVALIDARG, "Expected E_INVALIDARG got %08x\n", hr);
100  }
101 
102  hr = IAMTimelineObj_GetTimelineNoRef(obj, NULL);
103  ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
104 
105  timeline2 = (IAMTimeline *)0xdeadbeef;
106  hr = IAMTimelineObj_GetTimelineNoRef(obj, &timeline2);
107  ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE got %08x\n", hr);
108  ok(!timeline2, "Expected NULL got %p\n", timeline2);
109 
110  IAMTimelineObj_Release(obj);
111  IAMTimeline_Release(timeline);
112 }
#define E_NOINTERFACE
Definition: winerror.h:2364
TIMELINE_MAJOR_TYPE
Definition: qedit.idl:302
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:79
#define broken(x)
Definition: _sntprintf.h:21
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:51
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
#define ok(value,...)
Definition: atltest.h:57
#define E_POINTER
Definition: winerror.h:2365

Referenced by START_TEST().

◆ test_timelineobj_interfaces()

static void test_timelineobj_interfaces ( void  )
static

Definition at line 114 of file timeline.c.

115 {
116  HRESULT hr;
117  IAMTimeline *timeline = NULL;
119 
120  hr = CoCreateInstance(&CLSID_AMTimeline, NULL, CLSCTX_INPROC_SERVER, &IID_IAMTimeline, (void **)&timeline);
121  ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "CoCreateInstance failed: %08x\n", hr);
122  if (!timeline)
123  return;
124 
125  hr = IAMTimeline_CreateEmptyNode(timeline, &obj, TIMELINE_MAJOR_TYPE_GROUP);
126  ok(hr == S_OK, "CreateEmptyNode failed: %08x\n", hr);
127  if(hr == S_OK)
128  {
130  IAMTimelineObj *obj2;
131 
132  hr = IAMTimelineObj_QueryInterface(obj, &IID_IAMTimelineGroup, (void **)&group);
133  ok(hr == S_OK, "got %08x\n", hr);
134 
135  hr = IAMTimelineGroup_QueryInterface(group, &IID_IAMTimelineObj, (void **)&obj2);
136  ok(hr == S_OK, "got %08x\n", hr);
137  ok(obj == obj2, "Different pointers\n");
138  IAMTimelineObj_Release(obj2);
139 
140  IAMTimelineGroup_Release(group);
141 
142  IAMTimelineObj_Release(obj);
143  }
144 
145  IAMTimeline_Release(timeline);
146 }
HRESULT hr
Definition: shlfolder.c:183
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
smooth NULL
Definition: ftsmooth.c:416
GLboolean GLuint group
Definition: glext.h:11120
LONG HRESULT
Definition: typedefs.h:79
#define broken(x)
Definition: _sntprintf.h:21
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:51
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
#define ok(value,...)
Definition: atltest.h:57

Referenced by START_TEST().