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
643625b9
Commit
643625b9
authored
Jan 20, 2010
by
André Hentschel
Committed by
Alexandre Julliard
Jan 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Initial fiber tests.
parent
69d7233e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
0 deletions
+87
-0
Makefile.in
dlls/kernel32/tests/Makefile.in
+1
-0
fiber.c
dlls/kernel32/tests/fiber.c
+86
-0
No files found.
dlls/kernel32/tests/Makefile.in
View file @
643625b9
...
...
@@ -17,6 +17,7 @@ CTESTS = \
directory.c
\
drive.c
\
environ.c
\
fiber.c
\
file.c
\
format_msg.c
\
generated.c
\
...
...
dlls/kernel32/tests/fiber.c
0 → 100644
View file @
643625b9
/*
* Unit tests for fiber functions
*
* Copyright (c) 2010 André Hentschel
*
* 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 "wine/test.h"
static
LPVOID
(
WINAPI
*
pCreateFiber
)(
SIZE_T
,
LPFIBER_START_ROUTINE
,
LPVOID
);
static
LPVOID
(
WINAPI
*
pConvertThreadToFiber
)(
LPVOID
);
static
BOOL
(
WINAPI
*
pConvertFiberToThread
)(
void
);
static
void
(
WINAPI
*
pSwitchToFiber
)(
LPVOID
);
static
void
(
WINAPI
*
pDeleteFiber
)(
LPVOID
);
static
LPVOID
fibers
[
2
];
static
BYTE
testparam
=
187
;
static
BOOL
init_funcs
(
void
)
{
HMODULE
hKernel32
=
GetModuleHandle
(
"kernel32"
);
#define X(f) if (!(p##f = (void*)GetProcAddress(hKernel32, #f))) return FALSE;
X
(
CreateFiber
);
X
(
ConvertThreadToFiber
);
X
(
ConvertFiberToThread
);
X
(
SwitchToFiber
);
X
(
DeleteFiber
);
#undef X
return
TRUE
;
}
static
VOID
WINAPI
FiberMainProc
(
LPVOID
lpFiberParameter
)
{
BYTE
*
tparam
=
(
BYTE
*
)
lpFiberParameter
;
ok
(
*
tparam
==
187
,
"Parameterdata expected not to be changed
\n
"
);
pSwitchToFiber
(
fibers
[
0
]);
}
static
void
test_ConvertThreadToFiber
(
void
)
{
fibers
[
0
]
=
pConvertThreadToFiber
(
&
testparam
);
ok
(
fibers
[
0
]
!=
0
,
"ConvertThreadToFiber failed with error %d
\n
"
,
GetLastError
());
}
static
void
test_ConvertFiberToThread
(
void
)
{
ok
(
pConvertFiberToThread
()
,
"ConvertThreadToFiber failed with error %d
\n
"
,
GetLastError
());
}
static
void
test_CreateFiber
(
void
)
{
fibers
[
1
]
=
pCreateFiber
(
0
,
FiberMainProc
,
&
testparam
);
ok
(
fibers
[
1
]
!=
0
,
"CreateFiber failed with error %d
\n
"
,
GetLastError
());
pSwitchToFiber
(
fibers
[
1
]);
pDeleteFiber
(
fibers
[
1
]);
}
START_TEST
(
fiber
)
{
if
(
!
init_funcs
())
{
win_skip
(
"Needed functions are not available
\n
"
);
return
;
}
test_ConvertThreadToFiber
();
test_ConvertFiberToThread
();
test_ConvertThreadToFiber
();
test_CreateFiber
();
}
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