Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
28df3990
Commit
28df3990
authored
Apr 21, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Add EMF palette tests.
parent
f45baaa1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
0 deletions
+78
-0
metafile.c
dlls/gdi32/tests/metafile.c
+78
-0
No files found.
dlls/gdi32/tests/metafile.c
View file @
28df3990
...
...
@@ -4802,6 +4802,83 @@ static void test_mf_palette(void)
ok
(
ret
,
"DeleteMetaFile(%p) error %ld
\n
"
,
hmf
,
GetLastError
());
}
static
void
test_emf_palette
(
void
)
{
char
logpalettebuf
[
sizeof
(
LOGPALETTE
)
+
sizeof
(
logpalettedata
)];
LOGPALETTE
*
logpalette
=
(
PLOGPALETTE
)
logpalettebuf
;
HPALETTE
hpal
,
old_pal
,
def_pal
;
HENHMETAFILE
emf
;
HDC
hdc
;
BOOL
ret
;
static
const
unsigned
char
palette_bits
[]
=
{
0x01
,
0x00
,
0x00
,
0x00
,
0x6c
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xe6
,
0xff
,
0xff
,
0xff
,
0xe6
,
0xff
,
0xff
,
0xff
,
0x20
,
0x45
,
0x4d
,
0x46
,
0x00
,
0x00
,
0x01
,
0x00
,
0xf0
,
0x00
,
0x00
,
0x00
,
0x06
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x08
,
0x00
,
0x00
,
0x00
,
0x80
,
0x07
,
0x00
,
0x00
,
0xcd
,
0x03
,
0x00
,
0x00
,
0xfc
,
0x01
,
0x00
,
0x00
,
0x01
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x60
,
0xc0
,
0x07
,
0x00
,
0x9f
,
0xed
,
0x03
,
0x00
,
0x31
,
0x00
,
0x00
,
0x00
,
0x30
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x03
,
0x08
,
0x00
,
0x10
,
0x20
,
0x30
,
0x00
,
0x20
,
0x30
,
0x40
,
0x00
,
0x30
,
0x40
,
0x50
,
0x00
,
0x40
,
0x50
,
0x60
,
0x00
,
0x50
,
0x60
,
0x70
,
0x00
,
0x60
,
0x70
,
0x80
,
0x00
,
0x70
,
0x80
,
0x90
,
0x00
,
0x80
,
0x90
,
0xa0
,
0x00
,
0x30
,
0x00
,
0x00
,
0x00
,
0x0c
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x00
,
0x00
,
0x34
,
0x00
,
0x00
,
0x00
,
0x08
,
0x00
,
0x00
,
0x00
,
0x30
,
0x00
,
0x00
,
0x00
,
0x0c
,
0x00
,
0x00
,
0x00
,
0x0f
,
0x00
,
0x00
,
0x80
,
0x0e
,
0x00
,
0x00
,
0x00
,
0x34
,
0x00
,
0x00
,
0x00
,
0x08
,
0x00
,
0x00
,
0x00
,
0x10
,
0x00
,
0x00
,
0x00
,
0x10
,
0x20
,
0x30
,
0x00
,
0x20
,
0x30
,
0x40
,
0x00
,
0x30
,
0x40
,
0x50
,
0x00
,
0x40
,
0x50
,
0x60
,
0x00
,
0x50
,
0x60
,
0x70
,
0x00
,
0x60
,
0x70
,
0x80
,
0x00
,
0x70
,
0x80
,
0x90
,
0x00
,
0x80
,
0x90
,
0xa0
,
0x00
,
0x34
,
0x00
,
0x00
,
0x00
};
hdc
=
CreateEnhMetaFileA
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hdc
!=
0
,
"CreateMetaFileA error %ld
\n
"
,
GetLastError
());
/* Initialize the logical palette with a few colours */
logpalette
->
palVersion
=
0x300
;
logpalette
->
palNumEntries
=
ARRAY_SIZE
(
logpalettedata
);
memcpy
(
logpalette
->
palPalEntry
,
logpalettedata
,
sizeof
(
logpalettedata
));
hpal
=
CreatePalette
(
logpalette
);
old_pal
=
SelectPalette
(
hdc
,
hpal
,
FALSE
);
def_pal
=
GetStockObject
(
DEFAULT_PALETTE
);
ok
(
old_pal
==
def_pal
,
"old_pal=%p, expected %p
\n
"
,
old_pal
,
def_pal
);
ret
=
RealizePalette
(
hdc
);
ok
(
!
ret
,
"RealizePalette returned %d
\n
"
,
ret
);
old_pal
=
SelectPalette
(
hdc
,
GetStockObject
(
DEFAULT_PALETTE
),
FALSE
);
ok
(
old_pal
==
hpal
,
"old_pal=%p, expected %p
\n
"
,
old_pal
,
hpal
);
ret
=
RealizePalette
(
hdc
);
ok
(
!
ret
,
"RealizePalette returned %d
\n
"
,
ret
);
emf
=
CloseEnhMetaFile
(
hdc
);
ok
(
emf
!=
0
,
"CloseEnhMetaFile error %ld
\n
"
,
GetLastError
());
if
(
compare_emf_bits
(
emf
,
palette_bits
,
sizeof
(
palette_bits
),
"emf_palette"
,
FALSE
))
{
dump_emf_bits
(
emf
,
"emf_palette"
);
dump_emf_records
(
emf
,
"emf_palette"
);
}
ret
=
DeleteEnhMetaFile
(
emf
);
ok
(
ret
,
"DeleteMetaFile error %ld
\n
"
,
GetLastError
());
}
static
void
test_mf_blit
(
void
)
{
BITMAPINFO
bmi
=
{{
sizeof
(
bmi
)
}};
...
...
@@ -10670,6 +10747,7 @@ START_TEST(metafile)
test_emf_mask_blit
();
test_emf_StretchDIBits
();
test_emf_SetDIBitsToDevice
();
test_emf_palette
();
/* For win-format metafiles (mfdrv) */
test_mf_SaveDC
();
...
...
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