Commit 2daf3c76 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

user32/tests: Enable compilation with long types.

parent c34f2381
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
...@@ -37,13 +38,13 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR ...@@ -37,13 +38,13 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
{ {
if (msg == WM_NULL) if (msg == WM_NULL)
{ {
trace("main_window_procA: Sleeping for %lu ms\n", wparam); trace("main_window_procA: Sleeping for %Iu ms\n", wparam);
if (wparam) if (wparam)
{ {
if (WaitForSingleObject(hevent, wparam) == WAIT_TIMEOUT) if (WaitForSingleObject(hevent, wparam) == WAIT_TIMEOUT)
SetEvent(hevent); SetEvent(hevent);
} }
trace("main_window_procA: Returning WM_NULL with parameter %08lx\n", lparam); trace("main_window_procA: Returning WM_NULL with parameter %08Ix\n", lparam);
return lparam; return lparam;
} }
...@@ -90,52 +91,52 @@ static void test_parameters(PBROADCAST broadcast, const char *functionname) ...@@ -90,52 +91,52 @@ static void test_parameters(PBROADCAST broadcast, const char *functionname)
win_skip("%s is not implemented\n", functionname); win_skip("%s is not implemented\n", functionname);
return; return;
} }
ok(!ret || broken(ret), "Returned: %d\n", ret); ok(!ret || broken(ret), "Returned: %ld\n", ret);
if (!ret) ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08x\n", GetLastError()); if (!ret) ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08lx\n", GetLastError());
SetLastError(0xcafebabe); SetLastError(0xcafebabe);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcast( 0x80000000, &recips, WM_NULL, 0, 0 ); ret = broadcast( 0x80000000, &recips, WM_NULL, 0, 0 );
ok(!ret || broken(ret), "Returned: %d\n", ret); ok(!ret || broken(ret), "Returned: %ld\n", ret);
if (!ret) ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08x\n", GetLastError()); if (!ret) ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08lx\n", GetLastError());
if (0) /* TODO: Check the hang flags */ if (0) /* TODO: Check the hang flags */
{ {
SetLastError(0xcafebabe); SetLastError(0xcafebabe);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcast( BSF_QUERY|(BSF_NOHANG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0 ); ret = broadcast( BSF_QUERY|(BSF_NOHANG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0 );
ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Last error: %08lx\n", GetLastError());
ok(0, "Returned: %d\n", ret); ok(0, "Returned: %ld\n", ret);
SetLastError(0xcafebabe); SetLastError(0xcafebabe);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcast( BSF_QUERY|(BSF_NOHANG|BSF_NOTIMEOUTIFNOTHUNG), &recips, WM_NULL, 30000, 0 ); ret = broadcast( BSF_QUERY|(BSF_NOHANG|BSF_NOTIMEOUTIFNOTHUNG), &recips, WM_NULL, 30000, 0 );
ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Last error: %08lx\n", GetLastError());
ok(0, "Returned: %d\n", ret); ok(0, "Returned: %ld\n", ret);
SetLastError(0xcafebabe); SetLastError(0xcafebabe);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcast( BSF_QUERY|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0 ); ret = broadcast( BSF_QUERY|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0 );
ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Last error: %08lx\n", GetLastError());
ok(0, "Returned: %d\n", ret); ok(0, "Returned: %ld\n", ret);
SetLastError(0xcafebabe); SetLastError(0xcafebabe);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcast( BSF_POSTMESSAGE|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0 ); ret = broadcast( BSF_POSTMESSAGE|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0 );
ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Last error: %08lx\n", GetLastError());
ok(0, "Returned: %d\n", ret); ok(0, "Returned: %ld\n", ret);
} }
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcast( BSF_POSTMESSAGE|BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, 0 ); ret = broadcast( BSF_POSTMESSAGE|BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, 0 );
ok(ret==1, "Returned: %d\n", ret); ok(ret==1, "Returned: %ld\n", ret);
ok(WaitForSingleObject(hevent, 0) != WAIT_OBJECT_0, "Synchronous message sent instead\n"); ok(WaitForSingleObject(hevent, 0) != WAIT_OBJECT_0, "Synchronous message sent instead\n");
PulseEvent(hevent); PulseEvent(hevent);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcast( BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY ); ret = broadcast( BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY );
ok(ret==1, "Returned: %d\n", ret); ok(ret==1, "Returned: %ld\n", ret);
ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n"); ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
PulseEvent(hevent); PulseEvent(hevent);
} }
...@@ -152,51 +153,51 @@ static void test_parametersEx(PBROADCASTEX broadcastex) ...@@ -152,51 +153,51 @@ static void test_parametersEx(PBROADCASTEX broadcastex)
SetLastError(0xcafebabe); SetLastError(0xcafebabe);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcastex( 0x80000000, &recips, WM_NULL, 0, 0, NULL ); ret = broadcastex( 0x80000000, &recips, WM_NULL, 0, 0, NULL );
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08x\n", GetLastError()); ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08lx\n", GetLastError());
ok(!ret, "Returned: %d\n", ret); ok(!ret, "Returned: %ld\n", ret);
SetLastError(0xcafebabe); SetLastError(0xcafebabe);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcastex( 0x80000000, &recips, WM_NULL, 0, 0, NULL ); ret = broadcastex( 0x80000000, &recips, WM_NULL, 0, 0, NULL );
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08x\n", GetLastError()); ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08lx\n", GetLastError());
ok(!ret, "Returned: %d\n", ret); ok(!ret, "Returned: %ld\n", ret);
if (0) /* TODO: Check the hang flags */ if (0) /* TODO: Check the hang flags */
{ {
SetLastError(0xcafebabe); SetLastError(0xcafebabe);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcastex( BSF_QUERY|(BSF_NOHANG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); ret = broadcastex( BSF_QUERY|(BSF_NOHANG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL );
ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Last error: %08lx\n", GetLastError());
ok(0, "Returned: %d\n", ret); ok(0, "Returned: %ld\n", ret);
SetLastError(0xcafebabe); SetLastError(0xcafebabe);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcastex( BSF_QUERY|(BSF_NOHANG|BSF_NOTIMEOUTIFNOTHUNG), &recips, WM_NULL, 30000, 0, NULL ); ret = broadcastex( BSF_QUERY|(BSF_NOHANG|BSF_NOTIMEOUTIFNOTHUNG), &recips, WM_NULL, 30000, 0, NULL );
ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Last error: %08lx\n", GetLastError());
ok(0, "Returned: %d\n", ret); ok(0, "Returned: %ld\n", ret);
SetLastError(0xcafebabe); SetLastError(0xcafebabe);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcastex( BSF_QUERY|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); ret = broadcastex( BSF_QUERY|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL );
ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Last error: %08lx\n", GetLastError());
ok(0, "Returned: %d\n", ret); ok(0, "Returned: %ld\n", ret);
SetLastError(0xcafebabe); SetLastError(0xcafebabe);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcastex( BSF_POSTMESSAGE|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); ret = broadcastex( BSF_POSTMESSAGE|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL );
ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Last error: %08lx\n", GetLastError());
ok(0, "Returned: %d\n", ret); ok(0, "Returned: %ld\n", ret);
} }
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcastex( BSF_POSTMESSAGE|BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, 0, NULL ); ret = broadcastex( BSF_POSTMESSAGE|BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, 0, NULL );
ok(ret==1, "Returned: %d\n", ret); ok(ret==1, "Returned: %ld\n", ret);
ok(WaitForSingleObject(hevent, 0) != WAIT_OBJECT_0, "Synchronous message sent instead\n"); ok(WaitForSingleObject(hevent, 0) != WAIT_OBJECT_0, "Synchronous message sent instead\n");
PulseEvent(hevent); PulseEvent(hevent);
recips = BSM_APPLICATIONS; recips = BSM_APPLICATIONS;
ret = broadcastex( BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY, NULL ); ret = broadcastex( BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY, NULL );
ok(ret==1, "Returned: %d\n", ret); ok(ret==1, "Returned: %ld\n", ret);
ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n"); ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
PulseEvent(hevent); PulseEvent(hevent);
} }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -513,10 +514,10 @@ static void test_begin_paint(void) ...@@ -513,10 +514,10 @@ static void test_begin_paint(void)
EndPaint( hwnd_parentdc, &ps ); EndPaint( hwnd_parentdc, &ps );
GetClientRect( hwnd_parent, &parent_rect ); GetClientRect( hwnd_parent, &parent_rect );
ok( rect.left == parent_rect.left, "rect.left = %d, expected %d\n", rect.left, parent_rect.left ); ok( rect.left == parent_rect.left, "rect.left = %ld, expected %ld\n", rect.left, parent_rect.left );
ok( rect.top == parent_rect.top, "rect.top = %d, expected %d\n", rect.top, parent_rect.top ); ok( rect.top == parent_rect.top, "rect.top = %ld, expected %ld\n", rect.top, parent_rect.top );
todo_wine ok( rect.right == parent_rect.right, "rect.right = %d, expected %d\n", rect.right, parent_rect.right ); todo_wine ok( rect.right == parent_rect.right, "rect.right = %ld, expected %ld\n", rect.right, parent_rect.right );
todo_wine ok( rect.bottom == parent_rect.bottom, "rect.bottom = %d, expected %d\n", rect.bottom, parent_rect.bottom ); todo_wine ok( rect.bottom == parent_rect.bottom, "rect.bottom = %ld, expected %ld\n", rect.bottom, parent_rect.bottom );
hdc = GetDC( hwnd_parent ); hdc = GetDC( hwnd_parent );
todo_wine ok( GetPixel( hdc, 10, 10 ) == cr, "error drawing outside of window client area\n" ); todo_wine ok( GetPixel( hdc, 10, 10 ) == cr, "error drawing outside of window client area\n" );
...@@ -617,41 +618,41 @@ static void test_dc_layout(void) ...@@ -617,41 +618,41 @@ static void test_dc_layout(void)
hdc = GetDC( hwnd_cache_rtl ); hdc = GetDC( hwnd_cache_rtl );
layout = GetLayout( hdc ); layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout ); ok( layout == LAYOUT_RTL, "wrong layout %lx\n", layout );
SetLayout( hdc, 0 ); SetLayout( hdc, 0 );
ReleaseDC( hwnd_cache_rtl, hdc ); ReleaseDC( hwnd_cache_rtl, hdc );
hdc = GetDC( hwnd_owndc_rtl ); hdc = GetDC( hwnd_owndc_rtl );
layout = GetLayout( hdc ); layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout ); ok( layout == LAYOUT_RTL, "wrong layout %lx\n", layout );
ReleaseDC( hwnd_cache_rtl, hdc ); ReleaseDC( hwnd_cache_rtl, hdc );
hdc = GetDC( hwnd_cache ); hdc = GetDC( hwnd_cache );
layout = GetLayout( hdc ); layout = GetLayout( hdc );
ok( layout == 0, "wrong layout %x\n", layout ); ok( layout == 0, "wrong layout %lx\n", layout );
ReleaseDC( hwnd_cache, hdc ); ReleaseDC( hwnd_cache, hdc );
hdc = GetDC( hwnd_owndc_rtl ); hdc = GetDC( hwnd_owndc_rtl );
layout = GetLayout( hdc ); layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout ); ok( layout == LAYOUT_RTL, "wrong layout %lx\n", layout );
SetLayout( hdc, 0 ); SetLayout( hdc, 0 );
ReleaseDC( hwnd_owndc_rtl, hdc ); ReleaseDC( hwnd_owndc_rtl, hdc );
hdc = GetDC( hwnd_owndc_rtl ); hdc = GetDC( hwnd_owndc_rtl );
layout = GetLayout( hdc ); layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout ); ok( layout == LAYOUT_RTL, "wrong layout %lx\n", layout );
ReleaseDC( hwnd_owndc_rtl, hdc ); ReleaseDC( hwnd_owndc_rtl, hdc );
hdc = GetDC( hwnd_classdc_rtl ); hdc = GetDC( hwnd_classdc_rtl );
layout = GetLayout( hdc ); layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout ); ok( layout == LAYOUT_RTL, "wrong layout %lx\n", layout );
SetLayout( hdc, 0 ); SetLayout( hdc, 0 );
ReleaseDC( hwnd_classdc_rtl, hdc ); ReleaseDC( hwnd_classdc_rtl, hdc );
hdc = GetDC( hwnd_classdc2_rtl ); hdc = GetDC( hwnd_classdc2_rtl );
layout = GetLayout( hdc ); layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout ); ok( layout == LAYOUT_RTL, "wrong layout %lx\n", layout );
ReleaseDC( hwnd_classdc2_rtl, hdc ); ReleaseDC( hwnd_classdc2_rtl, hdc );
hdc = GetDC( hwnd_classdc ); hdc = GetDC( hwnd_classdc );
layout = GetLayout( hdc ); layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout ); ok( layout == LAYOUT_RTL, "wrong layout %lx\n", layout );
ReleaseDC( hwnd_classdc_rtl, hdc ); ReleaseDC( hwnd_classdc_rtl, hdc );
DestroyWindow(hwnd_classdc2_rtl); DestroyWindow(hwnd_classdc2_rtl);
......
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