uianimation/tests: Enable compilation with long types.
[wine.git] / dlls / uianimation / tests / uianimation.c
blob8aedd2e4bcf3541c2cc7d2367ccd2b8cb5aab512
1 /*
2 * UI Animation tests
4 * Copyright 2019 Alistair Leslie-Hughes
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
21 #define COBJMACROS
23 #include "windows.h"
24 #include "initguid.h"
25 #include "uianimation.h"
27 #include "wine/test.h"
29 static void test_UIAnimationManager(void)
31 HRESULT hr;
32 IUIAnimationManager *manager;
33 IUIAnimationVariable *variable;
34 IUIAnimationStoryboard *storyboard;
36 hr = CoCreateInstance( &CLSID_UIAnimationManager, NULL, CLSCTX_ALL, &IID_IUIAnimationManager, (LPVOID*)&manager);
37 if(FAILED(hr))
39 win_skip("UIAnimationManager not found\n");
40 return;
43 hr = IUIAnimationManager_CreateAnimationVariable(manager, 1.0f, &variable);
44 ok(hr == S_OK, "got 0x%08lx\n", hr);
45 if (hr == S_OK)
46 IUIAnimationVariable_Release(variable);
48 hr = IUIAnimationManager_CreateStoryboard(manager, &storyboard);
49 ok(hr == S_OK, "got 0x%08lx\n", hr);
50 if (hr == S_OK)
51 IUIAnimationStoryboard_Release(storyboard);
53 IUIAnimationManager_Release(manager);
56 static void test_IUIAnimationTimer(void)
58 HRESULT hr;
59 IUIAnimationTimer *timer;
61 hr = CoCreateInstance( &CLSID_UIAnimationTimer, NULL, CLSCTX_ALL, &IID_IUIAnimationTimer, (void**)&timer);
62 if(FAILED(hr))
64 win_skip("IUIAnimationTimer not found\n");
65 return;
68 hr = IUIAnimationTimer_IsEnabled(timer);
69 todo_wine ok(hr == S_FALSE, "got 0x%08lx\n", hr);
71 hr = IUIAnimationTimer_Enable(timer);
72 ok(hr == S_OK, "got 0x%08lx\n", hr);
74 hr = IUIAnimationTimer_Enable(timer);
75 todo_wine ok(hr == S_FALSE, "got 0x%08lx\n", hr);
77 hr = IUIAnimationTimer_IsEnabled(timer);
78 todo_wine ok(hr == S_OK, "got 0x%08lx\n", hr);
80 hr = IUIAnimationTimer_Disable(timer);
81 todo_wine ok(hr == S_OK, "got 0x%08lx\n", hr);
83 hr = IUIAnimationTimer_Disable(timer);
84 todo_wine ok(hr == S_FALSE, "got 0x%08lx\n", hr);
86 hr = IUIAnimationTimer_IsEnabled(timer);
87 todo_wine ok(hr == S_FALSE, "got 0x%08lx\n", hr);
89 IUIAnimationTimer_Release(timer);
92 static void test_IUIAnimationTransitionFactory(void)
94 HRESULT hr;
95 IUIAnimationTransitionFactory *factory;
96 IUIAnimationTransition *transition = NULL;
98 hr = CoCreateInstance( &CLSID_UIAnimationTransitionFactory, NULL, CLSCTX_ALL,
99 &IID_IUIAnimationTransitionFactory, (void**)&factory);
100 if (FAILED(hr))
102 win_skip("IUIAnimationTransitionFactory not found\n");
103 return;
106 hr = IUIAnimationTransitionFactory_CreateTransition(factory, NULL, &transition);
107 todo_wine ok(hr == E_POINTER, "got 0x%08lx\n", hr);
109 IUIAnimationTransitionFactory_Release(factory);
112 static void test_IUIAnimationTransitionLibrary(void)
114 HRESULT hr;
115 IUIAnimationTransitionLibrary *library;
116 IUIAnimationTransition *instantaneous, *linear, *smooth;
118 hr = CoCreateInstance( &CLSID_UIAnimationTransitionLibrary, NULL, CLSCTX_ALL,
119 &IID_IUIAnimationTransitionLibrary, (void**)&library);
120 if (FAILED(hr))
122 win_skip("IUIAnimationTransitionLibrary not found\n");
123 return;
126 hr = IUIAnimationTransitionLibrary_CreateInstantaneousTransition(library, 100.0, &instantaneous);
127 todo_wine ok(hr == S_OK, "got 0x%08lx\n", hr);
128 if (hr == S_OK)
129 IUIAnimationTransition_Release(instantaneous);
131 hr = IUIAnimationTransitionLibrary_CreateLinearTransition(library, 500.0, 100.0, &linear);
132 todo_wine ok(hr == S_OK, "got 0x%08lx\n", hr);
133 if (hr == S_OK)
134 IUIAnimationTransition_Release(linear);
136 hr = IUIAnimationTransitionLibrary_CreateSmoothStopTransition(library, 500.0, 100.0, &smooth);
137 todo_wine ok(hr == S_OK, "got 0x%08lx\n", hr);
138 if (hr == S_OK)
139 IUIAnimationTransition_Release(smooth);
141 IUIAnimationTransitionLibrary_Release(library);
144 START_TEST(uianimation)
146 HRESULT hr;
148 hr = CoInitialize(0);
149 ok(hr == S_OK, "failed to init com\n");
150 if(hr != S_OK)
151 return;
153 test_UIAnimationManager();
154 test_IUIAnimationTimer();
155 test_IUIAnimationTransitionFactory();
156 test_IUIAnimationTransitionLibrary();
158 CoUninitialize();