Alexandre Julliard : ntdll/tests: Clear the full atom structure before every test.

Alexandre Julliard julliard at winehq.org
Thu Oct 20 14:25:10 CDT 2011


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Oct 20 12:36:02 2011 +0200

ntdll/tests: Clear the full atom structure before every test.

---

 dlls/ntdll/tests/atom.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/ntdll/tests/atom.c b/dlls/ntdll/tests/atom.c
index 0f18565..0fed630 100644
--- a/dlls/ntdll/tests/atom.c
+++ b/dlls/ntdll/tests/atom.c
@@ -443,7 +443,7 @@ static void test_Global(void)
 
     ok(!res, "Added atom (%x)\n", res);
 
-    memset(abi->Name, 0xcc, 255 * sizeof(WCHAR));
+    memset( ptr, 0xcc, sizeof(ptr) );
     res = pNtQueryInformationAtom( atom, AtomBasicInformation, (void*)ptr, ptr_size, NULL );
     ok(!res, "atom lookup\n");
     ok(!lstrcmpW(abi->Name, testAtom1), "ok strings\n");
@@ -457,7 +457,7 @@ static void test_Global(void)
     ok(abi->NameLength == lstrlenW(testAtom1) * sizeof(WCHAR) || broken(abi->NameLength == sizeof(WCHAR)), /* nt4 */
        "string length %u\n",abi->NameLength);
 
-    memset(abi->Name, 0xcc, lstrlenW(testAtom1) * sizeof(WCHAR));
+    memset( ptr, 0xcc, sizeof(ptr) );
     ptr_size = sizeof(ATOM_BASIC_INFORMATION) + lstrlenW(testAtom1) * sizeof(WCHAR);
     res = pNtQueryInformationAtom( atom, AtomBasicInformation, (void*)ptr, ptr_size, NULL );
     ok(!res, "atom lookup %x\n", res);
@@ -466,8 +466,8 @@ static void test_Global(void)
     ok(abi->Name[lstrlenW(testAtom1)] == 0, "buffer overwrite %x\n", abi->Name[lstrlenW(testAtom1)]);
     ok(abi->Name[lstrlenW(testAtom1) + 1] == 0xcccc, "buffer overwrite %x\n", abi->Name[lstrlenW(testAtom1) + 1]);
 
+    memset( ptr, 0xcc, sizeof(ptr) );
     ptr_size = sizeof(ATOM_BASIC_INFORMATION) + 4 * sizeof(WCHAR);
-    abi->Name[0] = abi->Name[1] = abi->Name[2] = abi->Name[3] = '\0';
     res = pNtQueryInformationAtom( atom, AtomBasicInformation, (void*)ptr, ptr_size, NULL );
     ok(!res, "couldn't find atom\n");
     ok(abi->NameLength == 8, "wrong string length %u\n", abi->NameLength);




More information about the wine-cvs mailing list