Paul Vriens : kernel32/tests: Fill the buffer to show a bug in Wine.

Alexandre Julliard julliard at winehq.org
Wed Jan 28 08:03:11 CST 2009


Module: wine
Branch: master
Commit: dda0fe451d66b396226014b53f6cb837c37cadd4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=dda0fe451d66b396226014b53f6cb837c37cadd4

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Wed Jan 28 09:00:26 2009 +0100

kernel32/tests: Fill the buffer to show a bug in Wine.

---

 dlls/kernel32/tests/profile.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c
index b07bfc8..e07ece3 100644
--- a/dlls/kernel32/tests/profile.c
+++ b/dlls/kernel32/tests/profile.c
@@ -215,22 +215,27 @@ static void test_profile_sections_names(void)
     CloseHandle( h);
 
     /* Test with sufficiently large buffer */
+    memset(buf, 0xc, sizeof(buf));
     ret = GetPrivateProfileSectionNamesA( buf, 29, testfile3 );
     ok( ret == 27, "expected return size 27, got %d\n", ret );
     ok( buf[ret-1] == 0 && buf[ret] == 0, "returned buffer not terminated with double-null\n" );
     
     /* Test with exactly fitting buffer */
+    memset(buf, 0xc, sizeof(buf));
     ret = GetPrivateProfileSectionNamesA( buf, 28, testfile3 );
     ok( ret == 26, "expected return size 26, got %d\n", ret );
+    todo_wine
     ok( buf[ret+1] == 0 && buf[ret] == 0, "returned buffer not terminated with double-null\n" );
     
     /* Test with a buffer too small */
+    memset(buf, 0xc, sizeof(buf));
     ret = GetPrivateProfileSectionNamesA( buf, 27, testfile3 );
     ok( ret == 25, "expected return size 25, got %d\n", ret );
+    todo_wine
     ok( buf[ret+1] == 0 && buf[ret] == 0, "returned buffer not terminated with double-null\n" );
     
     /* Tests on nonexistent file */
-    memset(buf, 0xcc, sizeof(buf));
+    memset(buf, 0xc, sizeof(buf));
     ret = GetPrivateProfileSectionNamesA( buf, 10, ".\\not_here.ini" );
     ok( ret == 0, "expected return size 0, got %d\n", ret );
     ok( buf[0] == 0, "returned buffer not terminated with null\n" );
@@ -238,6 +243,7 @@ static void test_profile_sections_names(void)
     
     /* Test with sufficiently large buffer */
     SetLastError(0xdeadbeef);
+    memset(bufW, 0xcc, sizeof(bufW));
     ret = GetPrivateProfileSectionNamesW( bufW, 29, testfile3W );
     if (ret == 0 && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
     {
@@ -249,11 +255,13 @@ static void test_profile_sections_names(void)
     ok( bufW[ret-1] == 0 && bufW[ret] == 0, "returned buffer not terminated with double-null\n" );
     
     /* Test with exactly fitting buffer */
+    memset(bufW, 0xcc, sizeof(bufW));
     ret = GetPrivateProfileSectionNamesW( bufW, 28, testfile3W );
     ok( ret == 26, "expected return size 26, got %d\n", ret );
     ok( bufW[ret+1] == 0 && bufW[ret] == 0, "returned buffer not terminated with double-null\n" );
     
     /* Test with a buffer too small */
+    memset(bufW, 0xcc, sizeof(bufW));
     ret = GetPrivateProfileSectionNamesW( bufW, 27, testfile3W );
     ok( ret == 25, "expected return size 25, got %d\n", ret );
     ok( bufW[ret+1] == 0 && bufW[ret] == 0, "returned buffer not terminated with double-null\n" );




More information about the wine-cvs mailing list