[APITESTS]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 22 Sep 2013 19:07:35 +0000 (19:07 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 22 Sep 2013 19:07:35 +0000 (19:07 +0000)
- No need now to declare a NTSTATUS ExceptionStatus; variable to be able to use StartSeh() / EndSeh() macros; this is done automagically.
- Use explicitely unicode macros where it's needed.

svn path=/trunk/; revision=60319

41 files changed:
rostests/apitests/advapi32/SaferIdentifyLevel.c
rostests/apitests/crt/_vsnprintf.c
rostests/apitests/crt/_vsnwprintf.c
rostests/apitests/crt/sprintf.c
rostests/apitests/gdi32/AddFontResourceEx.c
rostests/apitests/gdi32/CreateDIBitmap.c
rostests/apitests/gdi32/GetObject.c
rostests/apitests/gdi32/SelectObject.c
rostests/apitests/gdi32/SetBrushOrgEx.c
rostests/apitests/include/apitest.h
rostests/apitests/ntdll/LdrEnumResources.c
rostests/apitests/ntdll/NtAllocateVirtualMemory.c
rostests/apitests/ntdll/NtFreeVirtualMemory.c
rostests/apitests/ntdll/NtMapViewOfSection.c
rostests/apitests/ntdll/NtProtectVirtualMemory.c
rostests/apitests/ntdll/NtQuerySystemEnvironmentValue.c
rostests/apitests/ntdll/RtlBitmap.c
rostests/apitests/ntdll/RtlDetermineDosPathNameType.c
rostests/apitests/ntdll/RtlDoesFileExists.c
rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c
rostests/apitests/ntdll/RtlDosSearchPath_U.c
rostests/apitests/ntdll/RtlDosSearchPath_Ustr.c
rostests/apitests/ntdll/RtlGetFullPathName_U.c
rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c
rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c
rostests/apitests/ntdll/RtlGetLongestNtPathLength.c
rostests/apitests/ntdll/RtlInitializeBitMap.c
rostests/apitests/ntdll/SystemInfo.c
rostests/apitests/ntdll/Timer.c
rostests/apitests/ntdll/ZwContinue.c
rostests/apitests/ntdll/sprintf.c
rostests/apitests/ntdll/testlist.c
rostests/apitests/powrprof/CMakeLists.txt
rostests/apitests/powrprof/power.c
rostests/apitests/powrprof/testlist.c
rostests/apitests/ws2_32/WSAStartup.c
rostests/apitests/ws2_32/getaddrinfo.c
rostests/apitests/ws2_32/helpers.c
rostests/apitests/ws2_32/ioctlsocket.c
rostests/apitests/ws2_32/recv.c
rostests/apitests/ws2_32/testlist.c

index c6ed54f..0dc005f 100644 (file)
@@ -16,7 +16,6 @@
 
 START_TEST(SaferIdentifyLevel)
 {
-    NTSTATUS ExceptionStatus;
     BOOL ret;
     DWORD error;
     SAFER_LEVEL_HANDLE handle;
index 5b60758..02ef0b7 100644 (file)
@@ -26,7 +26,7 @@ static void call_varargs(char* buf, size_t buf_size, int expected_ret, LPCSTR fo
 START_TEST(_vsnprintf)
 {
     char buffer[255];
-    NTSTATUS ExceptionStatus;
+
     /* Here you can mix wide and ANSI strings */
     call_varargs(buffer, 255, 12, "%S world!", L"hello");
     call_varargs(buffer, 255, 12, "%s world!", "hello");
index 58fb97b..3f2bad9 100644 (file)
@@ -26,7 +26,7 @@ static void call_varargs(wchar_t* buf, size_t buf_size, int expected_ret, LPCWST
 START_TEST(_vsnwprintf)
 {
     wchar_t buffer[255];
-    NTSTATUS ExceptionStatus;
+
     /* Test basic functionality */
     call_varargs(buffer, 255, 19, L"%s world!", "hello");
     call_varargs(buffer, 255, 12, L"%s world!", L"hello");
index b0f2215..af723cd 100644 (file)
@@ -71,7 +71,6 @@ FreeGuarded(
  *       user32's wsprintf. Make sure to test them all */
 START_TEST(sprintf)
 {
-    NTSTATUS ExceptionStatus;
     int Length;
     CHAR Buffer[128];
     PCHAR String;
index 56d0344..0cae71a 100644 (file)
@@ -8,7 +8,6 @@
 #include <apitest.h>
 
 #include <wingdi.h>
-#include <libs/pseh/pseh2.h>
 
 void Test_AddFontResourceExW()
 {
index 3be66e8..e0aca1b 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <wingdi.h>
 #include <winuser.h>
-#include <pseh/pseh2.h>
 
 #include "init.h"
 
index 6ab39ee..bf999ab 100644 (file)
@@ -10,7 +10,6 @@
 #include <wingdi.h>
 #include <winddi.h>
 #include <winuser.h>
-#include <pseh/pseh2.h>
 #include <include/ntgdityp.h>
 #include <include/ntgdihdl.h>
 
index 077593b..0bae440 100644 (file)
@@ -11,7 +11,6 @@
 #include <wingdi.h>
 #include <winddi.h>
 #include <winuser.h>
-#include <pseh/pseh2.h>
 #include <include/ntgdityp.h>
 #include <include/ntgdihdl.h>
 
index fdc9f7e..74acb15 100644 (file)
@@ -8,7 +8,6 @@
 #include <apitest.h>
 
 #include <wingdi.h>
-#include <pseh/pseh2.h>
 
 void Test_Set(ULONG ulLine, HDC hdc, INT x, INT y, LPPOINT ppt, BOOL bExp, DWORD dwErrExp)
 {
index 85d241b..44badd5 100644 (file)
@@ -3,19 +3,23 @@
 
 // #define __ROS_LONG64__
 
-#define WIN32_NO_STATUS
-
 /* The user must #define STANDALONE if it uses this header in testlist.c */
+#define WIN32_NO_STATUS
 #include <wine/test.h>
+#undef WIN32_NO_STATUS
+
 #include <pseh/pseh2.h>
 
 /* See kmtests/include/kmt_test.h */
 #define InvalidPointer ((PVOID)0x5555555555555555ULL)
+// #define InvalidPointer ((PVOID)0x0123456789ABCDEFULL)
 
 #define StartSeh()                                  \
-    ExceptionStatus = STATUS_SUCCESS;               \
+{                                                   \
+    NTSTATUS ExceptionStatus = STATUS_SUCCESS;      \
     _SEH2_TRY                                       \
     {
+
 #define EndSeh(ExpectedStatus)                      \
     }                                               \
     _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)         \
@@ -23,6 +27,9 @@
         ExceptionStatus = _SEH2_GetExceptionCode(); \
     }                                               \
     _SEH2_END;                                      \
-    ok(ExceptionStatus == ExpectedStatus, "Exception 0x%08lx, expected 0x%08lx\n", ExceptionStatus, ExpectedStatus)
+    ok(ExceptionStatus == ExpectedStatus,           \
+       "Exception 0x%08lx, expected 0x%08lx\n",     \
+       ExceptionStatus, ExpectedStatus);            \
+}
 
 #endif /* _APITEST_H */
index f9bf3b7..84478c2 100644 (file)
@@ -5,10 +5,9 @@
  * PROGRAMMER:      Timo Kreuzer
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#define UNICODE
-#include <wine/test.h>
-#include <pseh/pseh2.h>
 #include <ndk/ldrfuncs.h>
 
 typedef struct _TEST_RESOURCES
index 5f184eb..d7cb77d 100644 (file)
@@ -5,11 +5,11 @@
  * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#include <wine/test.h>
 #include <ndk/rtlfuncs.h>
 #include <ndk/mmfuncs.h>
-#include <pseh/pseh2.h>
 
 static PVOID Allocations[4096] = { NULL };
 static ULONG CurrentAllocation = 0;
index d534221..d5cf23b 100644 (file)
@@ -1,5 +1,7 @@
+
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#include <wine/test.h>
 #include <ndk/pstypes.h>
 #include <ndk/mmfuncs.h>
 
index dbf8909..f347fa9 100644 (file)
@@ -1,8 +1,8 @@
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#include <wine/test.h>
 #include <ndk/ntndk.h>
-#include <pseh/pseh2.h>
 
 NTSYSAPI
 NTSTATUS
index b32c66c..080783a 100644 (file)
@@ -4,14 +4,11 @@
  * PURPOSE:         Test for the NtProtectVirtualMemory API
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#include <wine/test.h>
 #include <ndk/rtlfuncs.h>
 #include <ndk/mmfuncs.h>
-#include <pseh/pseh2.h>
-
-#define StartSeh              status = STATUS_SUCCESS; _SEH2_TRY
-#define EndSeh(ExpectedStatus)  _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { status = _SEH2_GetExceptionCode(); } _SEH2_END; ok(status == ExpectedStatus, "Exception %lx, expected %lx\n", status, ExpectedStatus)
 
 START_TEST(NtProtectVirtualMemory)
 {
@@ -40,13 +37,13 @@ START_TEST(NtProtectVirtualMemory)
     ok(NT_SUCCESS(status), "Commiting memory failed\n");
     
     /* Try writing it */
-    StartSeh
+    StartSeh()
     {
         *allocationStart = 0xFF;
     } EndSeh(STATUS_SUCCESS);
     
     /* Try reading it */
-    StartSeh
+    StartSeh()
     {
         ok(*allocationStart == 0xFF, "Memory was not written\n");
     } EndSeh(STATUS_SUCCESS);
@@ -61,13 +58,13 @@ START_TEST(NtProtectVirtualMemory)
     ok(oldProtection == PAGE_READWRITE, "Expected PAGE_READWRITE, got %08x.\n", oldProtection);
     
     /* Try writing it */
-    StartSeh
+    StartSeh()
     {
         *allocationStart = 0xAA;
     } EndSeh(STATUS_ACCESS_VIOLATION);
     
     /* Try reading it */
-    StartSeh
+    StartSeh()
     {
         ok(*allocationStart == 0xFF, "read-only memory were changed.\n");
     } EndSeh(STATUS_SUCCESS);
@@ -82,13 +79,13 @@ START_TEST(NtProtectVirtualMemory)
     ok(oldProtection == PAGE_READONLY, "Expected PAGE_READONLY, got %08x.\n", oldProtection);
     
     /* Try writing it */
-    StartSeh
+    StartSeh()
     {
         *allocationStart = 0xAA;
     } EndSeh(STATUS_ACCESS_VIOLATION);
     
     /* Try reading it */
-    StartSeh
+    StartSeh()
     {
         ok(*allocationStart == 0, "Test should not go as far as this.\n");
     } EndSeh(STATUS_ACCESS_VIOLATION);
index 7c41038..a554a3e 100644 (file)
@@ -5,8 +5,9 @@
  * PROGRAMMER:      Hermès BÉLUSCA - MAÏTO <hermes.belusca@sfr.fr>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#include <wine/test.h>
 #include <ndk/setypes.h>
 #include <ndk/rtlfuncs.h>
 #include <ndk/exfuncs.h>
index dfaff4f..a3b221e 100644 (file)
@@ -1,8 +1,8 @@
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#include <wine/test.h>
 #include <ndk/rtlfuncs.h>
-#include <pseh/pseh2.h>
 
 void
 Test_RtlFindMostSignificantBit(void)
index 5a961f8..76910cf 100644 (file)
@@ -5,10 +5,9 @@
  * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#define UNICODE
-#include <wine/test.h>
-#include <pseh/pseh2.h>
 #include <ndk/mmfuncs.h>
 #include <ndk/rtlfuncs.h>
 
@@ -104,12 +103,8 @@ FreeGuarded(
     ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status);
 }
 
-#define StartSeh()              ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY {
-#define EndSeh(ExpectedStatus)  } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus)
-
 START_TEST(RtlDetermineDosPathNameType)
 {
-    NTSTATUS ExceptionStatus;
     RTL_PATH_TYPE PathType;
     struct
     {
@@ -189,7 +184,7 @@ START_TEST(RtlDetermineDosPathNameType)
 
     if (!RtlDetermineDosPathNameType_Ustr)
     {
-        RtlDetermineDosPathNameType_Ustr = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlDetermineDosPathNameType_Ustr");
+        RtlDetermineDosPathNameType_Ustr = (PVOID)GetProcAddress(GetModuleHandleW(L"ntdll"), "RtlDetermineDosPathNameType_Ustr");
         if (!RtlDetermineDosPathNameType_Ustr)
             skip("RtlDetermineDosPathNameType_Ustr unavailable\n");
     }
index d5b5320..beb445f 100644 (file)
@@ -5,16 +5,12 @@
  * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#define UNICODE
 #include <stdio.h>
-#include <wine/test.h>
-#include <pseh/pseh2.h>
 #include <ndk/rtlfuncs.h>
 
-#define StartSeh()              ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY {
-#define EndSeh(ExpectedStatus)  } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus)
-
 #define ok_bool_file(value, expected, file) do {                                \
         if (expected)                                                           \
             ok(value == TRUE, "File '%ls' should exist, but does not\n", file); \
@@ -90,7 +86,6 @@ BOOLEAN
 
 START_TEST(RtlDoesFileExists)
 {
-    NTSTATUS ExceptionStatus;
     BOOLEAN Ret;
     struct
     {
@@ -168,21 +163,21 @@ START_TEST(RtlDoesFileExists)
 
     if (!RtlDoesFileExists_UEx)
     {
-        RtlDoesFileExists_UEx = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlDoesFileExists_UEx");
+        RtlDoesFileExists_UEx = (PVOID)GetProcAddress(GetModuleHandleW(L"ntdll"), "RtlDoesFileExists_UEx");
         if (!RtlDoesFileExists_UEx)
             skip("RtlDoesFileExists_UEx unavailable\n");
     }
 
     if (!RtlDoesFileExists_UStr)
     {
-        RtlDoesFileExists_UStr = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlDoesFileExists_UStr");
+        RtlDoesFileExists_UStr = (PVOID)GetProcAddress(GetModuleHandleW(L"ntdll"), "RtlDoesFileExists_UStr");
         if (!RtlDoesFileExists_UStr)
             skip("RtlDoesFileExists_UStr unavailable\n");
     }
 
     if (!RtlDoesFileExists_UstrEx)
     {
-        RtlDoesFileExists_UstrEx = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlDoesFileExists_UstrEx");
+        RtlDoesFileExists_UstrEx = (PVOID)GetProcAddress(GetModuleHandleW(L"ntdll"), "RtlDoesFileExists_UstrEx");
         if (!RtlDoesFileExists_UstrEx)
             skip("RtlDoesFileExists_UstrEx unavailable\n");
     }
@@ -215,18 +210,18 @@ START_TEST(RtlDoesFileExists)
 
     swprintf(FileName, L"C:\\%ls", CustomPath);
     /* Make sure this directory doesn't exist */
-    while (GetFileAttributes(FileName) != INVALID_FILE_ATTRIBUTES)
+    while (GetFileAttributesW(FileName) != INVALID_FILE_ATTRIBUTES)
     {
         wcscat(CustomPath, L"X");
         swprintf(FileName, L"C:\\%ls", CustomPath);
     }
-    Success = CreateDirectory(FileName, NULL);
+    Success = CreateDirectoryW(FileName, NULL);
     ok(Success, "CreateDirectory failed, results might not be accurate\n");
     swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath);
-    Success = CreateDirectory(FileName, NULL);
+    Success = CreateDirectoryW(FileName, NULL);
     ok(Success, "CreateDirectory failed, results might not be accurate\n");
     swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath);
-    Handle = CreateFile(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL);
+    Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL);
     ok(Handle != INVALID_HANDLE_VALUE, "CreateFile failed, results might not be accurate\n");
     if (Handle != INVALID_HANDLE_VALUE)
     {
@@ -307,12 +302,12 @@ START_TEST(RtlDoesFileExists)
     }
 
     swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath);
-    Success = DeleteFile(FileName);
+    Success = DeleteFileW(FileName);
     ok(Success, "DeleteFile failed, test might leave stale file\n");
     swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath);
-    Success = RemoveDirectory(FileName);
+    Success = RemoveDirectoryW(FileName);
     ok(Success, "RemoveDirectory failed, test might leave stale directory\n");
     swprintf(FileName, L"C:\\%ls", CustomPath);
-    Success = RemoveDirectory(FileName);
+    Success = RemoveDirectoryW(FileName);
     ok(Success, "RemoveDirectory failed, test might leave stale directory\n");
 }
index d66519d..63dbcf2 100644 (file)
 # include <stdio.h>
 # include <stddef.h>
 #else /* Compile for ReactOS or wine */
+# include <apitest.h>
 # define WIN32_NO_STATUS
 # include <stdio.h>
-# include <wine/test.h>
-# include <pseh/pseh2.h>
 # include <ndk/rtlfuncs.h>
 #endif
 
index b807ce4..cb361bd 100644 (file)
@@ -5,11 +5,10 @@
  * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#define UNICODE
 #include <stdio.h>
-#include <wine/test.h>
-#include <pseh/pseh2.h>
 #include <ndk/rtlfuncs.h>
 
 /*
@@ -25,9 +24,6 @@ RtlDosSearchPath_U(
 );
 */
 
-#define StartSeh()              ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY {
-#define EndSeh(ExpectedStatus)  } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus)
-
 static
 BOOLEAN
 CheckStringBuffer(
@@ -96,11 +92,8 @@ CheckBuffer(
     return TRUE;
 }
 
-#define InvalidPointer ((PVOID)0x0123456789ABCDEFULL)
-
 START_TEST(RtlDosSearchPath_U)
 {
-    NTSTATUS ExceptionStatus;
     ULONG Length = 0;
     WCHAR Buffer[MAX_PATH];
     PWSTR PartName;
@@ -112,18 +105,18 @@ START_TEST(RtlDosSearchPath_U)
 
     swprintf(FileName, L"C:\\%ls", CustomPath);
     /* Make sure this directory doesn't exist */
-    while (GetFileAttributes(FileName) != INVALID_FILE_ATTRIBUTES)
+    while (GetFileAttributesW(FileName) != INVALID_FILE_ATTRIBUTES)
     {
         wcscat(CustomPath, L"X");
         swprintf(FileName, L"C:\\%ls", CustomPath);
     }
-    Success = CreateDirectory(FileName, NULL);
+    Success = CreateDirectoryW(FileName, NULL);
     ok(Success, "CreateDirectory failed, results might not be accurate\n");
     swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath);
-    Success = CreateDirectory(FileName, NULL);
+    Success = CreateDirectoryW(FileName, NULL);
     ok(Success, "CreateDirectory failed, results might not be accurate\n");
     swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath);
-    Handle = CreateFile(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL);
+    Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL);
     ok(Handle != INVALID_HANDLE_VALUE, "CreateFile failed, results might not be accurate\n");
     if (Handle != INVALID_HANDLE_VALUE)
         CloseHandle(Handle);
@@ -170,7 +163,7 @@ START_TEST(RtlDosSearchPath_U)
 
     /* Empty path string searches in current directory */
     swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath);
-    Success = SetCurrentDirectory(FileName);
+    Success = SetCurrentDirectoryW(FileName);
     ok(Success, "SetCurrentDirectory failed\n");
     PartName = InvalidPointer;
     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
@@ -206,14 +199,14 @@ START_TEST(RtlDosSearchPath_U)
     ok(Okay, "CheckStringBuffer failed\n");
 
     /* Clean up test folder */
-    SetCurrentDirectory(L"C:\\");
+    SetCurrentDirectoryW(L"C:\\");
     swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath);
-    Success = DeleteFile(FileName);
+    Success = DeleteFileW(FileName);
     ok(Success, "DeleteFile failed, test might leave stale file\n");
     swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath);
-    Success = RemoveDirectory(FileName);
+    Success = RemoveDirectoryW(FileName);
     ok(Success, "RemoveDirectory failed %(lu), test might leave stale directory\n", GetLastError());
     swprintf(FileName, L"C:\\%ls", CustomPath);
-    Success = RemoveDirectory(FileName);
+    Success = RemoveDirectoryW(FileName);
     ok(Success, "RemoveDirectory failed (%lu), test might leave stale directory\n", GetLastError());
 }
index 5c2df47..307de5a 100644 (file)
@@ -5,9 +5,9 @@
  * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#include <wine/test.h>
-#include <pseh/pseh2.h>
 #include <ndk/rtlfuncs.h>
 
 /*
@@ -26,9 +26,6 @@ RtlDosSearchPath_Ustr(
 );
 */
 
-#define StartSeh()              ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY {
-#define EndSeh(ExpectedStatus)  } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus)
-
 #define ok_eq_ulong(value, expected) ok((value) == (expected), #value " = %lu, expected %lu\n", value, expected)
 #define ok_eq_hex(value, expected) ok((value) == (expected), #value " = 0x%lx, expected 0x%lx\n", value, expected)
 #define ok_eq_pointer(value, expected) ok((value) == (expected), #value " = %p, expected %p\n", value, expected)
@@ -39,11 +36,8 @@ RtlDosSearchPath_Ustr(
         ok((str1)->MaximumLength == (str2)->MaximumLength, "MaximumLength modified\n"); \
     } while (0)
 
-#define InvalidPointer ((PVOID)0x0123456789ABCDEFULL)
-
 START_TEST(RtlDosSearchPath_Ustr)
 {
-    NTSTATUS ExceptionStatus;
     NTSTATUS Status;
     UNICODE_STRING PathString;
     UNICODE_STRING FileNameString;
index f227461..9f5e088 100644 (file)
@@ -5,9 +5,9 @@
  * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#include <wine/test.h>
-#include <pseh/pseh2.h>
 #include <ndk/rtlfuncs.h>
 
 /*
@@ -21,9 +21,6 @@ RtlGetFullPathName_U(
 );
 */
 
-#define StartSeh()                  ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY {
-#define EndSeh(ExpectedStatus)      } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus)
-
 static
 BOOLEAN
 CheckStringBuffer(
@@ -73,8 +70,6 @@ CheckStringBuffer(
     return Result;
 }
 
-#define InvalidPointer ((PVOID)0x0123456789ABCDEFULL)
-
 /* winetest_platform is "windows" for us, so broken() doesn't do what it should :( */
 #undef broken
 #define broken(x) 0
@@ -132,7 +127,6 @@ RunTestCases(VOID)
         { L"\\\\??\\C:\\test",   PrefixNone, L"\\\\??\\C:\\test", PrefixNone, sizeof(L"\\\\??\\C:\\") },
         { L"\\\\??\\C:\\test\\", PrefixNone, L"\\\\??\\C:\\test\\" },
     };
-    NTSTATUS ExceptionStatus;
     WCHAR FullPathNameBuffer[MAX_PATH];
     PWSTR ShortName;
     SIZE_T Length;
@@ -226,7 +220,6 @@ RunTestCases(VOID)
 
 START_TEST(RtlGetFullPathName_U)
 {
-    NTSTATUS ExceptionStatus;
     PCWSTR FileName;
     PWSTR ShortName;
     ULONG Length;
index 00dacb3..45e7c70 100644 (file)
@@ -5,10 +5,9 @@
  * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#define UNICODE
-#include <wine/test.h>
-#include <pseh/pseh2.h>
 #include <ndk/rtlfuncs.h>
 
 /*
@@ -47,9 +46,6 @@ ULONG
 //= (PVOID)0x7769a3dd // win7 sp1 wow64
 ;
 
-#define StartSeh()                  ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY {
-#define EndSeh(ExpectedStatus)      } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus)
-
 #define ok_eq_ustr(str1, str2) do {                                                     \
         ok((str1)->Buffer        == (str2)->Buffer,        "Buffer modified\n");        \
         ok((str1)->Length        == (str2)->Length,        "Length modified\n");        \
@@ -125,7 +121,6 @@ CheckBuffer(
 }
 
 #define RtlPathTypeNotSet 123
-#define InvalidPointer ((PVOID)0x0123456789ABCDEFULL)
 
 /* winetest_platform is "windows" for us, so broken() doesn't do what it should :( */
 #undef broken
@@ -185,7 +180,6 @@ RunTestCases(VOID)
         { L"\\\\??\\C:\\test",   PrefixNone, L"\\\\??\\C:\\test", RtlPathTypeUncAbsolute, PrefixNone, sizeof(L"\\\\??\\C:\\") },
         { L"\\\\??\\C:\\test\\", PrefixNone, L"\\\\??\\C:\\test\\", RtlPathTypeUncAbsolute },
     };
-    NTSTATUS ExceptionStatus;
     ULONG Length;
     UNICODE_STRING FileName;
     WCHAR FullPathNameBuffer[MAX_PATH];
@@ -300,7 +294,6 @@ RunTestCases(VOID)
 
 START_TEST(RtlGetFullPathName_Ustr)
 {
-    NTSTATUS ExceptionStatus;
     ULONG Length;
     UNICODE_STRING FileName;
     UNICODE_STRING TempString;
@@ -312,7 +305,7 @@ START_TEST(RtlGetFullPathName_Ustr)
 
     if (!RtlGetFullPathName_Ustr)
     {
-        RtlGetFullPathName_Ustr = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlGetFullPathName_Ustr");
+        RtlGetFullPathName_Ustr = (PVOID)GetProcAddress(GetModuleHandleW(L"ntdll"), "RtlGetFullPathName_Ustr");
         if (!RtlGetFullPathName_Ustr)
         {
             skip("RtlGetFullPathName_Ustr unavailable\n");
index ffd66f1..2c84f83 100644 (file)
@@ -5,10 +5,9 @@
  * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#define UNICODE
-#include <wine/test.h>
-#include <pseh/pseh2.h>
 #include <ndk/rtlfuncs.h>
 
 /*
@@ -39,9 +38,6 @@ NTSTATUS
     OUT PSIZE_T LengthNeeded OPTIONAL
 );
 
-#define StartSeh()                  ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY {
-#define EndSeh(ExpectedStatus)      } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus)
-
 #define ok_eq_ustr(str1, str2) do {                                                     \
         ok((str1)->Buffer        == (str2)->Buffer,        "Buffer modified\n");        \
         ok((str1)->Length        == (str2)->Length,        "Length modified\n");        \
@@ -115,7 +111,6 @@ CheckBuffer(
 }
 
 #define RtlPathTypeNotSet 123
-#define InvalidPointer ((PVOID)0x0123456789ABCDEFULL)
 
 /* winetest_platform is "windows" for us, so broken() doesn't do what it should :( */
 #undef broken
@@ -175,7 +170,7 @@ RunTestCases(VOID)
         { L"\\\\??\\C:\\test",   PrefixNone, L"\\\\??\\C:\\test", RtlPathTypeUncAbsolute, PrefixNone, sizeof(L"\\\\??\\C:\\") },
         { L"\\\\??\\C:\\test\\", PrefixNone, L"\\\\??\\C:\\test\\", RtlPathTypeUncAbsolute },
     };
-    NTSTATUS Status, ExceptionStatus;
+    NTSTATUS Status;
     UNICODE_STRING FileName;
     UNICODE_STRING FullPathName;
     WCHAR FullPathNameBuffer[MAX_PATH];
@@ -289,7 +284,7 @@ RunTestCases(VOID)
 
 START_TEST(RtlGetFullPathName_UstrEx)
 {
-    NTSTATUS Status, ExceptionStatus;
+    NTSTATUS Status;
     UNICODE_STRING FileName;
     UNICODE_STRING TempString;
     UNICODE_STRING StaticString;
@@ -301,7 +296,7 @@ START_TEST(RtlGetFullPathName_UstrEx)
     SIZE_T LengthNeeded;
     BOOLEAN Okay;
 
-    pRtlGetFullPathName_UstrEx = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlGetFullPathName_UstrEx");
+    pRtlGetFullPathName_UstrEx = (PVOID)GetProcAddress(GetModuleHandleW(L"ntdll"), "RtlGetFullPathName_UstrEx");
     if (!pRtlGetFullPathName_UstrEx)
     {
         skip("RtlGetFullPathName_UstrEx unavailable\n");
index 8dc34d6..01bea61 100644 (file)
@@ -5,8 +5,9 @@
  * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#include <wine/test.h>
 #include <ndk/rtlfuncs.h>
 
 /*
index 75a1c5a..2e2ab49 100644 (file)
@@ -5,8 +5,9 @@
  * PROGRAMMERS:     Timo Kreuzer
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#include <wine/test.h>
 #include <ndk/rtlfuncs.h>
 
 void Test_RtlInitializeBitmap()
index d63d654..9a4eb2d 100644 (file)
@@ -5,8 +5,9 @@
  * PROGRAMMERS:     Timo Kreuzer
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#include <wine/test.h>
 #include <ndk/exfuncs.h>
 
 void
index 85ac8b5..1cebbd3 100644 (file)
@@ -5,8 +5,9 @@
  * PROGRAMMER:      Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
-#include <wine/test.h>
 #include <ndk/ketypes.h>
 #include <ndk/kefuncs.h>
 
index 17cbbe4..aad912b 100644 (file)
@@ -5,9 +5,10 @@
  * PROGRAMMER:     
  */
 
+#include <apitest.h>
+
 #include <setjmp.h>
 #include <time.h>
-#include <wine/test.h>
 
 #ifdef _M_IX86
 #define ZWC_SEGMENT_BITS (0xFFFF)
index 470713a..1ba99e5 100644 (file)
@@ -5,12 +5,13 @@
  * PROGRAMMER:      Timo Kreuzer
  */
 
+#include <apitest.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <strings.h>
 #include <math.h>
 #include <stdarg.h>
-#include <wine/test.h>
 #include <windows.h>
 
 
index 115b572..3c1d2fd 100644 (file)
@@ -1,7 +1,7 @@
 #define __ROS_LONG64__
 
 #define STANDALONE
-#include <wine/test.h>
+#include <apitest.h>
 
 extern void func_LdrEnumResources(void);
 extern void func_NtAllocateVirtualMemory(void);
index c00d778..9ad67a1 100644 (file)
@@ -1,8 +1,4 @@
 
-add_definitions(
-    -D__ROS_LONG64__
-    -D_UNICODE -DUNICODE)
-
 add_executable(powrprof_apitest power.c testlist.c)
 set_module_type(powrprof_apitest win32cui)
 add_importlibs(powrprof_apitest advapi32 powrprof msvcrt kernel32 ntdll)
index d9b4d8b..fdc34ba 100644 (file)
@@ -7,11 +7,11 @@
  *                  Martin Rottensteiner
  */
 
+#include <apitest.h>
+
 #include <stdarg.h>
 #include <ntstatus.h>
 #define WIN32_NO_STATUS
-#define STANDALONE
-#include <wine/test.h>
 #include <winreg.h>
 #include <powrprof.h>
 
index 0c723fe..31667e3 100644 (file)
@@ -1,25 +1,12 @@
-/* Automatically generated file; DO NOT EDIT!! */
+#define __ROS_LONG64__
 
-/* stdarg.h is needed for Winelib */
-//#include <stdarg.h>
-//#include <stdio.h>
-//#include <stdlib.h>
-//#include "windef.h"
-//#include "winbase.h"
-
-struct test
-{
-    const char *name;
-    void (*func)(void);
-};
+#define STANDALONE
+#include <apitest.h>
 
 extern void func_power(void);
 
 const struct test winetest_testlist[] =
 {
-       { "power", func_power },
-       { 0, 0 }
+    { "power", func_power },
+    { 0, 0 }
 };
-
-#define WINETEST_WANT_MAIN
-#include <wine/test.h>
index 3741393..7b92a28 100644 (file)
@@ -5,19 +5,16 @@
  * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
 #define _INC_WINDOWS
 #define COM_NO_WINDOWS_H
 #include <windef.h>
 #include <winsock2.h>
-#include <wine/test.h>
-#include <pseh/pseh2.h>
 #include <ndk/rtlfuncs.h>
 #include <ndk/mmfuncs.h>
 
-#define StartSeh()              ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY {
-#define EndSeh(ExpectedStatus)  } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus)
-
 static
 PVOID
 AllocateGuarded(
@@ -136,7 +133,6 @@ AreLegacyFunctionsSupported(VOID)
 
 START_TEST(WSAStartup)
 {
-    NTSTATUS ExceptionStatus;
     BOOLEAN Okay;
     LPWSADATA WsaData;
     int Error;
index 021e19e..10f01f7 100644 (file)
@@ -5,6 +5,8 @@
  * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
 #define _INC_WINDOWS
 #define COM_NO_WINDOWS_H
 #include <windef.h>
 #include <winbase.h>
 #include <ws2tcpip.h>
-#include <wine/test.h>
-#include <pseh/pseh2.h>
 #include <ndk/umtypes.h>
 
-#define StartSeh()              ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY {
-#define EndSeh(ExpectedStatus)  } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus)
-
 #define ok_addrinfo(ai, flags, family, socktype, protocol, addrlen) do  \
 {                                                                       \
     ok_hex((ai)->ai_flags, flags);                                      \
@@ -39,8 +36,6 @@
         ok_dec(((SOCKADDR_IN *)(sockaddr))->sin_zero[_i], 0);           \
 } while (0)
 
-#define InvalidPointer ((PVOID)0x5555555555555555ULL)
-
 CHAR LocalAddress[sizeof("255.255.255.255")];
 
 static
@@ -50,7 +45,6 @@ TestNodeName(VOID)
     int Error;
     PADDRINFOA AddrInfo;
     ADDRINFOA Hints;
-    NTSTATUS ExceptionStatus;
     struct
     {
         PCSTR NodeName;
@@ -124,7 +118,6 @@ TestServiceName(VOID)
     int Error;
     PADDRINFOA AddrInfo;
     ADDRINFOA Hints;
-    NTSTATUS ExceptionStatus;
     struct
     {
         PCSTR ServiceName;
@@ -216,7 +209,6 @@ START_TEST(getaddrinfo)
     int Error;
     PADDRINFOA AddrInfo;
     ADDRINFOA Hints;
-    NTSTATUS ExceptionStatus;
     CHAR LocalHostName[128];
     struct hostent *Hostent;
 
index 7a011ef..35bdfda 100644 (file)
@@ -6,9 +6,9 @@
  * COPYRIGHT:   Copyright 2008 Colin Finck <mail@colinfinck.de>
  */
 
-#include <stdio.h>
-#include <wine/test.h>
+#include <apitest.h>
 
+#include <stdio.h>
 #include "ws2_32.h"
 
 int CreateSocket(SOCKET* psck)
index 3df5ad4..90398b3 100644 (file)
@@ -5,9 +5,9 @@
  * PROGRAMMERS:     Colin Finck
  */
 
-#include <stdio.h>
-#include <wine/test.h>
+#include <apitest.h>
 
+#include <stdio.h>
 #include "ws2_32.h"
 
 int Test_ioctlsocket()
index 79927b6..3631a10 100644 (file)
@@ -5,8 +5,10 @@
  * PROGRAMMERS:     Colin Finck
  */
 
+#include <apitest.h>
+
 #include <stdio.h>
-#include <wine/test.h>
+#include <ntstatus.h>
 #include <winternl.h>
 #include "ws2_32.h"
 
index 356b6d2..fdd6f3d 100644 (file)
@@ -1,7 +1,7 @@
 #define __ROS_LONG64__
 
 #define STANDALONE
-#include <wine/test.h>
+#include <apitest.h>
 
 extern void func_getaddrinfo(void);
 extern void func_ioctlsocket(void);