Skip to content

Commit 8b88844

Browse files
test/parallel_api/ranges/std_ranges_test.h - introduce struct test::kParts
1 parent 63cf21d commit 8b88844

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

test/parallel_api/ranges/std_ranges_test.h

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ struct test
269269
template <typename T>
270270
using TmpContainerType = std::array<T,0>;
271271

272+
static constexpr int kParts = 2;
273+
272274
// Test dangling iterators in return types for call with temporary data
273275
template <int idx, typename Policy, typename Algo, typename ...Args>
274276
constexpr void
@@ -455,11 +457,12 @@ struct test
455457
operator()(int max_n, Policy&& exec, Algo algo, Checker& checker, auto... args)
456458
{
457459
const int r_size = max_n;
460+
458461
process_data_in_out(max_n, r_size, r_size, CLONE_TEST_POLICY(exec), algo, checker, args...);
459462

460463
//test case size of input range is less than size of output and vice-versa
461-
process_data_in_out(max_n, r_size/2, r_size, CLONE_TEST_POLICY(exec), algo, checker, args...);
462-
process_data_in_out(max_n, r_size, r_size/2, CLONE_TEST_POLICY(exec), algo, checker, args...);
464+
process_data_in_out(max_n, r_size / kParts, r_size, CLONE_TEST_POLICY(exec), algo, checker, args...);
465+
process_data_in_out(max_n, r_size, r_size / kParts, CLONE_TEST_POLICY(exec), algo, checker, args...);
463466

464467
//test cases with empty sequence(s)
465468
process_data_in_out(max_n, 0, 0, CLONE_TEST_POLICY(exec), algo, checker, args...);
@@ -470,11 +473,12 @@ struct test
470473
operator()(int max_n, Policy&& exec, Algo algo, Checker& checker, TransIn tr_in, TransOut, auto... args)
471474
{
472475
const int r_size = max_n;
476+
473477
process_data_in_in(max_n, r_size, r_size, CLONE_TEST_POLICY(exec), algo, checker, tr_in, args...);
474478

475479
//test case the sizes of input ranges are different
476-
process_data_in_in(max_n, r_size/2, r_size, CLONE_TEST_POLICY(exec), algo, checker, tr_in, args...);
477-
process_data_in_in(max_n, r_size, r_size/2, CLONE_TEST_POLICY(exec), algo, checker, tr_in, args...);
480+
process_data_in_in(max_n, r_size / kParts, r_size, CLONE_TEST_POLICY(exec), algo, checker, tr_in, args...);
481+
process_data_in_in(max_n, r_size, r_size / kParts, CLONE_TEST_POLICY(exec), algo, checker, tr_in, args...);
478482

479483
//test cases with empty sequence(s)
480484
process_data_in_in(max_n, 0, 0, CLONE_TEST_POLICY(exec), algo, checker, tr_in, args...);
@@ -573,24 +577,25 @@ struct test
573577
operator()(int max_n, Policy&& exec, Algo algo, Checker& checker, auto... args)
574578
{
575579
const int r_size = max_n;
576-
process_data_in_in_out(max_n, r_size, r_size, r_size*2, CLONE_TEST_POLICY(exec), algo, checker, args...);
580+
process_data_in_in_out(max_n, r_size, r_size, r_size * kParts, CLONE_TEST_POLICY(exec), algo, checker, args...);
577581

578582
//test cases with empty sequence(s)
579-
process_data_in_in_out(max_n, 0, 0, 0, CLONE_TEST_POLICY(exec), algo, checker, args...);
580-
process_data_in_in_out(max_n, 0, r_size, out_size_with_empty_in1<Algo>(r_size), CLONE_TEST_POLICY(exec), algo, checker, args...);
581-
process_data_in_in_out(max_n, r_size, 0, out_size_with_empty_in2<Algo>(r_size), CLONE_TEST_POLICY(exec), algo, checker, args...);
583+
process_data_in_in_out(max_n, 0, 0, 0, CLONE_TEST_POLICY(exec), algo, checker, args...);
584+
process_data_in_in_out(max_n, 0, r_size, out_size_with_empty_in1<Algo>(r_size), CLONE_TEST_POLICY(exec), algo, checker, args...);
585+
process_data_in_in_out(max_n, r_size, 0, out_size_with_empty_in2<Algo>(r_size), CLONE_TEST_POLICY(exec), algo, checker, args...);
582586
}
583587

584588
template<typename Policy, typename Algo, typename Checker, TestDataMode mode = test_mode>
585589
std::enable_if_t<mode == data_in_in_out_lim>
586590
operator()(int max_n, Policy&& exec, Algo algo, Checker& checker, auto... args)
587591
{
588592
const int r_size = max_n;
589-
process_data_in_in_out(max_n, r_size, r_size, r_size, CLONE_TEST_POLICY(exec), algo, checker, args...);
590-
process_data_in_in_out(max_n, r_size, r_size, r_size*2, CLONE_TEST_POLICY(exec), algo, checker, args...);
591-
process_data_in_in_out(max_n, r_size/2, r_size, r_size, CLONE_TEST_POLICY(exec), algo, checker, args...);
592-
process_data_in_in_out(max_n, r_size, r_size/2, r_size, CLONE_TEST_POLICY(exec), algo, checker, args...);
593-
process_data_in_in_out(max_n, r_size, r_size, r_size/2, CLONE_TEST_POLICY(exec), algo, checker, args...);
593+
594+
process_data_in_in_out(max_n, r_size, r_size, r_size, CLONE_TEST_POLICY(exec), algo, checker, args...);
595+
process_data_in_in_out(max_n, r_size, r_size, r_size * kParts, CLONE_TEST_POLICY(exec), algo, checker, args...);
596+
process_data_in_in_out(max_n, r_size / kParts, r_size, r_size, CLONE_TEST_POLICY(exec), algo, checker, args...);
597+
process_data_in_in_out(max_n, r_size, r_size / kParts, r_size, CLONE_TEST_POLICY(exec), algo, checker, args...);
598+
process_data_in_in_out(max_n, r_size, r_size, r_size / kParts, CLONE_TEST_POLICY(exec), algo, checker, args...);
594599

595600
//test cases with empty sequence(s)
596601
process_data_in_in_out(max_n, 0, 0, 0, CLONE_TEST_POLICY(exec), algo, checker, args...);

0 commit comments

Comments
 (0)