Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
bb6e2ee6
Commit
bb6e2ee6
authored
May 30, 2022
by
Hans Leidekker
Committed by
Alexandre Julliard
May 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscms/tests: Add TranslateBitmapBits tests.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a8a126c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
profile.c
dlls/mscms/tests/profile.c
+60
-0
No files found.
dlls/mscms/tests/profile.c
View file @
bb6e2ee6
...
...
@@ -58,6 +58,7 @@ static BOOL (WINAPI *pSetColorProfileElement)(HPROFILE,TAGTYPE,DWORD,PDWORD,
static
BOOL
(
WINAPI
*
pSetColorProfileHeader
)(
HPROFILE
,
PPROFILEHEADER
);
static
BOOL
(
WINAPI
*
pSetStandardColorSpaceProfileA
)(
PCSTR
,
DWORD
,
PSTR
);
static
BOOL
(
WINAPI
*
pSetStandardColorSpaceProfileW
)(
PCWSTR
,
DWORD
,
PWSTR
);
static
BOOL
(
WINAPI
*
pTranslateBitmapBits
)(
HTRANSFORM
,
PVOID
,
BMFORMAT
,
DWORD
,
DWORD
,
DWORD
,
PVOID
,
BMFORMAT
,
DWORD
,
PBMCALLBACKFN
,
ULONG
);
static
BOOL
(
WINAPI
*
pUninstallColorProfileA
)(
PCSTR
,
PCSTR
,
BOOL
);
static
BOOL
(
WINAPI
*
pUninstallColorProfileW
)(
PCWSTR
,
PCWSTR
,
BOOL
);
...
...
@@ -95,6 +96,7 @@ static BOOL init_function_ptrs( void )
GETFUNCPTR
(
SetStandardColorSpaceProfileW
)
GETFUNCPTR
(
UninstallColorProfileA
)
GETFUNCPTR
(
UninstallColorProfileW
)
GETFUNCPTR
(
TranslateBitmapBits
)
pEnumDisplayDevicesA
=
(
void
*
)
GetProcAddress
(
huser32
,
"EnumDisplayDevicesA"
);
...
...
@@ -1359,6 +1361,63 @@ static void test_CreateMultiProfileTransform( char *standardprofile, char *testp
}
}
static
void
test_TranslateBitmapBits
(
char
*
standardprofile
,
char
*
testprofile
)
{
PROFILE
profile
;
HPROFILE
handle
[
2
];
HTRANSFORM
transform
;
DWORD
intent
=
INTENT_PERCEPTUAL
;
BYTE
srcbits
[]
=
{
0x00
,
0x00
,
0xff
},
srcbits2
[]
=
{
0xcc
,
0x00
,
0x00
,
0xff
},
destbits
[
4
];
const
BYTE
expect_destbits
[]
=
{
0xff
,
0x00
,
0x00
,
0x00
};
const
BYTE
expect_destbits2
[]
=
{
0x00
,
0x00
,
0xff
,
0x00
};
const
BYTE
expect_destbits3
[]
=
{
0xcc
,
0x00
,
0x00
};
const
BYTE
expect_destbits4
[]
=
{
0x00
,
0x00
,
0xcc
};
BOOL
ret
;
if
(
!
standardprofile
)
return
;
profile
.
dwType
=
PROFILE_FILENAME
;
profile
.
pProfileData
=
standardprofile
;
profile
.
cbDataSize
=
strlen
(
standardprofile
);
handle
[
0
]
=
pOpenColorProfileA
(
&
profile
,
PROFILE_READ
,
1
,
OPEN_EXISTING
);
ok
(
handle
[
0
]
!=
NULL
,
"got %lu
\n
"
,
GetLastError
()
);
profile
.
dwType
=
PROFILE_FILENAME
;
profile
.
pProfileData
=
testprofile
;
profile
.
cbDataSize
=
strlen
(
testprofile
);
handle
[
1
]
=
pOpenColorProfileA
(
&
profile
,
PROFILE_READ
,
1
,
OPEN_EXISTING
);
ok
(
handle
[
1
]
!=
NULL
,
"got %lu
\n
"
,
GetLastError
()
);
transform
=
pCreateMultiProfileTransform
(
handle
,
2
,
&
intent
,
1
,
0
,
0
);
ok
(
transform
!=
NULL
,
"got %lu
\n
"
,
GetLastError
()
);
memset
(
destbits
,
0
,
sizeof
(
destbits
)
);
ret
=
pTranslateBitmapBits
(
transform
,
srcbits
,
BM_RGBTRIPLETS
,
1
,
1
,
3
,
destbits
,
BM_xBGRQUADS
,
4
,
NULL
,
0
);
ok
(
ret
,
"got %lu
\n
"
,
GetLastError
()
);
todo_wine
ok
(
!
memcmp
(
expect_destbits
,
destbits
,
sizeof
(
expect_destbits
)),
"unexpected destbits
\n
"
);
memset
(
destbits
,
0
,
sizeof
(
destbits
)
);
ret
=
pTranslateBitmapBits
(
transform
,
srcbits
,
BM_RGBTRIPLETS
,
1
,
1
,
3
,
destbits
,
BM_xRGBQUADS
,
4
,
NULL
,
0
);
ok
(
ret
,
"got %lu
\n
"
,
GetLastError
()
);
todo_wine
ok
(
!
memcmp
(
expect_destbits2
,
destbits
,
sizeof
(
expect_destbits2
)),
"unexpected destbits
\n
"
);
memset
(
destbits
,
0
,
sizeof
(
destbits
)
);
ret
=
pTranslateBitmapBits
(
transform
,
srcbits2
,
BM_xRGBQUADS
,
1
,
1
,
4
,
destbits
,
BM_RGBTRIPLETS
,
3
,
NULL
,
0
);
ok
(
ret
,
"got %lu
\n
"
,
GetLastError
()
);
todo_wine
ok
(
!
memcmp
(
expect_destbits3
,
destbits
,
sizeof
(
expect_destbits3
)),
"unexpected destbits
\n
"
);
memset
(
destbits
,
0
,
sizeof
(
destbits
)
);
ret
=
pTranslateBitmapBits
(
transform
,
srcbits2
,
BM_xRGBQUADS
,
1
,
1
,
4
,
destbits
,
BM_BGRTRIPLETS
,
3
,
NULL
,
0
);
ok
(
ret
,
"got %lu
\n
"
,
GetLastError
()
);
todo_wine
ok
(
!
memcmp
(
expect_destbits4
,
destbits
,
sizeof
(
expect_destbits4
)),
"unexpected destbits
\n
"
);
pDeleteColorTransform
(
transform
);
pCloseColorProfile
(
handle
[
0
]
);
pCloseColorProfile
(
handle
[
1
]
);
}
START_TEST
(
profile
)
{
UINT
len
;
...
...
@@ -1469,6 +1528,7 @@ START_TEST(profile)
test_AssociateColorProfileWithDeviceA
(
testprofile
);
test_CreateMultiProfileTransform
(
standardprofile
,
testprofile
);
test_TranslateBitmapBits
(
standardprofile
,
testprofile
);
if
(
testprofile
)
DeleteFileA
(
testprofile
);
FreeLibrary
(
huser32
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment