Commit 0e37ca14 authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

user32/tests: Use BOOL type where appropriate.

parent 4f6bd491
...@@ -144,7 +144,7 @@ static int MOD_avec, MOD_hic; ...@@ -144,7 +144,7 @@ static int MOD_avec, MOD_hic;
static int MOD_odheight; static int MOD_odheight;
static SIZE MODsizes[MOD_NRMENUS]= { {MOD_SIZE, MOD_SIZE},{MOD_SIZE, MOD_SIZE}, static SIZE MODsizes[MOD_NRMENUS]= { {MOD_SIZE, MOD_SIZE},{MOD_SIZE, MOD_SIZE},
{MOD_SIZE, MOD_SIZE},{MOD_SIZE, MOD_SIZE}}; {MOD_SIZE, MOD_SIZE},{MOD_SIZE, MOD_SIZE}};
static int MOD_GotDrawItemMsg = FALSE; static BOOL MOD_GotDrawItemMsg = FALSE;
static int gflag_initmenupopup, static int gflag_initmenupopup,
gflag_entermenuloop, gflag_entermenuloop,
gflag_initmenu; gflag_initmenu;
...@@ -652,7 +652,7 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt, ...@@ -652,7 +652,7 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
RECT rc; RECT rc;
CHAR text_copy[16]; CHAR text_copy[16];
int hastab, expect; int hastab, expect;
int failed = 0; BOOL failed = FALSE;
MOD_GotDrawItemMsg = FALSE; MOD_GotDrawItemMsg = FALSE;
mii.fMask = MIIM_FTYPE | MIIM_DATA | MIIM_STATE; mii.fMask = MIIM_FTYPE | MIIM_DATA | MIIM_STATE;
...@@ -1203,7 +1203,7 @@ static void set_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, UIN ...@@ -1203,7 +1203,7 @@ static void set_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, UIN
static void test_menu_iteminfo( void ) static void test_menu_iteminfo( void )
{ {
int ansi = TRUE; BOOL ansi = TRUE;
char txtA[]="wine"; char txtA[]="wine";
char initA[]="XYZ"; char initA[]="XYZ";
char emptyA[]=""; char emptyA[]="";
...@@ -2110,7 +2110,8 @@ static DWORD WINAPI test_menu_input_thread(LPVOID lpParameter) ...@@ -2110,7 +2110,8 @@ static DWORD WINAPI test_menu_input_thread(LPVOID lpParameter)
/* mixed keyboard/mouse test */ /* mixed keyboard/mouse test */
for (i = 0; menu_tests[i].type != -1; i++) for (i = 0; menu_tests[i].type != -1; i++)
{ {
int ret = TRUE, elapsed = 0; BOOL ret = TRUE;
int elapsed = 0;
got_input = i && menu_tests[i-1].bMenuVisible; got_input = i && menu_tests[i-1].bMenuVisible;
......
...@@ -1719,11 +1719,10 @@ static const struct message WmSHOWNATopInvisible[] = { ...@@ -1719,11 +1719,10 @@ static const struct message WmSHOWNATopInvisible[] = {
{ 0 } { 0 }
}; };
static int after_end_dialog, test_def_id; static BOOL after_end_dialog, test_def_id, paint_loop_done;
static int sequence_cnt, sequence_size; static int sequence_cnt, sequence_size;
static struct recvd_message* sequence; static struct recvd_message* sequence;
static int log_all_parent_messages; static int log_all_parent_messages;
static int paint_loop_done;
/* user32 functions */ /* user32 functions */
static HWND (WINAPI *pGetAncestor)(HWND,UINT); static HWND (WINAPI *pGetAncestor)(HWND,UINT);
...@@ -2030,7 +2029,7 @@ static void dump_sequence(const struct message *expected, const char *context, c ...@@ -2030,7 +2029,7 @@ static void dump_sequence(const struct message *expected, const char *context, c
ok_sequence_( (exp), (contx), (todo), __FILE__, __LINE__) ok_sequence_( (exp), (contx), (todo), __FILE__, __LINE__)
static void ok_sequence_(const struct message *expected_list, const char *context, int todo, static void ok_sequence_(const struct message *expected_list, const char *context, BOOL todo,
const char *file, int line) const char *file, int line)
{ {
static const struct recvd_message end_of_sequence; static const struct recvd_message end_of_sequence;
...@@ -4762,17 +4761,17 @@ static void test_messages(void) ...@@ -4762,17 +4761,17 @@ static void test_messages(void)
flush_sequence(); flush_sequence();
test_def_id = 1; test_def_id = TRUE;
SendMessageA(hwnd, WM_NULL, 0, 0); SendMessageA(hwnd, WM_NULL, 0, 0);
flush_sequence(); flush_sequence();
after_end_dialog = 1; after_end_dialog = TRUE;
EndDialog( hwnd, 0 ); EndDialog( hwnd, 0 );
ok_sequence(WmEndCustomDialogSeq, "EndCustomDialog", FALSE); ok_sequence(WmEndCustomDialogSeq, "EndCustomDialog", FALSE);
DestroyWindow(hwnd); DestroyWindow(hwnd);
after_end_dialog = 0; after_end_dialog = FALSE;
test_def_id = 0; test_def_id = FALSE;
hwnd = CreateWindowExA(0, "TestDialogClass", NULL, WS_POPUP, hwnd = CreateWindowExA(0, "TestDialogClass", NULL, WS_POPUP,
0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL); 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL);
...@@ -7886,7 +7885,7 @@ static LRESULT WINAPI PaintLoopProcA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM ...@@ -7886,7 +7885,7 @@ static LRESULT WINAPI PaintLoopProcA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
} }
else ok(broken(1), "infinite loop\n"); else ok(broken(1), "infinite loop\n");
if ( i == 0) if ( i == 0)
paint_loop_done = 1; paint_loop_done = TRUE;
return DefWindowProcA(hWnd,msg,wParam,lParam); return DefWindowProcA(hWnd,msg,wParam,lParam);
} }
} }
...@@ -9040,22 +9039,22 @@ static void test_scrollwindowex(void) ...@@ -9040,22 +9039,22 @@ static void test_scrollwindowex(void)
trace("start scroll\n"); trace("start scroll\n");
ScrollWindowEx( hwnd, 10, 10, &rect, NULL, NULL, NULL, ScrollWindowEx( hwnd, 10, 10, &rect, NULL, NULL, NULL,
SW_ERASE|SW_INVALIDATE); SW_ERASE|SW_INVALIDATE);
ok_sequence(WmEmptySeq, "ScrollWindowEx", 0); ok_sequence(WmEmptySeq, "ScrollWindowEx", FALSE);
trace("end scroll\n"); trace("end scroll\n");
flush_sequence(); flush_sequence();
flush_events(); flush_events();
ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", 0); ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", FALSE);
flush_events(); flush_events();
flush_sequence(); flush_sequence();
/* Now without the SW_ERASE flag */ /* Now without the SW_ERASE flag */
trace("start scroll\n"); trace("start scroll\n");
ScrollWindowEx( hwnd, 10, 10, &rect, NULL, NULL, NULL, SW_INVALIDATE); ScrollWindowEx( hwnd, 10, 10, &rect, NULL, NULL, NULL, SW_INVALIDATE);
ok_sequence(WmEmptySeq, "ScrollWindowEx", 0); ok_sequence(WmEmptySeq, "ScrollWindowEx", FALSE);
trace("end scroll\n"); trace("end scroll\n");
flush_sequence(); flush_sequence();
flush_events(); flush_events();
ok_sequence(ScrollWindowPaint2, "ScrollWindowEx", 0); ok_sequence(ScrollWindowPaint2, "ScrollWindowEx", FALSE);
flush_events(); flush_events();
flush_sequence(); flush_sequence();
...@@ -9069,7 +9068,7 @@ static void test_scrollwindowex(void) ...@@ -9069,7 +9068,7 @@ static void test_scrollwindowex(void)
trace("end scroll\n"); trace("end scroll\n");
flush_sequence(); flush_sequence();
flush_events(); flush_events();
ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", 0); ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", FALSE);
flush_events(); flush_events();
flush_sequence(); flush_sequence();
...@@ -9079,7 +9078,7 @@ static void test_scrollwindowex(void) ...@@ -9079,7 +9078,7 @@ static void test_scrollwindowex(void)
trace("end scroll\n"); trace("end scroll\n");
flush_sequence(); flush_sequence();
flush_events(); flush_events();
ok_sequence(ScrollWindowPaint1, "ScrollWindow", 0); ok_sequence(ScrollWindowPaint1, "ScrollWindow", FALSE);
ok(DestroyWindow(hchild), "failed to destroy window\n"); ok(DestroyWindow(hchild), "failed to destroy window\n");
ok(DestroyWindow(hwnd), "failed to destroy window\n"); ok(DestroyWindow(hwnd), "failed to destroy window\n");
...@@ -9212,7 +9211,7 @@ static void test_DestroyWindow(void) ...@@ -9212,7 +9211,7 @@ static void test_DestroyWindow(void)
ret = DestroyWindow(parent); ret = DestroyWindow(parent);
ok( ret, "DestroyWindow() error %d\n", GetLastError()); ok( ret, "DestroyWindow() error %d\n", GetLastError());
test_DestroyWindow_flag = FALSE; test_DestroyWindow_flag = FALSE;
ok_sequence(destroy_window_with_children, "destroy window with children", 0); ok_sequence(destroy_window_with_children, "destroy window with children", FALSE);
ok(!IsWindow(parent), "parent still exists\n"); ok(!IsWindow(parent), "parent still exists\n");
ok(!IsWindow(child1), "child1 still exists\n"); ok(!IsWindow(child1), "child1 still exists\n");
...@@ -10229,8 +10228,7 @@ static void wait_move_event(HWND hwnd, int x, int y) ...@@ -10229,8 +10228,7 @@ static void wait_move_event(HWND hwnd, int x, int y)
{ {
MSG msg; MSG msg;
DWORD time; DWORD time;
BOOL ret; BOOL ret, go = FALSE;
int go = 0;
time = GetTickCount(); time = GetTickCount();
while (GetTickCount() - time < 200 && !go) { while (GetTickCount() - time < 200 && !go) {
...@@ -12708,7 +12706,7 @@ static void test_paintingloop(void) ...@@ -12708,7 +12706,7 @@ static void test_paintingloop(void)
{ {
HWND hwnd; HWND hwnd;
paint_loop_done = 0; paint_loop_done = FALSE;
hwnd = CreateWindowExA(0x0,"PaintLoopWindowClass", hwnd = CreateWindowExA(0x0,"PaintLoopWindowClass",
"PaintLoopWindowClass",WS_OVERLAPPEDWINDOW, "PaintLoopWindowClass",WS_OVERLAPPEDWINDOW,
100, 100, 100, 100, 0, 0, 0, NULL ); 100, 100, 100, 100, 0, 0, 0, NULL );
...@@ -12732,7 +12730,7 @@ static void test_defwinproc(void) ...@@ -12732,7 +12730,7 @@ static void test_defwinproc(void)
{ {
HWND hwnd; HWND hwnd;
MSG msg; MSG msg;
int gotwmquit = FALSE; BOOL gotwmquit = FALSE;
hwnd = CreateWindowExA(0, "static", "test_defwndproc", WS_POPUP, 0,0,0,0,0,0,0, NULL); hwnd = CreateWindowExA(0, "static", "test_defwndproc", WS_POPUP, 0,0,0,0,0,0,0, NULL);
assert(hwnd); assert(hwnd);
DefWindowProcA( hwnd, WM_ENDSESSION, 1, 0); DefWindowProcA( hwnd, WM_ENDSESSION, 1, 0);
...@@ -12740,7 +12738,7 @@ static void test_defwinproc(void) ...@@ -12740,7 +12738,7 @@ static void test_defwinproc(void)
if( msg.message == WM_QUIT) gotwmquit = TRUE; if( msg.message == WM_QUIT) gotwmquit = TRUE;
DispatchMessageA( &msg ); DispatchMessageA( &msg );
} }
ok( gotwmquit == FALSE, "Unexpected WM_QUIT message!\n"); ok(!gotwmquit, "Unexpected WM_QUIT message!\n");
DestroyWindow( hwnd); DestroyWindow( hwnd);
} }
......
...@@ -113,16 +113,16 @@ static void wsprintfWTest(void) ...@@ -113,16 +113,16 @@ static void wsprintfWTest(void)
static void CharUpperTest(void) static void CharUpperTest(void)
{ {
INT_PTR i,out,failed; INT_PTR i, out;
BOOL failed = FALSE;
failed = 0;
for (i=0;i<256;i++) for (i=0;i<256;i++)
{ {
out = (INT_PTR)CharUpperA((LPSTR)i); out = (INT_PTR)CharUpperA((LPSTR)i);
/* printf("%0x ",out); */ /* printf("%0x ",out); */
if ((out >> 16) != 0) if ((out >> 16) != 0)
{ {
failed = 1; failed = TRUE;
break; break;
} }
} }
...@@ -131,16 +131,16 @@ static void CharUpperTest(void) ...@@ -131,16 +131,16 @@ static void CharUpperTest(void)
static void CharLowerTest(void) static void CharLowerTest(void)
{ {
INT_PTR i,out,failed; INT_PTR i, out;
BOOL failed = FALSE;
failed = 0;
for (i=0;i<256;i++) for (i=0;i<256;i++)
{ {
out = (INT_PTR)CharLowerA((LPSTR)i); out = (INT_PTR)CharLowerA((LPSTR)i);
/* printf("%0x ",out); */ /* printf("%0x ",out); */
if ((out >> 16) != 0) if ((out >> 16) != 0)
{ {
failed = 1; failed = TRUE;
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment