Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
excit
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
argo
excit
Commits
a5974865
Commit
a5974865
authored
Jan 10, 2019
by
Nicolas Denoyelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test split
parent
dd20ee78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
excit_tleaf.c
tests/excit_tleaf.c
+41
-0
No files found.
tests/excit_tleaf.c
View file @
a5974865
...
...
@@ -43,6 +43,46 @@ static void tleaf_test_round_robin_policy(excit_t tleaf)
assert
(
excit_next
(
tleaf
,
&
value
)
==
EXCIT_STOPIT
);
}
static
void
tleaf_test_round_robin_split
(
excit_t
tleaf
,
const
ssize_t
depth
,
const
ssize_t
*
arities
)
{
ssize_t
i
,
value
,
size
,
cut_size
;
ssize_t
ncut
=
arities
[
0
];
assert
(
excit_size
(
tleaf
,
&
size
)
==
EXCIT_SUCCESS
);
cut_size
=
size
/
ncut
;
excit_t
*
split
=
malloc
(
sizeof
(
*
split
)
*
ncut
);
assert
(
split
!=
NULL
);
int
err
=
tleaf_it_split
(
tleaf
,
0
,
ncut
,
split
);
assert
(
err
==
EXCIT_SUCCESS
);
ssize_t
*
cut_sizes
=
malloc
(
sizeof
(
*
cut_sizes
)
*
ncut
);
assert
(
cut_sizes
!=
NULL
);
for
(
i
=
0
;
i
<
ncut
;
i
++
)
{
assert
(
excit_size
(
split
[
i
],
cut_sizes
+
i
)
==
EXCIT_SUCCESS
);
assert
(
cut_sizes
[
i
]
==
cut_size
);
}
for
(
i
=
0
;
i
<
size
;
i
++
)
{
excit_t
it
=
split
[
i
*
ncut
/
size
];
assert
(
excit_next
(
it
,
&
value
)
==
EXCIT_SUCCESS
);
assert
(
value
==
i
);
}
for
(
i
=
0
;
i
<
ncut
;
i
++
)
excit_free
(
split
[
i
]);
free
(
split
);
free
(
cut_sizes
);
}
static
void
tleaf_test_scatter_policy_no_split
(
excit_t
tleaf
,
const
ssize_t
depth
,
const
ssize_t
*
arities
)
...
...
@@ -73,6 +113,7 @@ void run_tests(const ssize_t depth, const ssize_t *arities)
create_test_tleaf
(
depth
,
arities
,
TLEAF_POLICY_ROUND_ROBIN
,
NULL
);
assert
(
rrobin
!=
NULL
);
tleaf_test_round_robin_split
(
rrobin
,
depth
,
arities
);
tleaf_test_round_robin_policy
(
rrobin
);
excit_free
(
rrobin
);
...
...
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