Module: wine
Branch: master
Commit: 10b2d6db04200dc2986e9698ebab465d509dd1f7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=10b2d6db04200dc2986e9698e…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com>
Date: Mon Jan 5 13:11:26 2009 +0100
shdocvw/tests: Fix test failures on XP SP2 and higher.
---
dlls/shdocvw/tests/shdocvw.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/shdocvw/tests/shdocvw.c b/dlls/shdocvw/tests/shdocvw.c
index 963b9a8..8e7b1f3 100644
--- a/dlls/shdocvw/tests/shdocvw.c
+++ b/dlls/shdocvw/tests/shdocvw.c
@@ -251,9 +251,10 @@ static void test_ParseURLFromOutsideSourceA(void)
len = maxlen-1;
dummy = 0;
res = pParseURLFromOutsideSourceA(ParseURL_table[i].url, buffer, &len, &dummy);
- ok( res == 0 && len == ParseURL_table[i].len + 1,
- "#%d (-1): got %d and %d (expected '0' and %d)\n",
- i, res, len, ParseURL_table[i].len + 1);
+ /* len includes the terminating 0 on XP SP1 and before, when the buffer is too small */
+ ok( res == 0 && (len == ParseURL_table[i].len || len == ParseURL_table[i].len + 1),
+ "#%d (-1): got %d and %d (expected '0' and %d or %d)\n",
+ i, res, len, ParseURL_table[i].len, ParseURL_table[i].len + 1);
memset(buffer, '#', sizeof(buffer)-1);
buffer[sizeof(buffer)-1] = '\0';
@@ -341,9 +342,10 @@ static void test_ParseURLFromOutsideSourceW(void)
len = maxlen - 1;
dummy = 0;
res = pParseURLFromOutsideSourceW(urlW, bufferW, &len, &dummy);
- ok( res == 0 && len == ParseURL_table[0].len + 1,
- "-1: got %d and %d (expected '0' and %d)\n",
- res, len, ParseURL_table[0].len + 1);
+ /* len includes the terminating 0 on XP SP1 and before, when the buffer is too small */
+ ok( res == 0 && (len == ParseURL_table[0].len || len == ParseURL_table[0].len + 1),
+ "-1: got %d and %d (expected '0' and %d or %d)\n",
+ res, len, ParseURL_table[0].len, ParseURL_table[0].len + 1);
}