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
b65bde4d
Commit
b65bde4d
authored
Mar 08, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcomp/tests: Enable compilation with long types.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f7345120
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
79 deletions
+78
-79
Makefile.in
dlls/vcomp/tests/Makefile.in
+0
-1
vcomp.c
dlls/vcomp/tests/vcomp.c
+78
-78
No files found.
dlls/vcomp/tests/Makefile.in
View file @
b65bde4d
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
TESTDLL
=
vcomp.dll
TESTDLL
=
vcomp.dll
C_SRCS
=
\
C_SRCS
=
\
...
...
dlls/vcomp/tests/vcomp.c
View file @
b65bde4d
...
@@ -396,7 +396,7 @@ static void CDECL num_threads_cb(BOOL nested, int parallel, int nested_threads,
...
@@ -396,7 +396,7 @@ static void CDECL num_threads_cb(BOOL nested, int parallel, int nested_threads,
p_vcomp_barrier
();
p_vcomp_barrier
();
num_threads
=
pomp_get_num_threads
();
num_threads
=
pomp_get_num_threads
();
ok
(
num_threads
==
*
count
,
"expected num_threads == %d, got %d
\n
"
,
*
count
,
num_threads
);
ok
(
num_threads
==
*
count
,
"expected num_threads == %
l
d, got %d
\n
"
,
*
count
,
num_threads
);
thread_num
=
pomp_get_thread_num
();
thread_num
=
pomp_get_thread_num
();
ok
(
thread_num
>=
0
&&
thread_num
<
num_threads
,
ok
(
thread_num
>=
0
&&
thread_num
<
num_threads
,
"expected thread_num in range [0, %d], got %d
\n
"
,
num_threads
-
1
,
thread_num
);
"expected thread_num in range [0, %d], got %d
\n
"
,
num_threads
-
1
,
thread_num
);
...
@@ -409,16 +409,16 @@ static void CDECL num_threads_cb(BOOL nested, int parallel, int nested_threads,
...
@@ -409,16 +409,16 @@ static void CDECL num_threads_cb(BOOL nested, int parallel, int nested_threads,
thread_count
=
0
;
thread_count
=
0
;
p_vcomp_fork
(
TRUE
,
2
,
num_threads_cb2
,
TRUE
,
&
thread_count
);
p_vcomp_fork
(
TRUE
,
2
,
num_threads_cb2
,
TRUE
,
&
thread_count
);
if
(
nested
)
if
(
nested
)
ok
(
thread_count
==
nested_threads
,
"expected %d threads, got %d
\n
"
,
nested_threads
,
thread_count
);
ok
(
thread_count
==
nested_threads
,
"expected %d threads, got %
l
d
\n
"
,
nested_threads
,
thread_count
);
else
else
ok
(
thread_count
==
1
,
"expected 1 thread, got %d
\n
"
,
thread_count
);
ok
(
thread_count
==
1
,
"expected 1 thread, got %
l
d
\n
"
,
thread_count
);
is_parallel
=
pomp_in_parallel
();
is_parallel
=
pomp_in_parallel
();
ok
(
is_parallel
==
parallel
,
"expected %d, got %d
\n
"
,
parallel
,
is_parallel
);
ok
(
is_parallel
==
parallel
,
"expected %d, got %d
\n
"
,
parallel
,
is_parallel
);
thread_count
=
0
;
thread_count
=
0
;
p_vcomp_fork
(
FALSE
,
2
,
num_threads_cb2
,
parallel
,
&
thread_count
);
p_vcomp_fork
(
FALSE
,
2
,
num_threads_cb2
,
parallel
,
&
thread_count
);
ok
(
thread_count
==
1
,
"expected 1 thread, got %d
\n
"
,
thread_count
);
ok
(
thread_count
==
1
,
"expected 1 thread, got %
l
d
\n
"
,
thread_count
);
is_parallel
=
pomp_in_parallel
();
is_parallel
=
pomp_in_parallel
();
ok
(
is_parallel
==
parallel
,
"expected %d, got %d
\n
"
,
parallel
,
is_parallel
);
ok
(
is_parallel
==
parallel
,
"expected %d, got %d
\n
"
,
parallel
,
is_parallel
);
...
@@ -427,9 +427,9 @@ static void CDECL num_threads_cb(BOOL nested, int parallel, int nested_threads,
...
@@ -427,9 +427,9 @@ static void CDECL num_threads_cb(BOOL nested, int parallel, int nested_threads,
thread_count
=
0
;
thread_count
=
0
;
p_vcomp_fork
(
TRUE
,
2
,
num_threads_cb2
,
TRUE
,
&
thread_count
);
p_vcomp_fork
(
TRUE
,
2
,
num_threads_cb2
,
TRUE
,
&
thread_count
);
if
(
nested
)
if
(
nested
)
ok
(
thread_count
==
4
,
"expected 4 threads, got %d
\n
"
,
thread_count
);
ok
(
thread_count
==
4
,
"expected 4 threads, got %
l
d
\n
"
,
thread_count
);
else
else
ok
(
thread_count
==
1
,
"expected 1 thread, got %d
\n
"
,
thread_count
);
ok
(
thread_count
==
1
,
"expected 1 thread, got %
l
d
\n
"
,
thread_count
);
is_parallel
=
pomp_in_parallel
();
is_parallel
=
pomp_in_parallel
();
ok
(
is_parallel
==
parallel
,
"expected %d, got %d
\n
"
,
parallel
,
is_parallel
);
ok
(
is_parallel
==
parallel
,
"expected %d, got %d
\n
"
,
parallel
,
is_parallel
);
...
@@ -459,7 +459,7 @@ static void test_omp_get_num_threads(BOOL nested)
...
@@ -459,7 +459,7 @@ static void test_omp_get_num_threads(BOOL nested)
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
thread_count
=
0
;
thread_count
=
0
;
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
max_threads
,
&
thread_count
);
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
max_threads
,
&
thread_count
);
ok
(
thread_count
==
max_threads
,
"expected %d threads, got %d
\n
"
,
max_threads
,
thread_count
);
ok
(
thread_count
==
max_threads
,
"expected %d threads, got %
l
d
\n
"
,
max_threads
,
thread_count
);
is_parallel
=
pomp_in_parallel
();
is_parallel
=
pomp_in_parallel
();
ok
(
is_parallel
==
FALSE
,
"expected FALSE, got %d
\n
"
,
is_parallel
);
ok
(
is_parallel
==
FALSE
,
"expected FALSE, got %d
\n
"
,
is_parallel
);
...
@@ -468,7 +468,7 @@ static void test_omp_get_num_threads(BOOL nested)
...
@@ -468,7 +468,7 @@ static void test_omp_get_num_threads(BOOL nested)
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
thread_count
=
0
;
thread_count
=
0
;
p_vcomp_fork
(
FALSE
,
4
,
num_threads_cb
,
TRUE
,
FALSE
,
max_threads
,
&
thread_count
);
p_vcomp_fork
(
FALSE
,
4
,
num_threads_cb
,
TRUE
,
FALSE
,
max_threads
,
&
thread_count
);
ok
(
thread_count
==
1
,
"expected 1 thread, got %d
\n
"
,
thread_count
);
ok
(
thread_count
==
1
,
"expected 1 thread, got %
l
d
\n
"
,
thread_count
);
is_parallel
=
pomp_in_parallel
();
is_parallel
=
pomp_in_parallel
();
ok
(
is_parallel
==
FALSE
,
"expected FALSE, got %d
\n
"
,
is_parallel
);
ok
(
is_parallel
==
FALSE
,
"expected FALSE, got %d
\n
"
,
is_parallel
);
...
@@ -478,7 +478,7 @@ static void test_omp_get_num_threads(BOOL nested)
...
@@ -478,7 +478,7 @@ static void test_omp_get_num_threads(BOOL nested)
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
thread_count
=
0
;
thread_count
=
0
;
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
1
,
&
thread_count
);
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
1
,
&
thread_count
);
ok
(
thread_count
==
1
,
"expected 1 thread, got %d
\n
"
,
thread_count
);
ok
(
thread_count
==
1
,
"expected 1 thread, got %
l
d
\n
"
,
thread_count
);
is_parallel
=
pomp_in_parallel
();
is_parallel
=
pomp_in_parallel
();
ok
(
is_parallel
==
FALSE
,
"expected FALSE, got %d
\n
"
,
is_parallel
);
ok
(
is_parallel
==
FALSE
,
"expected FALSE, got %d
\n
"
,
is_parallel
);
...
@@ -488,38 +488,38 @@ static void test_omp_get_num_threads(BOOL nested)
...
@@ -488,38 +488,38 @@ static void test_omp_get_num_threads(BOOL nested)
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
thread_count
=
0
;
thread_count
=
0
;
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
2
,
&
thread_count
);
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
2
,
&
thread_count
);
ok
(
thread_count
==
2
,
"expected 2 threads, got %d
\n
"
,
thread_count
);
ok
(
thread_count
==
2
,
"expected 2 threads, got %
l
d
\n
"
,
thread_count
);
pomp_set_num_threads
(
4
);
pomp_set_num_threads
(
4
);
num_threads
=
pomp_get_num_threads
();
num_threads
=
pomp_get_num_threads
();
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
thread_count
=
0
;
thread_count
=
0
;
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
4
,
&
thread_count
);
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
4
,
&
thread_count
);
ok
(
thread_count
==
4
,
"expected 4 threads, got %d
\n
"
,
thread_count
);
ok
(
thread_count
==
4
,
"expected 4 threads, got %
l
d
\n
"
,
thread_count
);
p_vcomp_set_num_threads
(
8
);
p_vcomp_set_num_threads
(
8
);
num_threads
=
pomp_get_num_threads
();
num_threads
=
pomp_get_num_threads
();
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
thread_count
=
0
;
thread_count
=
0
;
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
4
,
&
thread_count
);
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
4
,
&
thread_count
);
ok
(
thread_count
==
8
,
"expected 8 threads, got %d
\n
"
,
thread_count
);
ok
(
thread_count
==
8
,
"expected 8 threads, got %
l
d
\n
"
,
thread_count
);
thread_count
=
0
;
thread_count
=
0
;
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
4
,
&
thread_count
);
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
4
,
&
thread_count
);
ok
(
thread_count
==
4
,
"expected 4 threads, got %d
\n
"
,
thread_count
);
ok
(
thread_count
==
4
,
"expected 4 threads, got %
l
d
\n
"
,
thread_count
);
p_vcomp_set_num_threads
(
0
);
p_vcomp_set_num_threads
(
0
);
num_threads
=
pomp_get_num_threads
();
num_threads
=
pomp_get_num_threads
();
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
thread_count
=
0
;
thread_count
=
0
;
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
4
,
&
thread_count
);
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
4
,
&
thread_count
);
ok
(
thread_count
==
4
,
"expected 4 threads, got %d
\n
"
,
thread_count
);
ok
(
thread_count
==
4
,
"expected 4 threads, got %
l
d
\n
"
,
thread_count
);
pomp_set_num_threads
(
0
);
pomp_set_num_threads
(
0
);
num_threads
=
pomp_get_num_threads
();
num_threads
=
pomp_get_num_threads
();
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
ok
(
num_threads
==
1
,
"expected num_threads == 1, got %d
\n
"
,
num_threads
);
thread_count
=
0
;
thread_count
=
0
;
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
4
,
&
thread_count
);
p_vcomp_fork
(
TRUE
,
4
,
num_threads_cb
,
nested
,
TRUE
,
4
,
&
thread_count
);
ok
(
thread_count
==
4
,
"expected 4 threads, got %d
\n
"
,
thread_count
);
ok
(
thread_count
==
4
,
"expected 4 threads, got %
l
d
\n
"
,
thread_count
);
pomp_set_num_threads
(
max_threads
);
pomp_set_num_threads
(
max_threads
);
pomp_set_nested
(
FALSE
);
pomp_set_nested
(
FALSE
);
...
@@ -570,19 +570,19 @@ static void test_vcomp_fork(void)
...
@@ -570,19 +570,19 @@ static void test_vcomp_fork(void)
a
=
0
;
b
=
1
;
c
=
2
;
d
=
3
;
e
=
4
;
a
=
0
;
b
=
1
;
c
=
2
;
d
=
3
;
e
=
4
;
p_vcomp_fork
(
FALSE
,
5
,
fork_ptr_cb
,
&
a
,
&
b
,
&
c
,
&
d
,
&
e
);
p_vcomp_fork
(
FALSE
,
5
,
fork_ptr_cb
,
&
a
,
&
b
,
&
c
,
&
d
,
&
e
);
ok
(
a
==
1
,
"expected a == 1, got %d
\n
"
,
a
);
ok
(
a
==
1
,
"expected a == 1, got %
l
d
\n
"
,
a
);
ok
(
b
==
2
,
"expected b == 2, got %d
\n
"
,
b
);
ok
(
b
==
2
,
"expected b == 2, got %
l
d
\n
"
,
b
);
ok
(
c
==
3
,
"expected c == 3, got %d
\n
"
,
c
);
ok
(
c
==
3
,
"expected c == 3, got %
l
d
\n
"
,
c
);
ok
(
d
==
4
,
"expected d == 4, got %d
\n
"
,
d
);
ok
(
d
==
4
,
"expected d == 4, got %
l
d
\n
"
,
d
);
ok
(
e
==
5
,
"expected e == 5, got %d
\n
"
,
e
);
ok
(
e
==
5
,
"expected e == 5, got %
l
d
\n
"
,
e
);
a
=
0
;
b
=
1
;
c
=
2
;
d
=
3
;
e
=
4
;
a
=
0
;
b
=
1
;
c
=
2
;
d
=
3
;
e
=
4
;
p_vcomp_fork
(
TRUE
,
5
,
fork_ptr_cb
,
&
a
,
&
b
,
&
c
,
&
d
,
&
e
);
p_vcomp_fork
(
TRUE
,
5
,
fork_ptr_cb
,
&
a
,
&
b
,
&
c
,
&
d
,
&
e
);
ok
(
a
==
4
,
"expected a == 4, got %d
\n
"
,
a
);
ok
(
a
==
4
,
"expected a == 4, got %
l
d
\n
"
,
a
);
ok
(
b
==
5
,
"expected b == 5, got %d
\n
"
,
b
);
ok
(
b
==
5
,
"expected b == 5, got %
l
d
\n
"
,
b
);
ok
(
c
==
6
,
"expected c == 6, got %d
\n
"
,
c
);
ok
(
c
==
6
,
"expected c == 6, got %
l
d
\n
"
,
c
);
ok
(
d
==
7
,
"expected d == 7, got %d
\n
"
,
d
);
ok
(
d
==
7
,
"expected d == 7, got %
l
d
\n
"
,
d
);
ok
(
e
==
8
,
"expected e == 8, got %d
\n
"
,
e
);
ok
(
e
==
8
,
"expected e == 8, got %
l
d
\n
"
,
e
);
p_vcomp_fork
(
TRUE
,
11
,
fork_uintptr_cb
,
(
UINT_PTR
)
1
,
(
UINT_PTR
)(
MAXUINT_PTR
-
2
),
p_vcomp_fork
(
TRUE
,
11
,
fork_uintptr_cb
,
(
UINT_PTR
)
1
,
(
UINT_PTR
)(
MAXUINT_PTR
-
2
),
(
UINT_PTR
)
3
,
(
UINT_PTR
)(
MAXUINT_PTR
-
4
),
(
UINT_PTR
)
5
,
(
UINT_PTR
)
3
,
(
UINT_PTR
)(
MAXUINT_PTR
-
4
),
(
UINT_PTR
)
5
,
...
@@ -643,9 +643,9 @@ if (0)
...
@@ -643,9 +643,9 @@ if (0)
a
=
b
=
c
=
0
;
a
=
b
=
c
=
0
;
section_cb
(
&
a
,
&
b
,
&
c
);
section_cb
(
&
a
,
&
b
,
&
c
);
ok
(
a
==
20
,
"expected a == 20, got %d
\n
"
,
a
);
ok
(
a
==
20
,
"expected a == 20, got %
l
d
\n
"
,
a
);
ok
(
b
==
30
,
"expected b == 30, got %d
\n
"
,
b
);
ok
(
b
==
30
,
"expected b == 30, got %
l
d
\n
"
,
b
);
ok
(
c
==
40
,
"expected c == 40, got %d
\n
"
,
c
);
ok
(
c
==
40
,
"expected c == 40, got %
l
d
\n
"
,
c
);
for
(
i
=
1
;
i
<=
4
;
i
++
)
for
(
i
=
1
;
i
<=
4
;
i
++
)
{
{
...
@@ -653,15 +653,15 @@ if (0)
...
@@ -653,15 +653,15 @@ if (0)
a
=
b
=
c
=
0
;
a
=
b
=
c
=
0
;
p_vcomp_fork
(
TRUE
,
3
,
section_cb
,
&
a
,
&
b
,
&
c
);
p_vcomp_fork
(
TRUE
,
3
,
section_cb
,
&
a
,
&
b
,
&
c
);
ok
(
a
==
20
,
"expected a == 20, got %d
\n
"
,
a
);
ok
(
a
==
20
,
"expected a == 20, got %
l
d
\n
"
,
a
);
ok
(
b
==
30
,
"expected b == 30, got %d
\n
"
,
b
);
ok
(
b
==
30
,
"expected b == 30, got %
l
d
\n
"
,
b
);
ok
(
c
==
40
,
"expected c == 40, got %d
\n
"
,
c
);
ok
(
c
==
40
,
"expected c == 40, got %
l
d
\n
"
,
c
);
a
=
b
=
c
=
0
;
a
=
b
=
c
=
0
;
p_vcomp_fork
(
FALSE
,
3
,
section_cb
,
&
a
,
&
b
,
&
c
);
p_vcomp_fork
(
FALSE
,
3
,
section_cb
,
&
a
,
&
b
,
&
c
);
ok
(
a
==
20
,
"expected a == 20, got %d
\n
"
,
a
);
ok
(
a
==
20
,
"expected a == 20, got %
l
d
\n
"
,
a
);
ok
(
b
==
30
,
"expected b == 30, got %d
\n
"
,
b
);
ok
(
b
==
30
,
"expected b == 30, got %
l
d
\n
"
,
b
);
ok
(
c
==
40
,
"expected c == 40, got %d
\n
"
,
c
);
ok
(
c
==
40
,
"expected c == 40, got %
l
d
\n
"
,
c
);
}
}
pomp_set_num_threads
(
max_threads
);
pomp_set_num_threads
(
max_threads
);
...
@@ -1644,10 +1644,10 @@ static void test_vcomp_for_dynamic_init(void)
...
@@ -1644,10 +1644,10 @@ static void test_vcomp_for_dynamic_init(void)
/* test chunked scheduling */
/* test chunked scheduling */
a
=
b
=
c
=
d
=
0
;
a
=
b
=
c
=
d
=
0
;
for_dynamic_chunked_cb
(
&
a
,
&
b
,
&
c
,
&
d
);
for_dynamic_chunked_cb
(
&
a
,
&
b
,
&
c
,
&
d
);
ok
(
a
==
71071
,
"expected a == 71071, got %d
\n
"
,
a
);
ok
(
a
==
71071
,
"expected a == 71071, got %
l
d
\n
"
,
a
);
ok
(
b
==
71929
,
"expected b == 71929, got %d
\n
"
,
b
);
ok
(
b
==
71929
,
"expected b == 71929, got %
l
d
\n
"
,
b
);
ok
(
c
==
14210
,
"expected c == 14210, got %d
\n
"
,
c
);
ok
(
c
==
14210
,
"expected c == 14210, got %
l
d
\n
"
,
c
);
ok
(
d
==
14790
,
"expected d == 14790, got %d
\n
"
,
d
);
ok
(
d
==
14790
,
"expected d == 14790, got %
l
d
\n
"
,
d
);
for
(
i
=
1
;
i
<=
4
;
i
++
)
for
(
i
=
1
;
i
<=
4
;
i
++
)
{
{
...
@@ -1655,26 +1655,26 @@ static void test_vcomp_for_dynamic_init(void)
...
@@ -1655,26 +1655,26 @@ static void test_vcomp_for_dynamic_init(void)
a
=
b
=
c
=
d
=
0
;
a
=
b
=
c
=
d
=
0
;
p_vcomp_fork
(
TRUE
,
4
,
for_dynamic_chunked_cb
,
&
a
,
&
b
,
&
c
,
&
d
);
p_vcomp_fork
(
TRUE
,
4
,
for_dynamic_chunked_cb
,
&
a
,
&
b
,
&
c
,
&
d
);
ok
(
a
==
71071
,
"expected a == 71071, got %d
\n
"
,
a
);
ok
(
a
==
71071
,
"expected a == 71071, got %
l
d
\n
"
,
a
);
ok
(
b
==
71929
,
"expected b == 71929, got %d
\n
"
,
b
);
ok
(
b
==
71929
,
"expected b == 71929, got %
l
d
\n
"
,
b
);
ok
(
c
==
14210
,
"expected c == 14210, got %d
\n
"
,
c
);
ok
(
c
==
14210
,
"expected c == 14210, got %
l
d
\n
"
,
c
);
ok
(
d
==
14790
,
"expected d == 14790, got %d
\n
"
,
d
);
ok
(
d
==
14790
,
"expected d == 14790, got %
l
d
\n
"
,
d
);
a
=
b
=
c
=
d
=
0
;
a
=
b
=
c
=
d
=
0
;
p_vcomp_fork
(
FALSE
,
4
,
for_dynamic_chunked_cb
,
&
a
,
&
b
,
&
c
,
&
d
);
p_vcomp_fork
(
FALSE
,
4
,
for_dynamic_chunked_cb
,
&
a
,
&
b
,
&
c
,
&
d
);
ok
(
a
==
71071
,
"expected a == 71071, got %d
\n
"
,
a
);
ok
(
a
==
71071
,
"expected a == 71071, got %
l
d
\n
"
,
a
);
ok
(
b
==
71929
,
"expected b == 71929, got %d
\n
"
,
b
);
ok
(
b
==
71929
,
"expected b == 71929, got %
l
d
\n
"
,
b
);
ok
(
c
==
14210
,
"expected c == 14210, got %d
\n
"
,
c
);
ok
(
c
==
14210
,
"expected c == 14210, got %
l
d
\n
"
,
c
);
ok
(
d
==
14790
,
"expected d == 14790, got %d
\n
"
,
d
);
ok
(
d
==
14790
,
"expected d == 14790, got %
l
d
\n
"
,
d
);
}
}
/* test guided scheduling */
/* test guided scheduling */
a
=
b
=
c
=
d
=
0
;
a
=
b
=
c
=
d
=
0
;
for_dynamic_guided_cb
(
VCOMP_DYNAMIC_FLAGS_GUIDED
,
&
a
,
&
b
,
&
c
,
&
d
);
for_dynamic_guided_cb
(
VCOMP_DYNAMIC_FLAGS_GUIDED
,
&
a
,
&
b
,
&
c
,
&
d
);
ok
(
a
==
guided_a
[
0
],
"expected a == %d, got %d
\n
"
,
guided_a
[
0
],
a
);
ok
(
a
==
guided_a
[
0
],
"expected a == %d, got %
l
d
\n
"
,
guided_a
[
0
],
a
);
ok
(
b
==
guided_b
[
0
],
"expected b == %d, got %d
\n
"
,
guided_b
[
0
],
b
);
ok
(
b
==
guided_b
[
0
],
"expected b == %d, got %
l
d
\n
"
,
guided_b
[
0
],
b
);
ok
(
c
==
guided_c
[
0
],
"expected c == %d, got %d
\n
"
,
guided_c
[
0
],
c
);
ok
(
c
==
guided_c
[
0
],
"expected c == %d, got %
l
d
\n
"
,
guided_c
[
0
],
c
);
ok
(
d
==
guided_d
[
0
],
"expected d == %d, got %d
\n
"
,
guided_d
[
0
],
d
);
ok
(
d
==
guided_d
[
0
],
"expected d == %d, got %
l
d
\n
"
,
guided_d
[
0
],
d
);
for
(
i
=
1
;
i
<=
4
;
i
++
)
for
(
i
=
1
;
i
<=
4
;
i
++
)
{
{
...
@@ -1682,26 +1682,26 @@ static void test_vcomp_for_dynamic_init(void)
...
@@ -1682,26 +1682,26 @@ static void test_vcomp_for_dynamic_init(void)
a
=
b
=
c
=
d
=
0
;
a
=
b
=
c
=
d
=
0
;
p_vcomp_fork
(
TRUE
,
5
,
for_dynamic_guided_cb
,
VCOMP_DYNAMIC_FLAGS_GUIDED
,
&
a
,
&
b
,
&
c
,
&
d
);
p_vcomp_fork
(
TRUE
,
5
,
for_dynamic_guided_cb
,
VCOMP_DYNAMIC_FLAGS_GUIDED
,
&
a
,
&
b
,
&
c
,
&
d
);
ok
(
a
==
guided_a
[
i
-
1
],
"expected a == %d, got %d
\n
"
,
guided_a
[
i
-
1
],
a
);
ok
(
a
==
guided_a
[
i
-
1
],
"expected a == %d, got %
l
d
\n
"
,
guided_a
[
i
-
1
],
a
);
ok
(
b
==
guided_b
[
i
-
1
],
"expected b == %d, got %d
\n
"
,
guided_b
[
i
-
1
],
b
);
ok
(
b
==
guided_b
[
i
-
1
],
"expected b == %d, got %
l
d
\n
"
,
guided_b
[
i
-
1
],
b
);
ok
(
c
==
guided_c
[
i
-
1
],
"expected c == %d, got %d
\n
"
,
guided_c
[
i
-
1
],
c
);
ok
(
c
==
guided_c
[
i
-
1
],
"expected c == %d, got %
l
d
\n
"
,
guided_c
[
i
-
1
],
c
);
ok
(
d
==
guided_d
[
i
-
1
],
"expected d == %d, got %d
\n
"
,
guided_d
[
i
-
1
],
d
);
ok
(
d
==
guided_d
[
i
-
1
],
"expected d == %d, got %
l
d
\n
"
,
guided_d
[
i
-
1
],
d
);
a
=
b
=
c
=
d
=
0
;
a
=
b
=
c
=
d
=
0
;
p_vcomp_fork
(
FALSE
,
5
,
for_dynamic_guided_cb
,
VCOMP_DYNAMIC_FLAGS_GUIDED
,
&
a
,
&
b
,
&
c
,
&
d
);
p_vcomp_fork
(
FALSE
,
5
,
for_dynamic_guided_cb
,
VCOMP_DYNAMIC_FLAGS_GUIDED
,
&
a
,
&
b
,
&
c
,
&
d
);
ok
(
a
==
guided_a
[
0
],
"expected a == %d, got %d
\n
"
,
guided_a
[
0
],
a
);
ok
(
a
==
guided_a
[
0
],
"expected a == %d, got %
l
d
\n
"
,
guided_a
[
0
],
a
);
ok
(
b
==
guided_b
[
0
],
"expected b == %d, got %d
\n
"
,
guided_b
[
0
],
b
);
ok
(
b
==
guided_b
[
0
],
"expected b == %d, got %
l
d
\n
"
,
guided_b
[
0
],
b
);
ok
(
c
==
guided_c
[
0
],
"expected c == %d, got %d
\n
"
,
guided_c
[
0
],
c
);
ok
(
c
==
guided_c
[
0
],
"expected c == %d, got %
l
d
\n
"
,
guided_c
[
0
],
c
);
ok
(
d
==
guided_d
[
0
],
"expected d == %d, got %d
\n
"
,
guided_d
[
0
],
d
);
ok
(
d
==
guided_d
[
0
],
"expected d == %d, got %
l
d
\n
"
,
guided_d
[
0
],
d
);
}
}
/* test with empty flags */
/* test with empty flags */
a
=
b
=
c
=
d
=
0
;
a
=
b
=
c
=
d
=
0
;
for_dynamic_guided_cb
(
0
,
&
a
,
&
b
,
&
c
,
&
d
);
for_dynamic_guided_cb
(
0
,
&
a
,
&
b
,
&
c
,
&
d
);
ok
(
a
==
guided_a
[
0
],
"expected a == %d, got %d
\n
"
,
guided_a
[
0
],
a
);
ok
(
a
==
guided_a
[
0
],
"expected a == %d, got %
l
d
\n
"
,
guided_a
[
0
],
a
);
ok
(
b
==
guided_b
[
0
],
"expected b == %d, got %d
\n
"
,
guided_b
[
0
],
b
);
ok
(
b
==
guided_b
[
0
],
"expected b == %d, got %
l
d
\n
"
,
guided_b
[
0
],
b
);
ok
(
c
==
guided_c
[
0
],
"expected c == %d, got %d
\n
"
,
guided_c
[
0
],
c
);
ok
(
c
==
guided_c
[
0
],
"expected c == %d, got %
l
d
\n
"
,
guided_c
[
0
],
c
);
ok
(
d
==
guided_d
[
0
],
"expected d == %d, got %d
\n
"
,
guided_d
[
0
],
d
);
ok
(
d
==
guided_d
[
0
],
"expected d == %d, got %
l
d
\n
"
,
guided_d
[
0
],
d
);
for
(
i
=
1
;
i
<=
4
;
i
++
)
for
(
i
=
1
;
i
<=
4
;
i
++
)
{
{
...
@@ -1709,17 +1709,17 @@ static void test_vcomp_for_dynamic_init(void)
...
@@ -1709,17 +1709,17 @@ static void test_vcomp_for_dynamic_init(void)
a
=
b
=
c
=
d
=
0
;
a
=
b
=
c
=
d
=
0
;
p_vcomp_fork
(
TRUE
,
5
,
for_dynamic_guided_cb
,
0
,
&
a
,
&
b
,
&
c
,
&
d
);
p_vcomp_fork
(
TRUE
,
5
,
for_dynamic_guided_cb
,
0
,
&
a
,
&
b
,
&
c
,
&
d
);
ok
(
a
==
guided_a
[
i
-
1
],
"expected a == %d, got %d
\n
"
,
guided_a
[
i
-
1
],
a
);
ok
(
a
==
guided_a
[
i
-
1
],
"expected a == %d, got %
l
d
\n
"
,
guided_a
[
i
-
1
],
a
);
ok
(
b
==
guided_b
[
i
-
1
],
"expected b == %d, got %d
\n
"
,
guided_b
[
i
-
1
],
b
);
ok
(
b
==
guided_b
[
i
-
1
],
"expected b == %d, got %
l
d
\n
"
,
guided_b
[
i
-
1
],
b
);
ok
(
c
==
guided_c
[
i
-
1
],
"expected c == %d, got %d
\n
"
,
guided_c
[
i
-
1
],
c
);
ok
(
c
==
guided_c
[
i
-
1
],
"expected c == %d, got %
l
d
\n
"
,
guided_c
[
i
-
1
],
c
);
ok
(
d
==
guided_d
[
i
-
1
],
"expected d == %d, got %d
\n
"
,
guided_d
[
i
-
1
],
d
);
ok
(
d
==
guided_d
[
i
-
1
],
"expected d == %d, got %
l
d
\n
"
,
guided_d
[
i
-
1
],
d
);
a
=
b
=
c
=
d
=
0
;
a
=
b
=
c
=
d
=
0
;
p_vcomp_fork
(
FALSE
,
5
,
for_dynamic_guided_cb
,
0
,
&
a
,
&
b
,
&
c
,
&
d
);
p_vcomp_fork
(
FALSE
,
5
,
for_dynamic_guided_cb
,
0
,
&
a
,
&
b
,
&
c
,
&
d
);
ok
(
a
==
guided_a
[
0
],
"expected a == %d, got %d
\n
"
,
guided_a
[
0
],
a
);
ok
(
a
==
guided_a
[
0
],
"expected a == %d, got %
l
d
\n
"
,
guided_a
[
0
],
a
);
ok
(
b
==
guided_b
[
0
],
"expected b == %d, got %d
\n
"
,
guided_b
[
0
],
b
);
ok
(
b
==
guided_b
[
0
],
"expected b == %d, got %
l
d
\n
"
,
guided_b
[
0
],
b
);
ok
(
c
==
guided_c
[
0
],
"expected c == %d, got %d
\n
"
,
guided_c
[
0
],
c
);
ok
(
c
==
guided_c
[
0
],
"expected c == %d, got %
l
d
\n
"
,
guided_c
[
0
],
c
);
ok
(
d
==
guided_d
[
0
],
"expected d == %d, got %d
\n
"
,
guided_d
[
0
],
d
);
ok
(
d
==
guided_d
[
0
],
"expected d == %d, got %
l
d
\n
"
,
guided_d
[
0
],
d
);
}
}
pomp_set_num_threads
(
max_threads
);
pomp_set_num_threads
(
max_threads
);
...
@@ -1736,7 +1736,7 @@ static void CDECL master_cb(HANDLE semaphore)
...
@@ -1736,7 +1736,7 @@ static void CDECL master_cb(HANDLE semaphore)
if
(
num_threads
>=
2
)
if
(
num_threads
>=
2
)
{
{
DWORD
result
=
WaitForSingleObject
(
semaphore
,
1000
);
DWORD
result
=
WaitForSingleObject
(
semaphore
,
1000
);
ok
(
result
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %u
\n
"
,
result
);
ok
(
result
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %
l
u
\n
"
,
result
);
}
}
p_vcomp_master_end
();
p_vcomp_master_end
();
}
}
...
@@ -1752,7 +1752,7 @@ static void test_vcomp_master_begin(void)
...
@@ -1752,7 +1752,7 @@ static void test_vcomp_master_begin(void)
int
i
;
int
i
;
semaphore
=
CreateSemaphoreA
(
NULL
,
0
,
1
,
NULL
);
semaphore
=
CreateSemaphoreA
(
NULL
,
0
,
1
,
NULL
);
ok
(
semaphore
!=
NULL
,
"CreateSemaphoreA failed %u
\n
"
,
GetLastError
());
ok
(
semaphore
!=
NULL
,
"CreateSemaphoreA failed %
l
u
\n
"
,
GetLastError
());
master_cb
(
semaphore
);
master_cb
(
semaphore
);
...
@@ -1776,7 +1776,7 @@ static void CDECL single_cb(int flags, HANDLE semaphore)
...
@@ -1776,7 +1776,7 @@ static void CDECL single_cb(int flags, HANDLE semaphore)
if
(
num_threads
>=
2
)
if
(
num_threads
>=
2
)
{
{
DWORD
result
=
WaitForSingleObject
(
semaphore
,
1000
);
DWORD
result
=
WaitForSingleObject
(
semaphore
,
1000
);
ok
(
result
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %u
\n
"
,
result
);
ok
(
result
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %
l
u
\n
"
,
result
);
}
}
}
}
p_vcomp_single_end
();
p_vcomp_single_end
();
...
@@ -1796,7 +1796,7 @@ static void test_vcomp_single_begin(void)
...
@@ -1796,7 +1796,7 @@ static void test_vcomp_single_begin(void)
int
i
;
int
i
;
semaphore
=
CreateSemaphoreA
(
NULL
,
0
,
1
,
NULL
);
semaphore
=
CreateSemaphoreA
(
NULL
,
0
,
1
,
NULL
);
ok
(
semaphore
!=
NULL
,
"CreateSemaphoreA failed %u
\n
"
,
GetLastError
());
ok
(
semaphore
!=
NULL
,
"CreateSemaphoreA failed %
l
u
\n
"
,
GetLastError
());
single_cb
(
0
,
semaphore
);
single_cb
(
0
,
semaphore
);
single_cb
(
1
,
semaphore
);
single_cb
(
1
,
semaphore
);
...
@@ -1842,7 +1842,7 @@ static void test_vcomp_enter_critsect(void)
...
@@ -1842,7 +1842,7 @@ static void test_vcomp_enter_critsect(void)
a
=
0
;
a
=
0
;
critsect_cb
(
&
a
);
critsect_cb
(
&
a
);
ok
(
a
==
2
,
"expected a == 2, got %d
\n
"
,
a
);
ok
(
a
==
2
,
"expected a == 2, got %
l
d
\n
"
,
a
);
for
(
i
=
1
;
i
<=
4
;
i
++
)
for
(
i
=
1
;
i
<=
4
;
i
++
)
{
{
...
@@ -1850,11 +1850,11 @@ static void test_vcomp_enter_critsect(void)
...
@@ -1850,11 +1850,11 @@ static void test_vcomp_enter_critsect(void)
a
=
0
;
a
=
0
;
p_vcomp_fork
(
TRUE
,
1
,
critsect_cb
,
&
a
);
p_vcomp_fork
(
TRUE
,
1
,
critsect_cb
,
&
a
);
ok
(
a
==
2
*
i
,
"expected a == %d, got %d
\n
"
,
2
*
i
,
a
);
ok
(
a
==
2
*
i
,
"expected a == %d, got %
l
d
\n
"
,
2
*
i
,
a
);
a
=
0
;
a
=
0
;
p_vcomp_fork
(
FALSE
,
1
,
critsect_cb
,
&
a
);
p_vcomp_fork
(
FALSE
,
1
,
critsect_cb
,
&
a
);
ok
(
a
==
2
,
"expected a == 2, got %d
\n
"
,
a
);
ok
(
a
==
2
,
"expected a == 2, got %
l
d
\n
"
,
a
);
}
}
pomp_set_num_threads
(
max_threads
);
pomp_set_num_threads
(
max_threads
);
...
@@ -2628,7 +2628,7 @@ static void test_omp_get_num_procs(void)
...
@@ -2628,7 +2628,7 @@ static void test_omp_get_num_procs(void)
ok
(
num_procs
>
0
,
"expected non-zero num_procs
\n
"
);
ok
(
num_procs
>
0
,
"expected non-zero num_procs
\n
"
);
GetSystemInfo
(
&
sysinfo
);
GetSystemInfo
(
&
sysinfo
);
ok
(
sysinfo
.
dwNumberOfProcessors
>
0
,
"expected non-zero dwNumberOfProcessors
\n
"
);
ok
(
sysinfo
.
dwNumberOfProcessors
>
0
,
"expected non-zero dwNumberOfProcessors
\n
"
);
ok
(
num_procs
==
sysinfo
.
dwNumberOfProcessors
,
"got dwNumberOfProcessors %d num_procs %d
\n
"
,
sysinfo
.
dwNumberOfProcessors
,
num_procs
);
ok
(
num_procs
==
sysinfo
.
dwNumberOfProcessors
,
"got dwNumberOfProcessors %
l
d num_procs %d
\n
"
,
sysinfo
.
dwNumberOfProcessors
,
num_procs
);
}
}
START_TEST
(
vcomp
)
START_TEST
(
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