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
03b2e737
Commit
03b2e737
authored
Jan 07, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Add a getdc test with a custom pitch.
parent
b91973da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
3 deletions
+117
-3
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+39
-1
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+39
-1
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+39
-1
No files found.
dlls/ddraw/tests/ddraw2.c
View file @
03b2e737
/*
/*
* Copyright 2011-2012 Henri Verbeet for CodeWeavers
* Copyright 2011-2012 Henri Verbeet for CodeWeavers
* Copyright 2012-201
3
Stefan Dösinger for CodeWeavers
* Copyright 2012-201
4
Stefan Dösinger for CodeWeavers
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -4878,6 +4878,7 @@ static void test_user_memory_getdc(void)
...
@@ -4878,6 +4878,7 @@ static void test_user_memory_getdc(void)
DWORD
data
[
16
][
16
];
DWORD
data
[
16
][
16
];
ULONG
ref
;
ULONG
ref
;
HDC
dc
;
HDC
dc
;
unsigned
int
x
,
y
;
if
(
!
(
ddraw
=
create_ddraw
()))
if
(
!
(
ddraw
=
create_ddraw
()))
{
{
...
@@ -4926,6 +4927,43 @@ static void test_user_memory_getdc(void)
...
@@ -4926,6 +4927,43 @@ static void test_user_memory_getdc(void)
ok
(
data
[
0
][
0
]
==
0xffffffff
,
"Expected color 0xffffffff, got %#x.
\n
"
,
data
[
0
][
0
]);
ok
(
data
[
0
][
0
]
==
0xffffffff
,
"Expected color 0xffffffff, got %#x.
\n
"
,
data
[
0
][
0
]);
ok
(
data
[
15
][
15
]
==
0x00000000
,
"Expected color 0x00000000, got %#x.
\n
"
,
data
[
15
][
15
]);
ok
(
data
[
15
][
15
]
==
0x00000000
,
"Expected color 0x00000000, got %#x.
\n
"
,
data
[
15
][
15
]);
ddsd
.
dwFlags
=
DDSD_LPSURFACE
|
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PITCH
;
ddsd
.
lpSurface
=
data
;
ddsd
.
dwWidth
=
4
;
ddsd
.
dwHeight
=
8
;
U1
(
ddsd
).
lPitch
=
sizeof
(
*
data
);
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set surface desc, hr %#x.
\n
"
,
hr
);
memset
(
data
,
0xaa
,
sizeof
(
data
));
hr
=
IDirectDrawSurface3_GetDC
(
surface3
,
&
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get DC, hr %#x.
\n
"
,
hr
);
BitBlt
(
dc
,
0
,
0
,
4
,
8
,
NULL
,
0
,
0
,
BLACKNESS
);
BitBlt
(
dc
,
1
,
1
,
2
,
2
,
NULL
,
0
,
0
,
WHITENESS
);
hr
=
IDirectDrawSurface3_ReleaseDC
(
surface3
,
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to release DC, hr %#x.
\n
"
,
hr
);
for
(
y
=
0
;
y
<
4
;
y
++
)
{
for
(
x
=
0
;
x
<
4
;
x
++
)
{
if
((
x
==
1
||
x
==
2
)
&&
(
y
==
1
||
y
==
2
))
ok
(
data
[
y
][
x
]
==
0xffffffff
,
"Expected color 0xffffffff on position %ux%u, got %#x.
\n
"
,
x
,
y
,
data
[
y
][
x
]);
else
ok
(
data
[
y
][
x
]
==
0x00000000
,
"Expected color 0xaaaaaaaa on position %ux%u, got %#x.
\n
"
,
x
,
y
,
data
[
y
][
x
]);
}
}
ok
(
data
[
0
][
5
]
==
0xaaaaaaaa
,
"Expected color 0xaaaaaaaa on position 5x0, got %#x.
\n
"
,
data
[
0
][
5
]);
ok
(
data
[
7
][
3
]
==
0x00000000
,
"Expected color 0x00000000 on position 3x7, got %#x.
\n
"
,
data
[
7
][
3
]);
ok
(
data
[
7
][
4
]
==
0xaaaaaaaa
,
"Expected color 0xaaaaaaaa on position 4x7, got %#x.
\n
"
,
data
[
7
][
4
]);
ok
(
data
[
8
][
0
]
==
0xaaaaaaaa
,
"Expected color 0xaaaaaaaa on position 0x8, got %#x.
\n
"
,
data
[
8
][
0
]);
IDirectDrawSurface3_Release
(
surface3
);
IDirectDrawSurface3_Release
(
surface3
);
ref
=
IDirectDraw2_Release
(
ddraw
);
ref
=
IDirectDraw2_Release
(
ddraw
);
ok
(
ref
==
0
,
"Ddraw object not properly released, refcount %u.
\n
"
,
ref
);
ok
(
ref
==
0
,
"Ddraw object not properly released, refcount %u.
\n
"
,
ref
);
...
...
dlls/ddraw/tests/ddraw4.c
View file @
03b2e737
/*
/*
* Copyright 2011-2012 Henri Verbeet for CodeWeavers
* Copyright 2011-2012 Henri Verbeet for CodeWeavers
* Copyright 2012-201
3
Stefan Dösinger for CodeWeavers
* Copyright 2012-201
4
Stefan Dösinger for CodeWeavers
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -5479,6 +5479,7 @@ static void test_user_memory_getdc(void)
...
@@ -5479,6 +5479,7 @@ static void test_user_memory_getdc(void)
DWORD
data
[
16
][
16
];
DWORD
data
[
16
][
16
];
ULONG
ref
;
ULONG
ref
;
HDC
dc
;
HDC
dc
;
unsigned
int
x
,
y
;
if
(
!
(
ddraw
=
create_ddraw
()))
if
(
!
(
ddraw
=
create_ddraw
()))
{
{
...
@@ -5523,6 +5524,43 @@ static void test_user_memory_getdc(void)
...
@@ -5523,6 +5524,43 @@ static void test_user_memory_getdc(void)
ok
(
data
[
0
][
0
]
==
0xffffffff
,
"Expected color 0xffffffff, got %#x.
\n
"
,
data
[
0
][
0
]);
ok
(
data
[
0
][
0
]
==
0xffffffff
,
"Expected color 0xffffffff, got %#x.
\n
"
,
data
[
0
][
0
]);
ok
(
data
[
15
][
15
]
==
0x00000000
,
"Expected color 0x00000000, got %#x.
\n
"
,
data
[
15
][
15
]);
ok
(
data
[
15
][
15
]
==
0x00000000
,
"Expected color 0x00000000, got %#x.
\n
"
,
data
[
15
][
15
]);
ddsd
.
dwFlags
=
DDSD_LPSURFACE
|
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PITCH
;
ddsd
.
lpSurface
=
data
;
ddsd
.
dwWidth
=
4
;
ddsd
.
dwHeight
=
8
;
U1
(
ddsd
).
lPitch
=
sizeof
(
*
data
);
hr
=
IDirectDrawSurface4_SetSurfaceDesc
(
surface
,
&
ddsd
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set surface desc, hr %#x.
\n
"
,
hr
);
memset
(
data
,
0xaa
,
sizeof
(
data
));
hr
=
IDirectDrawSurface4_GetDC
(
surface
,
&
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get DC, hr %#x.
\n
"
,
hr
);
BitBlt
(
dc
,
0
,
0
,
4
,
8
,
NULL
,
0
,
0
,
BLACKNESS
);
BitBlt
(
dc
,
1
,
1
,
2
,
2
,
NULL
,
0
,
0
,
WHITENESS
);
hr
=
IDirectDrawSurface4_ReleaseDC
(
surface
,
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to release DC, hr %#x.
\n
"
,
hr
);
for
(
y
=
0
;
y
<
4
;
y
++
)
{
for
(
x
=
0
;
x
<
4
;
x
++
)
{
if
((
x
==
1
||
x
==
2
)
&&
(
y
==
1
||
y
==
2
))
ok
(
data
[
y
][
x
]
==
0xffffffff
,
"Expected color 0xffffffff on position %ux%u, got %#x.
\n
"
,
x
,
y
,
data
[
y
][
x
]);
else
ok
(
data
[
y
][
x
]
==
0x00000000
,
"Expected color 0x00000000 on position %ux%u, got %#x.
\n
"
,
x
,
y
,
data
[
y
][
x
]);
}
}
ok
(
data
[
0
][
5
]
==
0xaaaaaaaa
,
"Expected color 0xaaaaaaaa on position 5x0, got %#x.
\n
"
,
data
[
0
][
5
]);
ok
(
data
[
7
][
3
]
==
0x00000000
,
"Expected color 0x00000000 on position 3x7, got %#x.
\n
"
,
data
[
7
][
3
]);
ok
(
data
[
7
][
4
]
==
0xaaaaaaaa
,
"Expected color 0xaaaaaaaa on position 4x7, got %#x.
\n
"
,
data
[
7
][
4
]);
ok
(
data
[
8
][
0
]
==
0xaaaaaaaa
,
"Expected color 0xaaaaaaaa on position 0x8, got %#x.
\n
"
,
data
[
8
][
0
]);
IDirectDrawSurface4_Release
(
surface
);
IDirectDrawSurface4_Release
(
surface
);
ref
=
IDirectDraw4_Release
(
ddraw
);
ref
=
IDirectDraw4_Release
(
ddraw
);
ok
(
ref
==
0
,
"Ddraw object not properly released, refcount %u.
\n
"
,
ref
);
ok
(
ref
==
0
,
"Ddraw object not properly released, refcount %u.
\n
"
,
ref
);
...
...
dlls/ddraw/tests/ddraw7.c
View file @
03b2e737
/*
/*
* Copyright 2006, 2012-201
3
Stefan Dösinger for CodeWeavers
* Copyright 2006, 2012-201
4
Stefan Dösinger for CodeWeavers
* Copyright 2011 Henri Verbeet for CodeWeavers
* Copyright 2011 Henri Verbeet for CodeWeavers
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
...
@@ -5373,6 +5373,7 @@ static void test_user_memory_getdc(void)
...
@@ -5373,6 +5373,7 @@ static void test_user_memory_getdc(void)
DWORD
data
[
16
][
16
];
DWORD
data
[
16
][
16
];
ULONG
ref
;
ULONG
ref
;
HDC
dc
;
HDC
dc
;
unsigned
int
x
,
y
;
if
(
!
(
ddraw
=
create_ddraw
()))
if
(
!
(
ddraw
=
create_ddraw
()))
{
{
...
@@ -5417,6 +5418,43 @@ static void test_user_memory_getdc(void)
...
@@ -5417,6 +5418,43 @@ static void test_user_memory_getdc(void)
ok
(
data
[
0
][
0
]
==
0xffffffff
,
"Expected color 0xffffffff, got %#x.
\n
"
,
data
[
0
][
0
]);
ok
(
data
[
0
][
0
]
==
0xffffffff
,
"Expected color 0xffffffff, got %#x.
\n
"
,
data
[
0
][
0
]);
ok
(
data
[
15
][
15
]
==
0x00000000
,
"Expected color 0x00000000, got %#x.
\n
"
,
data
[
15
][
15
]);
ok
(
data
[
15
][
15
]
==
0x00000000
,
"Expected color 0x00000000, got %#x.
\n
"
,
data
[
15
][
15
]);
ddsd
.
dwFlags
=
DDSD_LPSURFACE
|
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PITCH
;
ddsd
.
lpSurface
=
data
;
ddsd
.
dwWidth
=
4
;
ddsd
.
dwHeight
=
8
;
U1
(
ddsd
).
lPitch
=
sizeof
(
*
data
);
hr
=
IDirectDrawSurface7_SetSurfaceDesc
(
surface
,
&
ddsd
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set surface desc, hr %#x.
\n
"
,
hr
);
memset
(
data
,
0xaa
,
sizeof
(
data
));
hr
=
IDirectDrawSurface7_GetDC
(
surface
,
&
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get DC, hr %#x.
\n
"
,
hr
);
BitBlt
(
dc
,
0
,
0
,
4
,
8
,
NULL
,
0
,
0
,
BLACKNESS
);
BitBlt
(
dc
,
1
,
1
,
2
,
2
,
NULL
,
0
,
0
,
WHITENESS
);
hr
=
IDirectDrawSurface7_ReleaseDC
(
surface
,
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to release DC, hr %#x.
\n
"
,
hr
);
for
(
y
=
0
;
y
<
4
;
y
++
)
{
for
(
x
=
0
;
x
<
4
;
x
++
)
{
if
((
x
==
1
||
x
==
2
)
&&
(
y
==
1
||
y
==
2
))
ok
(
data
[
y
][
x
]
==
0xffffffff
,
"Expected color 0xffffffff on position %ux%u, got %#x.
\n
"
,
x
,
y
,
data
[
y
][
x
]);
else
ok
(
data
[
y
][
x
]
==
0x00000000
,
"Expected color 0x00000000 on position %ux%u, got %#x.
\n
"
,
x
,
y
,
data
[
y
][
x
]);
}
}
ok
(
data
[
0
][
5
]
==
0xaaaaaaaa
,
"Expected color 0xaaaaaaaa on position 5x0, got %#x.
\n
"
,
data
[
0
][
5
]);
ok
(
data
[
7
][
3
]
==
0x00000000
,
"Expected color 0x00000000 on position 3x7, got %#x.
\n
"
,
data
[
7
][
3
]);
ok
(
data
[
7
][
4
]
==
0xaaaaaaaa
,
"Expected color 0xaaaaaaaa on position 4x7, got %#x.
\n
"
,
data
[
7
][
4
]);
ok
(
data
[
8
][
0
]
==
0xaaaaaaaa
,
"Expected color 0xaaaaaaaa on position 0x8, got %#x.
\n
"
,
data
[
8
][
0
]);
IDirectDrawSurface7_Release
(
surface
);
IDirectDrawSurface7_Release
(
surface
);
ref
=
IDirectDraw7_Release
(
ddraw
);
ref
=
IDirectDraw7_Release
(
ddraw
);
ok
(
ref
==
0
,
"Ddraw object not properly released, refcount %u.
\n
"
,
ref
);
ok
(
ref
==
0
,
"Ddraw object not properly released, refcount %u.
\n
"
,
ref
);
...
...
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