From 10b2d6db04200dc2986e9698ebab465d509dd1f7 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Mon, 5 Jan 2009 13:11:26 +0100 Subject: [PATCH] shdocvw/tests: Fix test failures on XP SP2 and higher. --- dlls/shdocvw/tests/shdocvw.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/shdocvw/tests/shdocvw.c b/dlls/shdocvw/tests/shdocvw.c index 963b9a855fe..8e7b1f3d213 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); }