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
dfe32d6c
Commit
dfe32d6c
authored
Jul 27, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jul 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcomp/tests: Add tests for atomic double functions.
parent
36fe1f8a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
vcomp.c
dlls/vcomp/tests/vcomp.c
+34
-0
No files found.
dlls/vcomp/tests/vcomp.c
View file @
dfe32d6c
...
...
@@ -33,18 +33,22 @@ static VOID (WINAPI *pReleaseActCtx)(HANDLE);
static
void
(
CDECL
*
p_vcomp_atomic_add_i4
)(
int
*
dest
,
int
val
);
static
void
(
CDECL
*
p_vcomp_atomic_add_r4
)(
float
*
dest
,
float
val
);
static
void
(
CDECL
*
p_vcomp_atomic_add_r8
)(
double
*
dest
,
double
val
);
static
void
(
CDECL
*
p_vcomp_atomic_and_i4
)(
int
*
dest
,
int
val
);
static
void
(
CDECL
*
p_vcomp_atomic_div_i4
)(
int
*
dest
,
int
val
);
static
void
(
CDECL
*
p_vcomp_atomic_div_r4
)(
float
*
dest
,
float
val
);
static
void
(
CDECL
*
p_vcomp_atomic_div_r8
)(
double
*
dest
,
double
val
);
static
void
(
CDECL
*
p_vcomp_atomic_div_ui4
)(
unsigned
int
*
dest
,
unsigned
int
val
);
static
void
(
CDECL
*
p_vcomp_atomic_mul_i4
)(
int
*
dest
,
int
val
);
static
void
(
CDECL
*
p_vcomp_atomic_mul_r4
)(
float
*
dest
,
float
val
);
static
void
(
CDECL
*
p_vcomp_atomic_mul_r8
)(
double
*
dest
,
double
val
);
static
void
(
CDECL
*
p_vcomp_atomic_or_i4
)(
int
*
dest
,
int
val
);
static
void
(
CDECL
*
p_vcomp_atomic_shl_i4
)(
int
*
dest
,
int
val
);
static
void
(
CDECL
*
p_vcomp_atomic_shr_i4
)(
int
*
dest
,
int
val
);
static
void
(
CDECL
*
p_vcomp_atomic_shr_ui4
)(
unsigned
int
*
dest
,
unsigned
int
val
);
static
void
(
CDECL
*
p_vcomp_atomic_sub_i4
)(
int
*
dest
,
int
val
);
static
void
(
CDECL
*
p_vcomp_atomic_sub_r4
)(
float
*
dest
,
float
val
);
static
void
(
CDECL
*
p_vcomp_atomic_sub_r8
)(
double
*
dest
,
double
val
);
static
void
(
CDECL
*
p_vcomp_atomic_xor_i4
)(
int
*
dest
,
int
val
);
static
void
(
CDECL
*
p_vcomp_barrier
)(
void
);
static
void
(
CDECL
*
p_vcomp_for_static_end
)(
void
);
...
...
@@ -192,18 +196,22 @@ static BOOL init_vcomp(void)
VCOMP_GET_PROC
(
_vcomp_atomic_add_i4
);
VCOMP_GET_PROC
(
_vcomp_atomic_add_r4
);
VCOMP_GET_PROC
(
_vcomp_atomic_add_r8
);
VCOMP_GET_PROC
(
_vcomp_atomic_and_i4
);
VCOMP_GET_PROC
(
_vcomp_atomic_div_i4
);
VCOMP_GET_PROC
(
_vcomp_atomic_div_r4
);
VCOMP_GET_PROC
(
_vcomp_atomic_div_r8
);
VCOMP_GET_PROC
(
_vcomp_atomic_div_ui4
);
VCOMP_GET_PROC
(
_vcomp_atomic_mul_i4
);
VCOMP_GET_PROC
(
_vcomp_atomic_mul_r4
);
VCOMP_GET_PROC
(
_vcomp_atomic_mul_r8
);
VCOMP_GET_PROC
(
_vcomp_atomic_or_i4
);
VCOMP_GET_PROC
(
_vcomp_atomic_shl_i4
);
VCOMP_GET_PROC
(
_vcomp_atomic_shr_i4
);
VCOMP_GET_PROC
(
_vcomp_atomic_shr_ui4
);
VCOMP_GET_PROC
(
_vcomp_atomic_sub_i4
);
VCOMP_GET_PROC
(
_vcomp_atomic_sub_r4
);
VCOMP_GET_PROC
(
_vcomp_atomic_sub_r8
);
VCOMP_GET_PROC
(
_vcomp_atomic_xor_i4
);
VCOMP_GET_PROC
(
_vcomp_barrier
);
VCOMP_GET_PROC
(
_vcomp_for_static_end
);
...
...
@@ -958,6 +966,31 @@ static void test_atomic_float(void)
}
}
static
void
test_atomic_double
(
void
)
{
struct
{
void
(
CDECL
*
func
)(
double
*
,
double
);
double
v1
,
v2
,
expected
;
}
tests
[]
=
{
{
p_vcomp_atomic_add_r8
,
42
.
0
,
17
.
0
,
42
.
0
+
17
.
0
},
{
p_vcomp_atomic_div_r8
,
42
.
0
,
17
.
0
,
42
.
0
/
17
.
0
},
{
p_vcomp_atomic_mul_r8
,
42
.
0
,
17
.
0
,
42
.
0
*
17
.
0
},
{
p_vcomp_atomic_sub_r8
,
42
.
0
,
17
.
0
,
42
.
0
-
17
.
0
},
};
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
tests
[
0
]);
i
++
)
{
double
val
=
tests
[
i
].
v1
;
tests
[
i
].
func
(
&
val
,
tests
[
i
].
v2
);
ok
(
tests
[
i
].
expected
-
0
.
001
<
val
&&
val
<
tests
[
i
].
expected
+
0
.
001
,
"test %d: expected val == %f, got %f
\n
"
,
i
,
tests
[
i
].
expected
,
val
);
}
}
START_TEST
(
vcomp
)
{
if
(
!
init_vcomp
())
...
...
@@ -971,6 +1004,7 @@ START_TEST(vcomp)
test_vcomp_for_static_init
();
test_atomic_integer32
();
test_atomic_float
();
test_atomic_double
();
release_vcomp
();
}
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