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
8d35fd8d
Commit
8d35fd8d
authored
Jan 21, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add tests for GetICMProfile and SetICMMode.
parent
20c1e503
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
149 additions
and
0 deletions
+149
-0
Makefile.in
dlls/gdi32/tests/Makefile.in
+1
-0
icm.c
dlls/gdi32/tests/icm.c
+148
-0
No files found.
dlls/gdi32/tests/Makefile.in
View file @
8d35fd8d
...
...
@@ -13,6 +13,7 @@ CTESTS = \
font.c
\
gdiobj.c
\
generated.c
\
icm.c
\
mapping.c
\
metafile.c
\
palette.c
\
...
...
dlls/gdi32/tests/icm.c
0 → 100644
View file @
8d35fd8d
/*
* Tests for ICM functions
*
* Copyright (C) 2005, 2008 Hans Leidekker
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/test.h"
static
const
WCHAR
displayW
[]
=
{
'D'
,
'I'
,
'S'
,
'P'
,
'L'
,
'A'
,
'Y'
,
0
};
static
void
test_GetICMProfileA
(
HDC
dc
)
{
BOOL
ret
;
DWORD
size
,
error
;
char
filename
[
MAX_PATH
];
ret
=
GetICMProfileA
(
NULL
,
NULL
,
NULL
);
ok
(
!
ret
,
"GetICMProfileA succeeded
\n
"
);
ret
=
GetICMProfileA
(
dc
,
NULL
,
NULL
);
ok
(
!
ret
,
"GetICMProfileA succeeded
\n
"
);
size
=
MAX_PATH
;
ret
=
GetICMProfileA
(
dc
,
&
size
,
NULL
);
ok
(
!
ret
,
"GetICMProfileA succeeded
\n
"
);
ret
=
GetICMProfileA
(
dc
,
NULL
,
filename
);
ok
(
!
ret
,
"GetICMProfileA succeeded
\n
"
);
size
=
MAX_PATH
;
ret
=
GetICMProfileA
(
NULL
,
&
size
,
filename
);
ok
(
!
ret
,
"GetICMProfileA succeeded
\n
"
);
size
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
GetICMProfileA
(
dc
,
&
size
,
filename
);
error
=
GetLastError
();
ok
(
!
ret
,
"GetICMProfileA succeeded
\n
"
);
ok
(
size
,
"expected size > 0
\n
"
);
ok
(
error
==
ERROR_INSUFFICIENT_BUFFER
,
"got %d, expected ERROR_INSUFFICIENT_BUFFER
\n
"
,
error
);
size
=
MAX_PATH
;
ret
=
GetICMProfileA
(
dc
,
&
size
,
filename
);
ok
(
ret
,
"GetICMProfileA failed %d
\n
"
,
GetLastError
()
);
trace
(
"%s
\n
"
,
filename
);
}
static
void
test_GetICMProfileW
(
HDC
dc
)
{
BOOL
ret
;
DWORD
size
,
error
;
WCHAR
filename
[
MAX_PATH
];
ret
=
GetICMProfileW
(
NULL
,
NULL
,
NULL
);
ok
(
!
ret
,
"GetICMProfileW succeeded
\n
"
);
ret
=
GetICMProfileW
(
dc
,
NULL
,
NULL
);
ok
(
!
ret
,
"GetICMProfileW succeeded
\n
"
);
size
=
MAX_PATH
;
ret
=
GetICMProfileW
(
dc
,
&
size
,
NULL
);
ok
(
ret
,
"GetICMProfileW failed %d
\n
"
,
GetLastError
()
);
ret
=
GetICMProfileW
(
dc
,
NULL
,
filename
);
ok
(
!
ret
,
"GetICMProfileW succeeded
\n
"
);
size
=
MAX_PATH
;
ret
=
GetICMProfileW
(
NULL
,
&
size
,
filename
);
ok
(
!
ret
,
"GetICMProfileW succeeded
\n
"
);
size
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
GetICMProfileW
(
dc
,
&
size
,
filename
);
error
=
GetLastError
();
ok
(
!
ret
,
"GetICMProfileW succeeded
\n
"
);
ok
(
size
,
"expected size > 0
\n
"
);
ok
(
error
==
ERROR_INSUFFICIENT_BUFFER
,
"got %d, expected ERROR_INSUFFICIENT_BUFFER
\n
"
,
error
);
size
=
MAX_PATH
;
ret
=
GetICMProfileW
(
dc
,
&
size
,
filename
);
ok
(
ret
,
"GetICMProfileW failed %d
\n
"
,
GetLastError
()
);
}
static
void
test_SetICMMode
(
HDC
dc
)
{
INT
ret
,
knob
,
save
;
ret
=
SetICMMode
(
NULL
,
0
);
ok
(
!
ret
,
"SetICMMode succeeded (%d)
\n
"
,
GetLastError
()
);
ret
=
SetICMMode
(
dc
,
-
1
);
ok
(
!
ret
,
"SetICMMode succeeded (%d)
\n
"
,
GetLastError
()
);
save
=
SetICMMode
(
dc
,
ICM_QUERY
);
ok
(
save
==
ICM_ON
||
save
==
ICM_OFF
,
"SetICMMode failed (%d)
\n
"
,
GetLastError
()
);
if
(
save
==
ICM_ON
)
knob
=
ICM_OFF
;
else
knob
=
ICM_ON
;
ret
=
SetICMMode
(
dc
,
knob
);
todo_wine
ok
(
ret
,
"SetICMMode failed (%d)
\n
"
,
GetLastError
()
);
ret
=
SetICMMode
(
dc
,
ICM_QUERY
);
todo_wine
ok
(
ret
==
knob
,
"SetICMMode failed (%d)
\n
"
,
GetLastError
()
);
ret
=
SetICMMode
(
dc
,
save
);
ok
(
ret
,
"SetICMMode failed (%d)
\n
"
,
GetLastError
()
);
dc
=
CreateDCW
(
displayW
,
NULL
,
NULL
,
NULL
);
ok
(
dc
!=
NULL
,
"CreateDCW failed (%d)
\n
"
,
GetLastError
()
);
ret
=
SetICMMode
(
dc
,
ICM_QUERY
);
ok
(
ret
==
ICM_OFF
,
"SetICMMode failed (%d)
\n
"
,
GetLastError
()
);
DeleteDC
(
dc
);
}
START_TEST
(
icm
)
{
HDC
dc
=
GetDC
(
NULL
);
test_GetICMProfileA
(
dc
);
test_GetICMProfileW
(
dc
);
test_SetICMMode
(
dc
);
ReleaseDC
(
NULL
,
dc
);
}
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