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
374db924
Commit
374db924
authored
Mar 01, 2011
by
John Edmonds
Committed by
Alexandre Julliard
Mar 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Updated tests for top-down destination bitmaps.
parent
5861deae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
23 deletions
+41
-23
bitmap.c
dlls/gdi32/tests/bitmap.c
+41
-23
No files found.
dlls/gdi32/tests/bitmap.c
View file @
374db924
...
...
@@ -2956,7 +2956,7 @@ static void test_32bit_bitmap_blt(void)
}
/*
* Used by test_GetDIBits_
single_pixel_destinatio
n to create the bitmap to test against.
* Used by test_GetDIBits_
top_dow
n to create the bitmap to test against.
*/
static
void
setup_picture
(
char
*
picture
,
int
bpp
)
{
...
...
@@ -2980,12 +2980,12 @@ static void setup_picture(char *picture, int bpp)
}
}
static
void
test_GetDIBits_
single_pixel_destinatio
n
(
int
bpp
)
static
void
test_GetDIBits_
top_dow
n
(
int
bpp
)
{
BITMAPINFO
bi
;
HBITMAP
bmptb
,
bmpbt
;
HDC
hdc
;
int
pi
xelOut
;
int
pi
ctureOut
[
4
]
;
int
*
picture
;
int
statusCode
;
...
...
@@ -3015,36 +3015,54 @@ static void test_GetDIBits_single_pixel_destination(int bpp)
bi
.
bmiHeader
.
biWidth
=
1
;
bi
.
bmiHeader
.
biHeight
=
2
;
statusCode
=
GetDIBits
(
hdc
,
bmpbt
,
0
,
1
,
&
pixel
Out
,
&
bi
,
DIB_RGB_COLORS
);
statusCode
=
GetDIBits
(
hdc
,
bmpbt
,
0
,
1
,
picture
Out
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
/*Check the first byte of the pixel.*/
ok
((
char
)
pi
xelOut
==
0
,
"Bottom-up -> bottom-up: first pixel should be 0 but was %d.
\n
"
,
(
char
)
pixelOut
);
statusCode
=
GetDIBits
(
hdc
,
bmptb
,
0
,
1
,
&
pixel
Out
,
&
bi
,
DIB_RGB_COLORS
);
ok
((
char
)
pi
ctureOut
[
0
]
==
0
,
"Bottom-up -> bottom-up: first pixel should be 0 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]
);
statusCode
=
GetDIBits
(
hdc
,
bmptb
,
0
,
1
,
picture
Out
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
ok
((
char
)
pi
xelOut
==
2
,
"Top-down -> bottom-up: first pixel should be 2 but was %d.
\n
"
,
(
char
)
pixelOut
);
ok
((
char
)
pi
ctureOut
[
0
]
==
2
,
"Top-down -> bottom-up: first pixel should be 2 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]
);
/*Check second scanline.*/
statusCode
=
GetDIBits
(
hdc
,
bmptb
,
1
,
1
,
&
pixel
Out
,
&
bi
,
DIB_RGB_COLORS
);
statusCode
=
GetDIBits
(
hdc
,
bmptb
,
1
,
1
,
picture
Out
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
ok
((
char
)
pi
xelOut
==
0
,
"Top-down -> bottom-up: first pixel should be 0 but was %d.
\n
"
,
(
char
)
pixelOut
);
statusCode
=
GetDIBits
(
hdc
,
bmpbt
,
1
,
1
,
&
pixel
Out
,
&
bi
,
DIB_RGB_COLORS
);
ok
((
char
)
pi
ctureOut
[
0
]
==
0
,
"Top-down -> bottom-up: first pixel should be 0 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]
);
statusCode
=
GetDIBits
(
hdc
,
bmpbt
,
1
,
1
,
picture
Out
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
ok
((
char
)
pixelOut
==
2
,
"Top-down -> bottom-up: first pixel should be 2 but was %d.
\n
"
,
(
char
)
pixelOut
);
ok
((
char
)
pictureOut
[
0
]
==
2
,
"Bottom-up -> bottom-up: first pixel should be 2 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
/*Check both scanlines.*/
statusCode
=
GetDIBits
(
hdc
,
bmptb
,
0
,
2
,
pictureOut
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
ok
((
char
)
pictureOut
[
0
]
==
2
,
"Top-down -> bottom-up: first scanline should be 2 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
ok
((
char
)
pictureOut
[
1
]
==
0
,
"Top-down -> bottom-up: second scanline should be 0 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
statusCode
=
GetDIBits
(
hdc
,
bmpbt
,
0
,
2
,
pictureOut
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
ok
((
char
)
pictureOut
[
0
]
==
0
,
"Bottom up -> bottom-up: first scanline should be 0 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
ok
((
char
)
pictureOut
[
1
]
==
2
,
"Bottom up -> bottom-up: second scanline should be 2 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
/*Make destination bitmap top-down.
This should be ignored by GetDIBits.
*/
/*Make destination bitmap top-down.*/
bi
.
bmiHeader
.
biHeight
=
-
2
;
statusCode
=
GetDIBits
(
hdc
,
bmpbt
,
0
,
1
,
&
pixel
Out
,
&
bi
,
DIB_RGB_COLORS
);
statusCode
=
GetDIBits
(
hdc
,
bmpbt
,
0
,
1
,
picture
Out
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
ok
((
char
)
pi
xelOut
==
0
,
"Bottom-up -> top-down: first pixel should be 0 but was %d.
\n
"
,
(
char
)
pixelOut
);
statusCode
=
GetDIBits
(
hdc
,
bmptb
,
0
,
1
,
&
pixel
Out
,
&
bi
,
DIB_RGB_COLORS
);
ok
((
char
)
pi
ctureOut
[
0
]
==
0
,
"Bottom-up -> top-down: first pixel should be 0 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]
);
statusCode
=
GetDIBits
(
hdc
,
bmptb
,
0
,
1
,
picture
Out
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
ok
((
char
)
pi
xelOut
==
2
,
"Top-down -> top-down: first pixel should be 2 but was %d.
\n
"
,
(
char
)
pixelOut
);
ok
((
char
)
pi
ctureOut
[
0
]
==
2
,
"Top-down -> top-down: first pixel should be 2 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]
);
/*Check second scanline.*/
statusCode
=
GetDIBits
(
hdc
,
bmptb
,
1
,
1
,
&
pixelOut
,
&
bi
,
DIB_RGB_COLORS
);
statusCode
=
GetDIBits
(
hdc
,
bmptb
,
1
,
1
,
pictureOut
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
ok
((
char
)
pictureOut
[
0
]
==
0
,
"Top-down -> bottom-up: first pixel should be 0 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
statusCode
=
GetDIBits
(
hdc
,
bmpbt
,
1
,
1
,
pictureOut
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
ok
((
char
)
pictureOut
[
0
]
==
2
,
"Top-down -> bottom-up: first pixel should be 2 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
/*Check both scanlines.*/
statusCode
=
GetDIBits
(
hdc
,
bmptb
,
0
,
2
,
pictureOut
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
ok
((
char
)
pixelOut
==
0
,
"Top-down -> bottom-up: first pixel should be 0 but was %d.
\n
"
,
(
char
)
pixelOut
);
statusCode
=
GetDIBits
(
hdc
,
bmpbt
,
1
,
1
,
&
pixelOut
,
&
bi
,
DIB_RGB_COLORS
);
todo_wine
ok
((
char
)
pictureOut
[
0
]
==
0
,
"Top-down -> top-down: first scanline should be 0 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
todo_wine
ok
((
char
)
pictureOut
[
1
]
==
2
,
"Top-down -> top-down: second scanline should be 2 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
statusCode
=
GetDIBits
(
hdc
,
bmpbt
,
0
,
2
,
pictureOut
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
ok
((
char
)
pixelOut
==
2
,
"Top-down -> bottom-up: first pixel should be 2 but was %d.
\n
"
,
(
char
)
pixelOut
);
todo_wine
ok
((
char
)
pictureOut
[
0
]
==
2
,
"Bottom up -> top-down: first scanline should be 2 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
todo_wine
ok
((
char
)
pictureOut
[
1
]
==
0
,
"Bottom up -> top-down: second scanline should be 0 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
DeleteObject
(
bmpbt
);
DeleteObject
(
bmptb
);
...
...
@@ -3079,7 +3097,7 @@ START_TEST(bitmap)
test_bitmapinfoheadersize
();
test_get16dibits
();
test_clipping
();
test_GetDIBits_
single_pixel_destinatio
n
(
16
);
test_GetDIBits_
single_pixel_destinatio
n
(
24
);
test_GetDIBits_
single_pixel_destinatio
n
(
32
);
test_GetDIBits_
top_dow
n
(
16
);
test_GetDIBits_
top_dow
n
(
24
);
test_GetDIBits_
top_dow
n
(
32
);
}
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