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
0ada9178
Commit
0ada9178
authored
Dec 05, 2007
by
Paul Vriens
Committed by
Alexandre Julliard
Dec 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Make tests run on Win98 again.
parent
07cb7c66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
12 deletions
+33
-12
console.c
dlls/kernel32/tests/console.c
+33
-12
No files found.
dlls/kernel32/tests/console.c
View file @
0ada9178
...
...
@@ -23,10 +23,8 @@
#include <windows.h>
#include <stdio.h>
BOOL
WINAPI
GetConsoleInputExeNameA
(
DWORD
,
LPSTR
);
BOOL
WINAPI
GetConsoleInputExeNameW
(
DWORD
,
LPWSTR
);
BOOL
WINAPI
SetConsoleInputExeNameA
(
LPCSTR
);
BOOL
WINAPI
SetConsoleInputExeNameW
(
LPCWSTR
);
static
BOOL
(
WINAPI
*
pGetConsoleInputExeNameA
)(
DWORD
,
LPSTR
);
static
BOOL
(
WINAPI
*
pSetConsoleInputExeNameA
)(
LPCSTR
);
/* DEFAULT_ATTRIB is used for all initial filling of the console.
* all modifications are made with TEST_ATTRIB so that we could check
...
...
@@ -55,6 +53,21 @@ BOOL WINAPI SetConsoleInputExeNameW(LPCWSTR);
ok(expect, "At (%d,%d): expecting attr %04x got %04x\n", (c).X, (c).Y, (attr), __attr); \
} while (0)
static
void
init_function_pointers
(
void
)
{
HMODULE
hKernel32
;
#define KERNEL32_GET_PROC(func) \
p##func = (void *)GetProcAddress(hKernel32, #func); \
if(!p##func) trace("GetProcAddress(hKernel32, '%s') failed\n", #func);
hKernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
KERNEL32_GET_PROC
(
GetConsoleInputExeNameA
);
KERNEL32_GET_PROC
(
SetConsoleInputExeNameA
);
#undef KERNEL32_GET_PROC
}
/* FIXME: this could be optimized on a speed point of view */
static
void
resetContent
(
HANDLE
hCon
,
COORD
sbSize
,
BOOL
content
)
{
...
...
@@ -759,13 +772,13 @@ static void test_GetSetConsoleInputExeName(void)
static
char
input_exe
[
MAX_PATH
]
=
"winetest.exe"
;
SetLastError
(
0xdeadbeef
);
ret
=
GetConsoleInputExeNameA
(
0
,
NULL
);
ret
=
p
GetConsoleInputExeNameA
(
0
,
NULL
);
error
=
GetLastError
();
ok
(
ret
,
"GetConsoleInputExeNameA failed
\n
"
);
ok
(
error
==
ERROR_BUFFER_OVERFLOW
,
"got %u expected ERROR_BUFFER_OVERFLOW
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
GetConsoleInputExeNameA
(
0
,
buffer
);
ret
=
p
GetConsoleInputExeNameA
(
0
,
buffer
);
error
=
GetLastError
();
ok
(
ret
,
"GetConsoleInputExeNameA failed
\n
"
);
ok
(
error
==
ERROR_BUFFER_OVERFLOW
,
"got %u expected ERROR_BUFFER_OVERFLOW
\n
"
,
error
);
...
...
@@ -773,26 +786,26 @@ static void test_GetSetConsoleInputExeName(void)
GetModuleFileNameA
(
GetModuleHandle
(
NULL
),
module
,
sizeof
(
module
));
p
=
strrchr
(
module
,
'\\'
)
+
1
;
ret
=
GetConsoleInputExeNameA
(
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
]),
buffer
);
ret
=
p
GetConsoleInputExeNameA
(
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
]),
buffer
);
ok
(
ret
,
"GetConsoleInputExeNameA failed
\n
"
);
todo_wine
ok
(
!
lstrcmpA
(
buffer
,
p
),
"got %s expected %s
\n
"
,
buffer
,
p
);
SetLastError
(
0xdeadbeef
);
ret
=
SetConsoleInputExeNameA
(
NULL
);
ret
=
p
SetConsoleInputExeNameA
(
NULL
);
error
=
GetLastError
();
ok
(
!
ret
,
"SetConsoleInputExeNameA failed
\n
"
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u expected ERROR_INVALID_PARAMETER
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
SetConsoleInputExeNameA
(
""
);
ret
=
p
SetConsoleInputExeNameA
(
""
);
error
=
GetLastError
();
ok
(
!
ret
,
"SetConsoleInputExeNameA failed
\n
"
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u expected ERROR_INVALID_PARAMETER
\n
"
,
error
);
ret
=
SetConsoleInputExeNameA
(
input_exe
);
ret
=
p
SetConsoleInputExeNameA
(
input_exe
);
ok
(
ret
,
"SetConsoleInputExeNameA failed
\n
"
);
ret
=
GetConsoleInputExeNameA
(
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
]),
buffer
);
ret
=
p
GetConsoleInputExeNameA
(
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
]),
buffer
);
ok
(
ret
,
"GetConsoleInputExeNameA failed
\n
"
);
ok
(
!
lstrcmpA
(
buffer
,
input_exe
),
"got %s expected %s
\n
"
,
buffer
,
input_exe
);
}
...
...
@@ -803,6 +816,8 @@ START_TEST(console)
BOOL
ret
;
CONSOLE_SCREEN_BUFFER_INFO
sbi
;
init_function_pointers
();
/* be sure we have a clean console (and that's our own)
* FIXME: this will make the test fail (currently) if we don't run
* under X11
...
...
@@ -836,5 +851,11 @@ START_TEST(console)
testCtrlHandler
();
/* still to be done: access rights & access on objects */
test_GetSetConsoleInputExeName
();
if
(
!
pGetConsoleInputExeNameA
&&
!
pSetConsoleInputExeNameA
)
{
skip
(
"GetConsoleInputExeNameA and/or SetConsoleInputExeNameA is not available
\n
"
);
return
;
}
else
test_GetSetConsoleInputExeName
();
}
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