Adding a text file call notes.txt it is some werid thing I have have not yet figout how it works.

Add testcase for AddFontResourceA

svn path=/trunk/; revision=29306
This commit is contained in:
Magnus Olsen 2007-09-30 11:57:37 +00:00
parent 96b8978ef3
commit c81402138a
8 changed files with 6708 additions and 1 deletions

View file

@ -0,0 +1,7 @@
AddFontResource
it seam any type of pfm/pfb/fon/fnt been genreate by fontforge
does not be accpected by Windows
Notes Loading two font same times does not working
as msdn desc how todo it

View file

@ -4,6 +4,7 @@
#include "gdi32api.h"
/* include the tests */
#include "tests/AddFontResource.c"
#include "tests/AddFontResourceEx.c"
#include "tests/CreateCompatibleDC.c"
#include "tests/CreateFont.c"
@ -22,6 +23,7 @@
/* The List of tests */
TESTENTRY TestList[] =
{
{ L"AddFontResourceA", Test_AddFontResourceA },
{ L"AddFontResourceEx", Test_AddFontResourceEx },
{ L"CreateCompatibleDC", Test_CreateCompatibleDC },
{ L"CreateFont", Test_CreateFont },

View file

@ -0,0 +1,65 @@
INT
Test_AddFontResourceA(PTESTINFO pti)
{
CHAR szFileNameA[MAX_PATH];
CHAR szFileNameFont1A[MAX_PATH];
CHAR szFileNameFont2A[MAX_PATH];
GetCurrentDirectoryA(MAX_PATH,szFileNameA);
memcpy(szFileNameFont1A,szFileNameA,MAX_PATH );
strcat(szFileNameFont1A, "\\testdata\\test.ttf");
memcpy(szFileNameFont2A,szFileNameA,MAX_PATH );
strcat(szFileNameFont2A, "\\testdata\\test.otf");
RtlZeroMemory(szFileNameA,MAX_PATH);
/*
* Start testing Ansi version
*
*/
/* Testing NULL pointer */
SetLastError(ERROR_SUCCESS);
TEST(AddFontResourceA(NULL) == 0);
TEST(GetLastError() == ERROR_SUCCESS);
/* Testing -1 pointer */
SetLastError(ERROR_SUCCESS);
TEST(AddFontResourceA((CHAR*)-1) == 0);
TEST(GetLastError() == ERROR_SUCCESS);
/* Testing address 1 pointer */
SetLastError(ERROR_SUCCESS);
TEST(AddFontResourceA((CHAR*)1) == 0);
TEST(GetLastError() == ERROR_SUCCESS);
/* Testing address empty string */
SetLastError(ERROR_SUCCESS);
TEST(AddFontResourceA("") == 0);
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
/* Testing one ttf font */
SetLastError(ERROR_SUCCESS);
TEST(AddFontResourceA(szFileNameFont1A) == 1);
TEST(GetLastError() == ERROR_SUCCESS);
/* Testing one otf font */
SetLastError(ERROR_SUCCESS);
TEST(AddFontResourceA(szFileNameFont2A) == 1);
TEST(GetLastError() == ERROR_SUCCESS);
/* Testing two font */
SetLastError(ERROR_SUCCESS);
sprintf(szFileNameA,"%s | %s",szFileNameFont1A, szFileNameFont2A);
TEST(AddFontResourceA(szFileNameA) == 0);
printf("%x\n",(INT)GetLastError());
TEST(GetLastError() == ERROR_FILE_NOT_FOUND);
return APISTATUS_NORMAL;
}

21
rostests/apitests/testdata/ReadMe.txt vendored Normal file
View file

@ -0,0 +1,21 @@
We can not test follow format yet.
Follow format need be genreted to complete all test
*.fon : Font resource file.
*.fnt : Raw bitmap font file.
*.ttc : East Asian Windows: TrueType font collection.
*.fot : TrueType resource file.
*.mmm : multiple master Type1 font resource file. It must be used with .pfm and .pfb files.
Follow format have been genrate from test.std with fontforge in cygwin
test.otf
test.pfb
test.pfm
test.ttf
How to setup test data
Copy this folder to same folder as gdi32api.exe

BIN
rostests/apitests/testdata/test.otf vendored Normal file

Binary file not shown.

6612
rostests/apitests/testdata/test.sfd vendored Normal file

File diff suppressed because it is too large Load diff

BIN
rostests/apitests/testdata/test.ttf vendored Normal file

Binary file not shown.

View file

@ -394,7 +394,7 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
/* It is forbein to return a DDSURFACEDESC2 it should always be DDSURFACEDESC
This is only for detected bad drivers that does not follow the rules, if they
does not follow tthe rules only not everthing being copy then in gdi32.dll
does not follow tthe rules, not everthing being copy then in gdi32.dll
gdi32.dll always assume it is DDSURFACEDESC size
*/
if (puD3dDriverData->dwNumTextureFormats != 0)