All pastes #1480556 Raw Edit

Another go at testing for bug 10

public text v1 · immutable
#1480556 ·published 2009-07-01 09:48 UTC
rendered paste body
From 0b58b51458567388bbcdb4d9308b748f707b7439 Mon Sep 17 00:00:00 2001
From: Austin Lund <austin.lund@gmail.com>
Date: Wed, 1 Jul 2009 19:24:45 +1000
Subject: [PATCH] user32/tests: Test for processing multiple WM_NCPAINT messages

---
 dlls/user32/tests/win.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index d45eba3..5c8e518 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -4859,6 +4859,30 @@ static void test_Expose(void)
     DestroyWindow(mw);
 }
 
+static void test_MultiplePaint(void)
+{
+    ATOM atom;
+    WNDCLASSA cls;
+    HWND hwnd;
+    MSG getmsg;
+
+    memset(&cls, 0, sizeof(WNDCLASSA));
+    cls.lpszClassName = "TestMultiplePaint";
+    atom = RegisterClassA(&cls);
+
+    hwnd = CreateWindowA("TestMultiplePaint", "MainWindow", WS_VISIBLE|WS_OVERLAPPEDWINDOW,
+                            0, 0, 200, 100, NULL, NULL, 0, NULL);
+
+    PostMessage(hwnd,WM_NCPAINT,0,0);
+    PostMessage(hwnd,WM_NCPAINT,0,0);
+    DefWindowProc(hwnd,WM_NCPAINT,0,0);
+    todo_wine ok(PeekMessage(&getmsg, hwnd, WM_NCPAINT, WM_NCPAINT, PM_NOREMOVE)==0,
+		 "Not all WM_NCPAINT messages were processed\n");
+
+    UpdateWindow(hwnd);
+    DestroyWindow(hwnd);
+}
+
 static void test_GetWindowModuleFileName(void)
 {
     HWND hwnd;
@@ -5669,6 +5693,7 @@ START_TEST(win)
     if (0) test_gettext(); /* crashes on NT4 */
     test_GetUpdateRect();
     test_Expose();
+    test_MultiplePaint();
     test_layered_window();
 
     test_SetForegroundWindow(hwndMain);
-- 
1.6.0.4