From 2b31cf640d1240c3ca885c47c03881571bc42ba3 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 1 Sep 2007 22:06:05 +0000 Subject: [PATCH] - Add test for AddFontResourceEx showing that the function accepts 0 as flags. - remove header inclusion in test files svn path=/trunk/; revision=28753 --- rostests/apitests/gdi32api/testlist.c | 2 ++ .../gdi32api/tests/AddFontResourceEx.c | 19 +++++++++++++++++++ .../gdi32api/tests/CreateCompatibleDC.c | 2 -- rostests/apitests/gdi32api/tests/CreateFont.c | 2 -- rostests/apitests/gdi32api/tests/CreatePen.c | 2 -- .../apitests/gdi32api/tests/CreateRectRgn.c | 2 -- .../apitests/gdi32api/tests/ExtCreatePen.c | 2 -- rostests/apitests/gdi32api/tests/GetClipRgn.c | 2 -- rostests/apitests/gdi32api/tests/GetObject.c | 2 -- .../apitests/gdi32api/tests/GetStockObject.c | 2 -- .../apitests/gdi32api/tests/SelectObject.c | 2 -- .../apitests/gdi32api/tests/SetDCPenColor.c | 2 -- .../apitests/gdi32api/tests/SetSysColors.c | 2 -- 13 files changed, 21 insertions(+), 22 deletions(-) create mode 100644 rostests/apitests/gdi32api/tests/AddFontResourceEx.c diff --git a/rostests/apitests/gdi32api/testlist.c b/rostests/apitests/gdi32api/testlist.c index 5c85313bbd8..e54cd8fd024 100644 --- a/rostests/apitests/gdi32api/testlist.c +++ b/rostests/apitests/gdi32api/testlist.c @@ -4,6 +4,7 @@ #include "gdi32api.h" /* include the tests */ +#include "tests/AddFontResourceEx.c" #include "tests/CreateCompatibleDC.c" #include "tests/CreateFont.c" #include "tests/CreatePen.c" @@ -20,6 +21,7 @@ /* The List of tests */ TESTENTRY TestList[] = { + { L"AddFontResourceEx", Test_AddFontResourceEx }, { L"CreateCompatibleDC", Test_CreateCompatibleDC }, { L"CreateFont", Test_CreateFont }, { L"CreatePen", Test_CreatePen }, diff --git a/rostests/apitests/gdi32api/tests/AddFontResourceEx.c b/rostests/apitests/gdi32api/tests/AddFontResourceEx.c new file mode 100644 index 00000000000..4dff4c483db --- /dev/null +++ b/rostests/apitests/gdi32api/tests/AddFontResourceEx.c @@ -0,0 +1,19 @@ + +INT +Test_AddFontResourceEx(PTESTINFO pti) +{ + WCHAR szFileName[MAX_PATH]; + GetEnvironmentVariableW(L"systemroot", szFileName, MAX_PATH); + + wcscat(szFileName, L"\\Fonts\\cour.ttf"); + + SetLastError(ERROR_SUCCESS); + TEST(AddFontResourceExW(szFileName, 0, 0) != 0); + TEST(GetLastError() == ERROR_SUCCESS); + + SetLastError(ERROR_SUCCESS); + TEST(AddFontResourceExW(szFileName, 256, 0) == 0); + TEST(GetLastError() == ERROR_INVALID_PARAMETER); + + return APISTATUS_NORMAL; +} diff --git a/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c b/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c index 11d890c9b39..f31103d567c 100644 --- a/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c +++ b/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c @@ -1,5 +1,3 @@ -#include "../gdi32api.h" - INT Test_CreateCompatibleDC(PTESTINFO pti) { diff --git a/rostests/apitests/gdi32api/tests/CreateFont.c b/rostests/apitests/gdi32api/tests/CreateFont.c index 8a3c45f95ff..fc26058b45c 100644 --- a/rostests/apitests/gdi32api/tests/CreateFont.c +++ b/rostests/apitests/gdi32api/tests/CreateFont.c @@ -1,5 +1,3 @@ -#include "../gdi32api.h" - #define INVALIDFONT "ThisFontDoesNotExist" INT diff --git a/rostests/apitests/gdi32api/tests/CreatePen.c b/rostests/apitests/gdi32api/tests/CreatePen.c index 4031f192e17..20bffa6a4b8 100644 --- a/rostests/apitests/gdi32api/tests/CreatePen.c +++ b/rostests/apitests/gdi32api/tests/CreatePen.c @@ -1,5 +1,3 @@ -#include "../gdi32api.h" - INT Test_CreatePen(PTESTINFO pti) { diff --git a/rostests/apitests/gdi32api/tests/CreateRectRgn.c b/rostests/apitests/gdi32api/tests/CreateRectRgn.c index c2067f14982..58941b4f125 100644 --- a/rostests/apitests/gdi32api/tests/CreateRectRgn.c +++ b/rostests/apitests/gdi32api/tests/CreateRectRgn.c @@ -1,5 +1,3 @@ -#include "../gdi32api.h" - INT Test_CreateRectRgn(PTESTINFO pti) { diff --git a/rostests/apitests/gdi32api/tests/ExtCreatePen.c b/rostests/apitests/gdi32api/tests/ExtCreatePen.c index 853417fca44..d2488e1c2d5 100644 --- a/rostests/apitests/gdi32api/tests/ExtCreatePen.c +++ b/rostests/apitests/gdi32api/tests/ExtCreatePen.c @@ -1,5 +1,3 @@ -#include "../gdi32api.h" - INT Test_ExtCreatePen(PTESTINFO pti) { diff --git a/rostests/apitests/gdi32api/tests/GetClipRgn.c b/rostests/apitests/gdi32api/tests/GetClipRgn.c index 5f46943e39a..14bd2a87776 100644 --- a/rostests/apitests/gdi32api/tests/GetClipRgn.c +++ b/rostests/apitests/gdi32api/tests/GetClipRgn.c @@ -1,5 +1,3 @@ -#include "../gdi32api.h" - INT Test_GetClipRgn(PTESTINFO pti) { diff --git a/rostests/apitests/gdi32api/tests/GetObject.c b/rostests/apitests/gdi32api/tests/GetObject.c index 5200f857afc..45a88633de5 100644 --- a/rostests/apitests/gdi32api/tests/GetObject.c +++ b/rostests/apitests/gdi32api/tests/GetObject.c @@ -1,5 +1,3 @@ -#include "../gdi32api.h" - static INT Test_General(PTESTINFO pti) { diff --git a/rostests/apitests/gdi32api/tests/GetStockObject.c b/rostests/apitests/gdi32api/tests/GetStockObject.c index 14f8461669d..7b4d2fe1288 100644 --- a/rostests/apitests/gdi32api/tests/GetStockObject.c +++ b/rostests/apitests/gdi32api/tests/GetStockObject.c @@ -1,5 +1,3 @@ -#include "../gdi32api.h" - INT Test_GetStockObject(PTESTINFO pti) { diff --git a/rostests/apitests/gdi32api/tests/SelectObject.c b/rostests/apitests/gdi32api/tests/SelectObject.c index ee72b17227c..2eb7c56997d 100644 --- a/rostests/apitests/gdi32api/tests/SelectObject.c +++ b/rostests/apitests/gdi32api/tests/SelectObject.c @@ -1,5 +1,3 @@ -#include "../gdi32api.h" - INT Test_SelectObject(PTESTINFO pti) { diff --git a/rostests/apitests/gdi32api/tests/SetDCPenColor.c b/rostests/apitests/gdi32api/tests/SetDCPenColor.c index ed7c28ec54d..b04bb936d0c 100644 --- a/rostests/apitests/gdi32api/tests/SetDCPenColor.c +++ b/rostests/apitests/gdi32api/tests/SetDCPenColor.c @@ -1,5 +1,3 @@ -#include "../gdi32api.h" - INT Test_SetDCPenColor(PTESTINFO pti) { diff --git a/rostests/apitests/gdi32api/tests/SetSysColors.c b/rostests/apitests/gdi32api/tests/SetSysColors.c index 252a9beab34..9becb7eeeaa 100644 --- a/rostests/apitests/gdi32api/tests/SetSysColors.c +++ b/rostests/apitests/gdi32api/tests/SetSysColors.c @@ -1,5 +1,3 @@ -#include "../gdi32api.h" - #define NUM_SYSCOLORS 31 INT -- 2.17.1