comctl32: Fix the tooltips behaviour when TTF_ABSOLUTE isn't specified.
[wine] / dlls / comctl32 / tests / updown.c
1 /* Unit tests for the up-down control
2  *
3  * Copyright 2005 C. Scott Ananian
4  * Copyright (C) 2007 James Hawkins
5  * Copyright (C) 2007 Leslie Choong
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22 /* TO TEST:
23  *   - send click messages to the up-down control, check the current position
24  *   - up-down control automatically positions itself next to its buddy window
25  *   - up-down control sets the caption of the buddy window
26  *   - test CreateUpDownControl API
27  *   - check UDS_AUTOBUDDY style, up-down control selects previous window in z-order
28  *   - check UDM_SETBUDDY message
29  *   - check UDM_GETBUDDY message
30  *   - up-down control and buddy control must have the same parent
31  *   - up-down control notifies its parent window when its position changes with UDN_DELTAPOS + WM_VSCROLL or WM_HSCROLL
32  *   - check UDS_ALIGN[LEFT,RIGHT]...check that width of buddy window is decreased
33  *   - check that UDS_SETBUDDYINT sets the caption of the buddy window when it is changed
34  *   - check that the thousands operator is set for large numbers
35  *   - check that the thousands operator is not set with UDS_NOTHOUSANDS
36  *   - check UDS_ARROWKEYS, control subclasses the buddy window so that it processes the keys when it has focus
37  *   - check UDS_HORZ
38  *   - check changing past min/max values
39  *   - check UDS_WRAP wraps values past min/max, incrementing past upper value wraps position to lower value
40  *   - can change control's position, min/max pos, radix
41  *   - check UDM_GETPOS, for up-down control with a buddy window, position is the caption of the buddy window, so change the
42  *     caption of the buddy window then call UDM_GETPOS
43  *   - check UDM_SETRANGE, max can be less than min, so clicking the up arrow decreases the current position
44  *   - more stuff to test
45  */
46
47 #include <assert.h>
48 #include <windows.h>
49 #include <commctrl.h>
50 #include <stdio.h>
51
52 #include "wine/test.h"
53 #include "msg.h"
54
55 #define expect(EXPECTED,GOT) ok((GOT)==(EXPECTED), "Expected %d, got %d\n", (EXPECTED), (GOT))
56
57 #define NUM_MSG_SEQUENCES   3
58 #define PARENT_SEQ_INDEX    0
59 #define EDIT_SEQ_INDEX      1
60 #define UPDOWN_SEQ_INDEX    2
61
62 static HWND parent_wnd, edit, updown;
63
64 static struct msg_sequence *sequences[NUM_MSG_SEQUENCES];
65
66 static const struct message create_parent_wnd_seq[] = {
67     { WM_GETMINMAXINFO, sent },
68     { WM_NCCREATE, sent },
69     { WM_NCCALCSIZE, sent|wparam, 0 },
70     { WM_CREATE, sent },
71     { WM_SHOWWINDOW, sent|wparam, 1 },
72     { WM_WINDOWPOSCHANGING, sent|wparam, 0 },
73     { WM_WINDOWPOSCHANGING, sent|wparam, 0 },
74     { WM_ACTIVATEAPP, sent|wparam, 1 },
75     { WM_NCACTIVATE, sent|wparam, 1 },
76     { WM_ACTIVATE, sent|wparam, 1 },
77     { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
78     { WM_IME_NOTIFY, sent|defwinproc|optional },
79     { WM_SETFOCUS, sent|wparam|defwinproc, 0 },
80     /* Win9x adds SWP_NOZORDER below */
81     { WM_WINDOWPOSCHANGED, sent, /*|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE*/ },
82     { WM_NCCALCSIZE, sent|wparam|optional, 1 },
83     { WM_SIZE, sent },
84     { WM_MOVE, sent },
85     { 0 }
86 };
87
88 static const struct message add_edit_to_parent_seq[] = {
89     { WM_PARENTNOTIFY, sent|wparam, WM_CREATE },
90     { 0 }
91 };
92
93 static const struct message add_updown_with_edit_seq[] = {
94     { WM_WINDOWPOSCHANGING, sent },
95     { WM_NCCALCSIZE, sent|wparam, TRUE },
96     { WM_WINDOWPOSCHANGED, sent },
97     { WM_SIZE, sent|wparam|defwinproc, SIZE_RESTORED /*, MAKELONG(91, 75) exact size depends on font */ },
98     { 0 }
99 };
100
101 static const struct message add_updown_to_parent_seq[] = {
102     { WM_NOTIFYFORMAT, sent|lparam, 0, NF_QUERY },
103     { WM_QUERYUISTATE, sent },
104     { WM_PARENTNOTIFY, sent|wparam, MAKELONG(WM_CREATE, WM_CREATE) },
105     { 0 }
106 };
107
108 static const struct message get_edit_text_seq[] = {
109     { WM_GETTEXT, sent },
110     { 0 }
111 };
112
113 static const struct message test_updown_pos_seq[] = {
114     { UDM_SETRANGE, sent|lparam, 0, MAKELONG(100,0) },
115     { UDM_GETRANGE, sent},
116     { UDM_SETPOS, sent|lparam, 0, 5},
117     { UDM_GETPOS, sent},
118     { UDM_SETPOS, sent|lparam, 0, 0},
119     { UDM_GETPOS, sent},
120     { UDM_SETPOS, sent|lparam, 0, MAKELONG(-1,0)},
121     { UDM_GETPOS, sent},
122     { UDM_SETPOS, sent|lparam, 0, 100},
123     { UDM_GETPOS, sent},
124     { UDM_SETPOS, sent|lparam, 0, 101},
125     { UDM_GETPOS, sent},
126     { 0 }
127 };
128
129 static const struct message test_updown_pos32_seq[] = {
130     { UDM_SETRANGE32, sent|lparam, 0, 1000 },
131     { UDM_GETRANGE32, sent}, /* Cannot check wparam and lparam as they are ptrs */
132     { UDM_SETPOS32, sent|lparam, 0, 500 },
133     { UDM_GETPOS32, sent},
134     { UDM_SETPOS32, sent|lparam, 0, 0 },
135     { UDM_GETPOS32, sent},
136     { UDM_SETPOS32, sent|lparam, 0, -1 },
137     { UDM_GETPOS32, sent},
138     { UDM_SETPOS32, sent|lparam, 0, 1000 },
139     { UDM_GETPOS32, sent},
140     { UDM_SETPOS32, sent|lparam, 0, 1001 },
141     { UDM_GETPOS32, sent},
142     { 0 }
143 };
144
145 static const struct message test_updown_buddy_seq[] = {
146     { UDM_GETBUDDY, sent },
147     { UDM_SETBUDDY, sent },
148     { WM_STYLECHANGING, sent|defwinproc },
149     { WM_STYLECHANGED, sent|defwinproc },
150     { WM_STYLECHANGING, sent|defwinproc },
151     { WM_STYLECHANGED, sent|defwinproc },
152     { WM_WINDOWPOSCHANGING, sent|defwinproc },
153     { WM_NCCALCSIZE, sent|wparam|optional|defwinproc, 1 },
154     { WM_WINDOWPOSCHANGED, sent|defwinproc },
155     { WM_MOVE, sent|defwinproc },
156     { UDM_GETBUDDY, sent },
157     { 0 }
158 };
159
160 static const struct message test_updown_base_seq[] = {
161     { UDM_SETBASE, sent|wparam, 10 },
162     { UDM_GETBASE, sent },
163     { UDM_SETBASE, sent|wparam, 80 },
164     { UDM_GETBASE, sent },
165     { UDM_SETBASE, sent|wparam, 16 },
166     { UDM_GETBASE, sent },
167     { UDM_SETBASE, sent|wparam, 80 },
168     { UDM_GETBASE, sent },
169     { UDM_SETBASE, sent|wparam, 10 },
170     { UDM_GETBASE, sent },
171     { 0 }
172 };
173
174 static const struct message test_updown_unicode_seq[] = {
175     { UDM_SETUNICODEFORMAT, sent|wparam, 0 },
176     { UDM_GETUNICODEFORMAT, sent },
177     { UDM_SETUNICODEFORMAT, sent|wparam, 1 },
178     { UDM_GETUNICODEFORMAT, sent },
179     { UDM_SETUNICODEFORMAT, sent|wparam, 0 },
180     { UDM_GETUNICODEFORMAT, sent },
181     { 0 }
182 };
183
184 static const struct message test_updown_destroy_seq[] = {
185     { WM_SHOWWINDOW, sent|wparam|lparam, 0, 0 },
186     { WM_WINDOWPOSCHANGING, sent},
187     { WM_WINDOWPOSCHANGED, sent},
188     { WM_DESTROY, sent},
189     { WM_NCDESTROY, sent},
190     { 0 }
191 };
192
193 static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
194 {
195     static long defwndproc_counter = 0;
196     LRESULT ret;
197     struct message msg;
198
199     /* do not log painting messages */
200     if (message != WM_PAINT &&
201         message != WM_ERASEBKGND &&
202         message != WM_NCPAINT &&
203         message != WM_NCHITTEST &&
204         message != WM_GETTEXT &&
205         message != WM_GETICON &&
206         message != WM_DEVICECHANGE)
207     {
208         trace("parent: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
209
210         msg.message = message;
211         msg.flags = sent|wparam|lparam;
212         if (defwndproc_counter) msg.flags |= defwinproc;
213         msg.wParam = wParam;
214         msg.lParam = lParam;
215         add_message(sequences, PARENT_SEQ_INDEX, &msg);
216     }
217
218     defwndproc_counter++;
219     ret = DefWindowProcA(hwnd, message, wParam, lParam);
220     defwndproc_counter--;
221
222     return ret;
223 }
224
225 static BOOL register_parent_wnd_class(void)
226 {
227     WNDCLASSA cls;
228
229     cls.style = 0;
230     cls.lpfnWndProc = parent_wnd_proc;
231     cls.cbClsExtra = 0;
232     cls.cbWndExtra = 0;
233     cls.hInstance = GetModuleHandleA(NULL);
234     cls.hIcon = 0;
235     cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
236     cls.hbrBackground = GetStockObject(WHITE_BRUSH);
237     cls.lpszMenuName = NULL;
238     cls.lpszClassName = "Up-Down test parent class";
239     return RegisterClassA(&cls);
240 }
241
242 static HWND create_parent_window(void)
243 {
244     if (!register_parent_wnd_class())
245         return NULL;
246
247     return CreateWindowEx(0, "Up-Down test parent class",
248                           "Up-Down test parent window",
249                           WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
250                           WS_MAXIMIZEBOX | WS_VISIBLE,
251                           0, 0, 100, 100,
252                           GetDesktopWindow(), NULL, GetModuleHandleA(NULL), NULL);
253 }
254
255 struct subclass_info
256 {
257     WNDPROC oldproc;
258 };
259
260 static LRESULT WINAPI edit_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
261 {
262     struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
263     static long defwndproc_counter = 0;
264     LRESULT ret;
265     struct message msg;
266
267     trace("edit: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
268
269     msg.message = message;
270     msg.flags = sent|wparam|lparam;
271     if (defwndproc_counter) msg.flags |= defwinproc;
272     msg.wParam = wParam;
273     msg.lParam = lParam;
274     add_message(sequences, EDIT_SEQ_INDEX, &msg);
275
276     defwndproc_counter++;
277     ret = CallWindowProcA(info->oldproc, hwnd, message, wParam, lParam);
278     defwndproc_counter--;
279     return ret;
280 }
281
282 static HWND create_edit_control(void)
283 {
284     struct subclass_info *info;
285     RECT rect;
286
287     info = HeapAlloc(GetProcessHeap(), 0, sizeof(struct subclass_info));
288     if (!info)
289         return NULL;
290
291     GetClientRect(parent_wnd, &rect);
292     edit = CreateWindowExA(0, "EDIT", NULL, WS_CHILD | WS_BORDER | WS_VISIBLE,
293                            0, 0, rect.right, rect.bottom,
294                            parent_wnd, NULL, GetModuleHandleA(NULL), NULL);
295     if (!edit)
296     {
297         HeapFree(GetProcessHeap(), 0, info);
298         return NULL;
299     }
300
301     info->oldproc = (WNDPROC)SetWindowLongPtrA(edit, GWLP_WNDPROC,
302                                             (LONG_PTR)edit_subclass_proc);
303     SetWindowLongPtrA(edit, GWLP_USERDATA, (LONG_PTR)info);
304
305     return edit;
306 }
307
308 static LRESULT WINAPI updown_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
309 {
310     struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
311     static long defwndproc_counter = 0;
312     LRESULT ret;
313     struct message msg;
314
315     trace("updown: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
316
317     msg.message = message;
318     msg.flags = sent|wparam|lparam;
319     if (defwndproc_counter) msg.flags |= defwinproc;
320     msg.wParam = wParam;
321     msg.lParam = lParam;
322     add_message(sequences, UPDOWN_SEQ_INDEX, &msg);
323
324     defwndproc_counter++;
325     ret = CallWindowProcA(info->oldproc, hwnd, message, wParam, lParam);
326     defwndproc_counter--;
327
328     return ret;
329 }
330
331 static HWND create_updown_control(void)
332 {
333     struct subclass_info *info;
334     HWND updown;
335     RECT rect;
336
337     info = HeapAlloc(GetProcessHeap(), 0, sizeof(struct subclass_info));
338     if (!info)
339         return NULL;
340
341     GetClientRect(parent_wnd, &rect);
342     updown = CreateUpDownControl(WS_CHILD | WS_BORDER | WS_VISIBLE | UDS_ALIGNRIGHT,
343                                  0, 0, rect.right, rect.bottom, parent_wnd, 1, GetModuleHandleA(NULL), edit,
344                                  100, 0, 50);
345     if (!updown)
346     {
347         HeapFree(GetProcessHeap(), 0, info);
348         return NULL;
349     }
350
351     info->oldproc = (WNDPROC)SetWindowLongPtrA(updown, GWLP_WNDPROC,
352                                             (LONG_PTR)updown_subclass_proc);
353     SetWindowLongPtrA(updown, GWLP_USERDATA, (LONG_PTR)info);
354
355     return updown;
356 }
357
358 static void test_updown_pos(void)
359 {
360     int r;
361
362     flush_sequences(sequences, NUM_MSG_SEQUENCES);
363
364     /* Set Range from 0 to 100 */
365     SendMessage(updown, UDM_SETRANGE, 0 , MAKELONG(100,0) );
366     r = SendMessage(updown, UDM_GETRANGE, 0,0);
367     expect(100,LOWORD(r));
368     expect(0,HIWORD(r));
369
370     /* Set the position to 5, return is not checked as it was set before func call */
371     SendMessage(updown, UDM_SETPOS, 0 , MAKELONG(5,0) );
372     /* Since UDM_SETBUDDYINT was not set at creation HIWORD(r) will always be 1 as a return from UDM_GETPOS */
373     /* Get the position, which should be 5 */
374     r = SendMessage(updown, UDM_GETPOS, 0 , 0 );
375     expect(5,LOWORD(r));
376     expect(1,HIWORD(r));
377
378     /* Set the position to 0, return should be 5 */
379     r = SendMessage(updown, UDM_SETPOS, 0 , MAKELONG(0,0) );
380     expect(5,r);
381     /* Get the position, which should be 0 */
382     r = SendMessage(updown, UDM_GETPOS, 0 , 0 );
383     expect(0,LOWORD(r));
384     expect(1,HIWORD(r));
385
386     /* Set the position to -1, return should be 0 */
387     r = SendMessage(updown, UDM_SETPOS, 0 , MAKELONG(-1,0) );
388     expect(0,r);
389     /* Get the position, which should be 0 */
390     r = SendMessage(updown, UDM_GETPOS, 0 , 0 );
391     expect(0,LOWORD(r));
392     expect(1,HIWORD(r));
393
394     /* Set the position to 100, return should be 0 */
395     r = SendMessage(updown, UDM_SETPOS, 0 , MAKELONG(100,0) );
396     expect(0,r);
397     /* Get the position, which should be 100 */
398     r = SendMessage(updown, UDM_GETPOS, 0 , 0 );
399     expect(100,LOWORD(r));
400     expect(1,HIWORD(r));
401
402     /* Set the position to 101, return should be 100 */
403     r = SendMessage(updown, UDM_SETPOS, 0 , MAKELONG(101,0) );
404     expect(100,r);
405     /* Get the position, which should be 100 */
406     r = SendMessage(updown, UDM_GETPOS, 0 , 0 );
407     expect(100,LOWORD(r));
408     expect(1,HIWORD(r));
409
410     ok_sequence(sequences, UPDOWN_SEQ_INDEX, test_updown_pos_seq , "test updown pos", FALSE);
411 }
412
413 static void test_updown_pos32(void)
414 {
415     int r;
416     int low, high;
417
418     flush_sequences(sequences, NUM_MSG_SEQUENCES);
419
420     /* Set the position to 0 to 1000 */
421     SendMessage(updown, UDM_SETRANGE32, 0 , 1000 );
422
423     r = SendMessage(updown, UDM_GETRANGE32, (WPARAM) &low , (LPARAM) &high );
424     expect(0,low);
425     expect(1000,high);
426
427     /* Set position to 500, don't check return since it is unset*/
428     SendMessage(updown, UDM_SETPOS32, 0 , 500 );
429
430     /* Since UDM_SETBUDDYINT was not set at creation bRet will always be true as a return from UDM_GETPOS32 */
431
432     r = SendMessage(updown, UDM_GETPOS32, 0 , (LPARAM) &high );
433     expect(500,r);
434     expect(1,high);
435
436     /* Set position to 0, return should be 500 */
437     r = SendMessage(updown, UDM_SETPOS32, 0 , 0 );
438     expect(500,r);
439     r = SendMessage(updown, UDM_GETPOS32, 0 , (LPARAM) &high );
440     expect(0,r);
441     expect(1,high);
442
443     /* Set position to -1 which should become 0, return should be 0 */
444     r = SendMessage(updown, UDM_SETPOS32, 0 , -1 );
445     expect(0,r);
446     r = SendMessage(updown, UDM_GETPOS32, 0 , (LPARAM) &high );
447     expect(0,r);
448     expect(1,high);
449
450     /* Set position to 1000, return should be 0 */
451     r = SendMessage(updown, UDM_SETPOS32, 0 , 1000 );
452     expect(0,r);
453     r = SendMessage(updown, UDM_GETPOS32, 0 , (LPARAM) &high );
454     expect(1000,r);
455     expect(1,high);
456
457     /* Set position to 1001 which should become 1000, return should be 1000 */
458     r = SendMessage(updown, UDM_SETPOS32, 0 , 1001 );
459     expect(1000,r);
460     r = SendMessage(updown, UDM_GETPOS32, 0 , (LPARAM) &high );
461     expect(1000,r);
462     expect(1,high);
463
464     ok_sequence(sequences, UPDOWN_SEQ_INDEX, test_updown_pos32_seq, "test updown pos32", FALSE);
465 }
466
467 static void test_updown_buddy(void)
468 {
469     HWND buddyReturn;
470
471     flush_sequences(sequences, NUM_MSG_SEQUENCES);
472
473     buddyReturn = (HWND)SendMessage(updown, UDM_GETBUDDY, 0 , 0 );
474     ok(buddyReturn == edit, "Expected edit handle\n");
475
476     buddyReturn = (HWND)SendMessage(updown, UDM_SETBUDDY, (WPARAM) edit, 0);
477     ok(buddyReturn == edit, "Expected edit handle\n");
478
479     buddyReturn = (HWND)SendMessage(updown, UDM_GETBUDDY, 0 , 0 );
480     ok(buddyReturn == edit, "Expected edit handle\n");
481
482     ok_sequence(sequences, UPDOWN_SEQ_INDEX, test_updown_buddy_seq, "test updown buddy", TRUE);
483     ok_sequence(sequences, EDIT_SEQ_INDEX, add_updown_with_edit_seq, "test updown buddy_edit", FALSE);
484 }
485
486 static void test_updown_base(void)
487 {
488     int r;
489
490     flush_sequences(sequences, NUM_MSG_SEQUENCES);
491
492     SendMessage(updown, UDM_SETBASE, 10 , 0);
493     r = SendMessage(updown, UDM_GETBASE, 0 , 0);
494     expect(10,r);
495
496     /* Set base to an invalid value, should return 0 and stay at 10 */
497     r = SendMessage(updown, UDM_SETBASE, 80 , 0);
498     expect(0,r);
499     r = SendMessage(updown, UDM_GETBASE, 0 , 0);
500     expect(10,r);
501
502     /* Set base to 16 now, should get 16 as the return */
503     r = SendMessage(updown, UDM_SETBASE, 16 , 0);
504     expect(10,r);
505     r = SendMessage(updown, UDM_GETBASE, 0 , 0);
506     expect(16,r);
507
508     /* Set base to an invalid value, should return 0 and stay at 16 */
509     r = SendMessage(updown, UDM_SETBASE, 80 , 0);
510     expect(0,r);
511     r = SendMessage(updown, UDM_GETBASE, 0 , 0);
512     expect(16,r);
513
514     /* Set base back to 10, return should be 16 */
515     r = SendMessage(updown, UDM_SETBASE, 10 , 0);
516     expect(16,r);
517     r = SendMessage(updown, UDM_GETBASE, 0 , 0);
518     expect(10,r);
519
520     ok_sequence(sequences, UPDOWN_SEQ_INDEX, test_updown_base_seq, "test updown base", FALSE);
521 }
522
523 static void test_updown_unicode(void)
524 {
525     int r;
526
527     flush_sequences(sequences, NUM_MSG_SEQUENCES);
528
529     /* Set it to ANSI, don't check return as we don't know previous state */
530     SendMessage(updown, UDM_SETUNICODEFORMAT, 0 , 0);
531     r = SendMessage(updown, UDM_GETUNICODEFORMAT, 0 , 0);
532     expect(0,r);
533
534     /* Now set it to Unicode format */
535     r = SendMessage(updown, UDM_SETUNICODEFORMAT, 1 , 0);
536     expect(0,r);
537     r = SendMessage(updown, UDM_GETUNICODEFORMAT, 0 , 0);
538     expect(1,r);
539
540     /* And now set it back to ANSI */
541     r = SendMessage(updown, UDM_SETUNICODEFORMAT, 0 , 0);
542     expect(1,r);
543     r = SendMessage(updown, UDM_GETUNICODEFORMAT, 0 , 0);
544     expect(0,r);
545
546     ok_sequence(sequences, UPDOWN_SEQ_INDEX, test_updown_unicode_seq, "test updown unicode", FALSE);
547 }
548
549
550 static void test_create_updown_control(void)
551 {
552     CHAR text[MAX_PATH];
553
554     parent_wnd = create_parent_window();
555     ok(parent_wnd != NULL, "Failed to create parent window!\n");
556     ok_sequence(sequences, PARENT_SEQ_INDEX, create_parent_wnd_seq, "create parent window", TRUE);
557
558     flush_sequences(sequences, NUM_MSG_SEQUENCES);
559
560     edit = create_edit_control();
561     ok(edit != NULL, "Failed to create edit control\n");
562     ok_sequence(sequences, PARENT_SEQ_INDEX, add_edit_to_parent_seq, "add edit control to parent", FALSE);
563
564     flush_sequences(sequences, NUM_MSG_SEQUENCES);
565
566     updown = create_updown_control();
567     ok(updown != NULL, "Failed to create updown control\n");
568     ok_sequence(sequences, PARENT_SEQ_INDEX, add_updown_to_parent_seq, "add updown control to parent", TRUE);
569     ok_sequence(sequences, EDIT_SEQ_INDEX, add_updown_with_edit_seq, "add updown control with edit", FALSE);
570
571     flush_sequences(sequences, NUM_MSG_SEQUENCES);
572
573     GetWindowTextA(edit, text, MAX_PATH);
574     ok(lstrlenA(text) == 0, "Expected empty string\n");
575     ok_sequence(sequences, EDIT_SEQ_INDEX, get_edit_text_seq, "get edit text", FALSE);
576
577     flush_sequences(sequences, NUM_MSG_SEQUENCES);
578
579     test_updown_pos();
580     test_updown_pos32();
581     test_updown_buddy();
582     test_updown_base();
583     test_updown_unicode();
584 }
585
586 START_TEST(updown)
587 {
588     InitCommonControls();
589     init_msg_sequences(sequences, NUM_MSG_SEQUENCES);
590
591     test_create_updown_control();
592 }