Author: tfaber
Date: Fri Jun 21 17:22:46 2013
New Revision: 59274
URL:
http://svn.reactos.org/svn/reactos?rev=59274&view=rev
Log:
[APITESTS]
- Avoid warnings
Modified:
trunk/rostests/apitests/gdi32/GetObject.c
trunk/rostests/apitests/ntdll/NtAllocateVirtualMemory.c
trunk/rostests/apitests/user32/desktop.c
Modified: trunk/rostests/apitests/gdi32/GetObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetObject.…
==============================================================================
--- trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] Fri Jun 21 17:22:46 2013
@@ -433,6 +433,7 @@
EXTLOGPEN extlogpen;
DWORD dwStyles[50];
} elpUserStyle;
+ int i;
SetLastError(ERROR_SUCCESS);
ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0, "\n");
@@ -496,9 +497,8 @@
hPen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 5, &logbrush, 16, (CONST
DWORD*)&dwStyles);
ok(GetObject(hPen, 0, NULL) == sizeof(EXTLOGPEN) + 15*sizeof(DWORD), "\n");
ok(GetObject(hPen, sizeof(EXTLOGPEN) + 15*sizeof(DWORD), &elpUserStyle) ==
sizeof(EXTLOGPEN) + 15*sizeof(DWORD), "\n");
- ok(((EXTLOGPEN*)&elpUserStyle)->elpStyleEntry[0] == 0, "\n");
- ok(((EXTLOGPEN*)&elpUserStyle)->elpStyleEntry[1] == 1, "\n");
- ok(((EXTLOGPEN*)&elpUserStyle)->elpStyleEntry[15] == 15, "\n");
+ for (i = 0; i <= 15; i++)
+ ok(((EXTLOGPEN*)&elpUserStyle)->elpStyleEntry[i] == i, "%d\n", i);
DeleteObject(hPen);
}
Modified: trunk/rostests/apitests/ntdll/NtAllocateVirtualMemory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/NtAllocate…
==============================================================================
--- trunk/rostests/apitests/ntdll/NtAllocateVirtualMemory.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/ntdll/NtAllocateVirtualMemory.c [iso-8859-1] Fri Jun 21
17:22:46 2013
@@ -32,6 +32,8 @@
AllocationSize = ((PSIZE_T)UserBuffer)[-2];
DataSize = ((PSIZE_T)UserBuffer)[-1];
+ ASSERT(AllocationSize != 0);
+ ASSERT(AllocationSize % PAGE_SIZE == 0);
ASSERT(DataSize != 0);
ASSERT(((SIZE_T)UserBuffer + DataSize) % PAGE_SIZE == 0);
}
Modified: trunk/rostests/apitests/user32/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/desktop.c…
==============================================================================
--- trunk/rostests/apitests/user32/desktop.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/user32/desktop.c [iso-8859-1] Fri Jun 21 17:22:46 2013
@@ -32,8 +32,8 @@
void do_InitialDesktop_child(int i)
{
- HDESK hdesktop;
- HWINSTA hwinsta;
+ HDESK hdesktop;
+ HWINSTA hwinsta;
WCHAR buffer[100];
DWORD size;
BOOL ret;
@@ -47,12 +47,14 @@
IsGUIThread(TRUE);
hdesktop = GetThreadDesktop(GetCurrentThreadId());
- hwinsta = GetProcessWindowStation();
+ hwinsta = GetProcessWindowStation();
ret = GetUserObjectInformationW( hwinsta, UOI_NAME, buffer, sizeof(buffer), &size
);
+ ok(ret == TRUE, "ret = %d\n", ret);
ok(wcscmp(buffer, TestResults[i].ExpectedWinsta) == 0, "Wrong winsta %S insted
of %S\n", buffer, TestResults[i].ExpectedWinsta);
ret = GetUserObjectInformationW( hdesktop, UOI_NAME, buffer, sizeof(buffer),
&size );
+ ok(ret == TRUE, "ret = %d\n", ret);
ok(wcscmp(buffer, TestResults[i].ExpectedDesktp) == 0, "Wrong desktop %S insted
of %S\n", buffer, TestResults[i].ExpectedDesktp);
}
@@ -107,12 +109,11 @@
void Test_InitialDesktop(char *argv0)
{
HWINSTA hwinsta = NULL, hwinstaInitial;
- HDESK hdesktop = NULL, hdeskInitial;
+ HDESK hdesktop = NULL;
BOOL ret;
hwinstaInitial = GetProcessWindowStation();
- hdeskInitial = GetThreadDesktop(GetCurrentThreadId());
-
+
test_CreateProcessWithDesktop(0, argv0, NULL, 0);
test_CreateProcessWithDesktop(1, argv0, "Default", 0);
test_CreateProcessWithDesktop(2, argv0, "WinSta0\\Default", 0);
@@ -158,7 +159,7 @@
hDeskInput2 = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS);
ok(hDeskInput2 != NULL, "Second call to OpenInputDesktop failed\n");
- ok(hDeskInput2 != hDeskInput, "Second call to OpenInputDesktop returned same
handle\n");
+ ok(hDeskInput2 != hDeskInput, "Second call to OpenInputDesktop returned same
handle\n");
ok(CloseDesktop(hDeskInput2) != 0, "CloseDesktop failed\n");
@@ -176,10 +177,10 @@
hwinsta = CreateWindowStationW(L"TestWinsta", 0, WINSTA_ALL_ACCESS, NULL);
ok(hwinsta != 0, "CreateWindowStationW failed\n");
-
+
ret = SetProcessWindowStation(hwinsta);
ok(ret != 0, "SetProcessWindowStation failed\n");
-
+
hDeskInput = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS);
ok(hDeskInput == 0, "OpenInputDesktop should fail\n");
@@ -188,7 +189,7 @@
ret = SetProcessWindowStation(hwinstaInitial);
ok(ret != 0, "SetProcessWindowStation failed\n");
-
+
ret = CloseWindowStation(hwinsta);
ok(ret != 0, "CloseWindowStation failed\n");
@@ -211,7 +212,7 @@
do_InitialDesktop_child( arg );
return;
}
-
+
Test_InitialDesktop(test_argv[0]);
- Test_OpenInputDesktop();
-}
+ Test_OpenInputDesktop();
+}