Commit 2302d2b4 authored by Saulius Krasuckas's avatar Saulius Krasuckas Committed by Alexandre Julliard

mscms: Move repetitive code to helper macros.

parent 930e8394
......@@ -439,46 +439,35 @@ static void test_GetCountColorProfileElements(void)
}
}
#define fail_GSCSPA(pMachName, dwProfID, pProfName, pdwSz, dwSz, GLE_OK) \
do { \
size = dwSz; \
SetLastError(0); \
ret = pGetStandardColorSpaceProfileA(pMachName, dwProfID, pProfName, pdwSz);\
GLE = GetLastError(); \
ok( !ret && GLE_OK, \
"GetStandardColorSpaceProfileA() returns %d (GLE=%ld)\n", ret, GLE ); \
} while (0)
static void test_GetStandardColorSpaceProfileA(void)
{
BOOL ret;
DWORD size, GLE;
DWORD size, sizeP, GLE;
CHAR oldprofile[MAX_PATH];
CHAR newprofile[MAX_PATH];
sizeP = sizeof(newprofile);
/* Parameter checks */
SetLastError(0);
ret = pGetStandardColorSpaceProfileA( NULL, 0, newprofile, NULL );
GLE = GetLastError();
todo_wine
ok( !ret && GLE == ERROR_INVALID_PARAMETER,
"GetStandardColorSpaceProfileA() returns %d (GLE=%ld)\n", ret, GLE );
SetLastError(0);
ret = pGetStandardColorSpaceProfileA( machine, 0, newprofile, &size );
GLE = GetLastError();
fail_GSCSPA(machine, 0, newprofile, &size, 0, (GLE == ERROR_INVALID_PARAMETER || GLE == ERROR_NOT_SUPPORTED));
todo_wine
ok( !ret && (GLE == ERROR_INVALID_PARAMETER || GLE == ERROR_NOT_SUPPORTED),
"GetStandardColorSpaceProfileA() returns %d (GLE=%ld)\n", ret, GLE );
size = 0;
SetLastError(0);
ret = pGetStandardColorSpaceProfileA( NULL, 0, NULL, &size );
GLE = GetLastError();
fail_GSCSPA(NULL, 0, newprofile, NULL, 0, (GLE == ERROR_INVALID_PARAMETER));
todo_wine
ok( !ret && (GLE == ERROR_INSUFFICIENT_BUFFER || GLE == ERROR_FILE_NOT_FOUND),
"GetStandardColorSpaceProfileA() returns %d (GLE=%ld)\n", ret, GLE );
size = sizeof(newprofile);
SetLastError(0);
ret = pGetStandardColorSpaceProfileA( NULL, 0, newprofile, &size );
GLE = GetLastError();
fail_GSCSPA(NULL, 0, NULL, &size, 0, (GLE == ERROR_INSUFFICIENT_BUFFER || GLE == ERROR_FILE_NOT_FOUND));
todo_wine
ok( !ret && GLE == ERROR_FILE_NOT_FOUND,
"GetStandardColorSpaceProfileA() returns %d (GLE=%ld)\n", ret, GLE );
fail_GSCSPA(NULL, 0, newprofile, &size, sizeP, (GLE == ERROR_FILE_NOT_FOUND));
/* Functional checks */
......@@ -504,46 +493,35 @@ static void test_GetStandardColorSpaceProfileA(void)
}
}
#define fail_GSCSPW(pMachName, dwProfID, pProfName, pdwSz, dwSz, GLE_OK) \
do { \
size = dwSz; \
SetLastError(0); \
ret = pGetStandardColorSpaceProfileW(pMachName, dwProfID, pProfName, pdwSz);\
GLE = GetLastError(); \
ok( !ret && GLE_OK, \
"GetStandardColorSpaceProfileW() returns %d (GLE=%ld)\n", ret, GLE ); \
} while (0)
static void test_GetStandardColorSpaceProfileW(void)
{
BOOL ret;
DWORD size, GLE;
DWORD size, sizeP, GLE;
WCHAR oldprofile[MAX_PATH];
WCHAR newprofile[MAX_PATH];
sizeP = sizeof(newprofile);
/* Parameter checks */
SetLastError(0);
ret = pGetStandardColorSpaceProfileW( NULL, 0, newprofile, NULL );
GLE = GetLastError();
todo_wine
ok( !ret && GLE == ERROR_INVALID_PARAMETER,
"GetStandardColorSpaceProfileW() returns %d (GLE=%ld)\n", ret, GLE );
SetLastError(0);
ret = pGetStandardColorSpaceProfileW( machineW, 0, newprofile, &size );
GLE = GetLastError();
fail_GSCSPW(machineW, 0, newprofile, &size, 0, (GLE == ERROR_INVALID_PARAMETER));
todo_wine
ok( !ret && GLE == ERROR_INVALID_PARAMETER,
"GetStandardColorSpaceProfileW() returns %d (GLE=%ld)\n", ret, GLE );
size = 0;
SetLastError(0);
ret = pGetStandardColorSpaceProfileW( NULL, 0, NULL, &size );
GLE = GetLastError();
fail_GSCSPW(NULL, 0, newprofile, NULL, 0, (GLE == ERROR_INVALID_PARAMETER));
todo_wine
ok( !ret && (GLE == ERROR_INSUFFICIENT_BUFFER || GLE == ERROR_FILE_NOT_FOUND),
"GetStandardColorSpaceProfileW() returns %d (GLE=%ld)\n", ret, GLE );
size = sizeof(newprofile);
SetLastError(0);
ret = pGetStandardColorSpaceProfileW( NULL, 0, newprofile, &size );
GLE = GetLastError();
fail_GSCSPW(NULL, 0, NULL, &size, 0, (GLE == ERROR_INSUFFICIENT_BUFFER || GLE == ERROR_FILE_NOT_FOUND));
todo_wine
ok( !ret && GLE == ERROR_FILE_NOT_FOUND,
"GetStandardColorSpaceProfileW() returns %d (GLE=%ld)\n", ret, GLE );
fail_GSCSPW(NULL, 0, newprofile, &size, sizeP, (GLE == ERROR_FILE_NOT_FOUND));
/* Functional checks */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment