Paul Vriens : kernel32/tests: Don' t run tests on win9x if we are out of memory.
Alexandre Julliard
julliard at winehq.org
Fri May 2 07:06:34 CDT 2008
Module: wine
Branch: master
Commit: 0a4eebd744f23240a89297e7f0f59e43e38ce99e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0a4eebd744f23240a89297e7f0f59e43e38ce99e
Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date: Fri May 2 12:05:02 2008 +0200
kernel32/tests: Don't run tests on win9x if we are out of memory.
---
dlls/kernel32/tests/console.c | 32 +++++++++++++++++++++-----------
1 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index bccb02f..2885aaa 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -380,6 +380,7 @@ static void testScroll(HANDLE hCon, COORD sbSize)
SMALL_RECT scroll, clip;
COORD dst, c, tc;
CHAR_INFO ci;
+ BOOL ret;
#define W 11
#define H 7
@@ -473,23 +474,32 @@ static void testScroll(HANDLE hCon, COORD sbSize)
clip.Top = H / 2;
clip.Bottom = min(H + H / 2, sbSize.Y - 1);
- ok(ScrollConsoleScreenBuffer(hCon, &scroll, &clip, dst, &ci), "Scrolling SB\n");
-
- for (c.Y = 0; c.Y < sbSize.Y; c.Y++)
+ SetLastError(0xdeadbeef);
+ ret = ScrollConsoleScreenBuffer(hCon, &scroll, &clip, dst, &ci);
+ if (ret)
{
- for (c.X = 0; c.X < sbSize.X; c.X++)
+ for (c.Y = 0; c.Y < sbSize.Y; c.Y++)
{
- if (IN_SRECT2(scroll, dst, c) && IN_SRECT(clip, c))
+ for (c.X = 0; c.X < sbSize.X; c.X++)
{
- tc.X = c.X - dst.X;
- tc.Y = c.Y - dst.Y;
- okCHAR(hCon, c, CONTENT(tc), DEFAULT_ATTRIB);
+ if (IN_SRECT2(scroll, dst, c) && IN_SRECT(clip, c))
+ {
+ tc.X = c.X - dst.X;
+ tc.Y = c.Y - dst.Y;
+ okCHAR(hCon, c, CONTENT(tc), DEFAULT_ATTRIB);
+ }
+ else if (IN_SRECT(scroll, c) && IN_SRECT(clip, c))
+ okCHAR(hCon, c, '#', TEST_ATTRIB);
+ else okCHAR(hCon, c, CONTENT(c), DEFAULT_ATTRIB);
}
- else if (IN_SRECT(scroll, c) && IN_SRECT(clip, c))
- okCHAR(hCon, c, '#', TEST_ATTRIB);
- else okCHAR(hCon, c, CONTENT(c), DEFAULT_ATTRIB);
}
}
+ else
+ {
+ /* Win9x will fail, Only accept ERROR_NOT_ENOUGH_MEMORY */
+ ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY,
+ "Expected ERROR_NOT_ENOUGH_MEMORY, got %u\n", GetLastError());
+ }
/* clipping, src & dst rect do overlap */
resetContent(hCon, sbSize, TRUE);
More information about the wine-cvs
mailing list