mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 12:11:42 +00:00
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:
parent
96b8978ef3
commit
c81402138a
8 changed files with 6708 additions and 1 deletions
65
rostests/apitests/gdi32api/tests/AddFontResource.c
Normal file
65
rostests/apitests/gdi32api/tests/AddFontResource.c
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue