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
30deb6b8
Commit
30deb6b8
authored
Jan 24, 2010
by
André Hentschel
Committed by
Alexandre Julliard
Jan 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Test Fiber Local Storage functions.
parent
e0475a3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
fiber.c
dlls/kernel32/tests/fiber.c
+38
-0
No files found.
dlls/kernel32/tests/fiber.c
View file @
30deb6b8
...
@@ -28,6 +28,10 @@ static void (WINAPI *pDeleteFiber)(LPVOID);
...
@@ -28,6 +28,10 @@ static void (WINAPI *pDeleteFiber)(LPVOID);
static
LPVOID
(
WINAPI
*
pConvertThreadToFiberEx
)(
LPVOID
,
DWORD
);
static
LPVOID
(
WINAPI
*
pConvertThreadToFiberEx
)(
LPVOID
,
DWORD
);
static
LPVOID
(
WINAPI
*
pCreateFiberEx
)(
SIZE_T
,
SIZE_T
,
DWORD
,
LPFIBER_START_ROUTINE
,
LPVOID
);
static
LPVOID
(
WINAPI
*
pCreateFiberEx
)(
SIZE_T
,
SIZE_T
,
DWORD
,
LPFIBER_START_ROUTINE
,
LPVOID
);
static
BOOL
(
WINAPI
*
pIsThreadAFiber
)(
void
);
static
BOOL
(
WINAPI
*
pIsThreadAFiber
)(
void
);
static
DWORD
(
WINAPI
*
pFlsAlloc
)(
PFLS_CALLBACK_FUNCTION
);
static
BOOL
(
WINAPI
*
pFlsFree
)(
DWORD
);
static
PVOID
(
WINAPI
*
pFlsGetValue
)(
DWORD
);
static
BOOL
(
WINAPI
*
pFlsSetValue
)(
DWORD
,
PVOID
);
static
LPVOID
fibers
[
2
];
static
LPVOID
fibers
[
2
];
static
BYTE
testparam
=
185
;
static
BYTE
testparam
=
185
;
...
@@ -45,9 +49,18 @@ static VOID init_funcs(void)
...
@@ -45,9 +49,18 @@ static VOID init_funcs(void)
X
(
ConvertThreadToFiberEx
);
X
(
ConvertThreadToFiberEx
);
X
(
CreateFiberEx
);
X
(
CreateFiberEx
);
X
(
IsThreadAFiber
);
X
(
IsThreadAFiber
);
X
(
FlsAlloc
);
X
(
FlsFree
);
X
(
FlsGetValue
);
X
(
FlsSetValue
);
#undef X
#undef X
}
}
static
VOID
WINAPI
FiberLocalStorageProc
(
PVOID
lpFlsData
)
{
ok
(
lpFlsData
==
(
PVOID
)
1587
,
"FlsData expected not to be changed
\n
"
);
}
static
VOID
WINAPI
FiberMainProc
(
LPVOID
lpFiberParameter
)
static
VOID
WINAPI
FiberMainProc
(
LPVOID
lpFiberParameter
)
{
{
BYTE
*
tparam
=
(
BYTE
*
)
lpFiberParameter
;
BYTE
*
tparam
=
(
BYTE
*
)
lpFiberParameter
;
...
@@ -136,6 +149,29 @@ static void test_FiberHandling(void)
...
@@ -136,6 +149,29 @@ static void test_FiberHandling(void)
ok
(
!
pIsThreadAFiber
(),
"IsThreadAFiber reported TRUE
\n
"
);
ok
(
!
pIsThreadAFiber
(),
"IsThreadAFiber reported TRUE
\n
"
);
}
}
static
void
test_FiberLocalStorage
(
PFLS_CALLBACK_FUNCTION
cbfunc
)
{
DWORD
fls
;
BOOL
ret
;
PVOID
val
=
(
PVOID
)
1587
;
if
(
!
pFlsAlloc
)
{
win_skip
(
"Fiber Local Storage not supported
\n
"
);
return
;
}
fls
=
pFlsAlloc
(
cbfunc
);
ok
(
fls
!=
FLS_OUT_OF_INDEXES
,
"FlsAlloc failed with error %d
\n
"
,
GetLastError
());
ret
=
pFlsSetValue
(
fls
,
val
);
ok
(
ret
,
"FlsSetValue failed
\n
"
);
ok
(
val
==
pFlsGetValue
(
fls
),
"FlsGetValue failed
\n
"
);
ret
=
pFlsFree
(
fls
);
ok
(
ret
,
"FlsFree failed
\n
"
);
}
START_TEST
(
fiber
)
START_TEST
(
fiber
)
{
{
init_funcs
();
init_funcs
();
...
@@ -147,4 +183,6 @@ START_TEST(fiber)
...
@@ -147,4 +183,6 @@ START_TEST(fiber)
}
}
test_FiberHandling
();
test_FiberHandling
();
test_FiberLocalStorage
(
NULL
);
test_FiberLocalStorage
(
FiberLocalStorageProc
);
}
}
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