diff options
Diffstat (limited to 'pstl/test/std/algorithms/alg.modifying.operations')
17 files changed, 45 insertions, 44 deletions
diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp index d2bb83b6327..e0bd44d722f 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp @@ -42,7 +42,7 @@ struct run_copy_if typename Predicate, typename T> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size n, + OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n, Predicate pred, T trash) { // Cleaning @@ -135,7 +135,7 @@ main() #endif #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN - test<int32_t>(-666, [](const int32_t& x) { return true; }, [](size_t j) { return j; }, false); + test<int32_t>(-666, [](const int32_t&) { return true; }, [](size_t j) { return j; }, false); #endif test_algo_basic_double<int32_t>(run_for_rnd_fw<test_non_const>()); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp index 874595f2f14..d2608cf6e43 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp @@ -89,7 +89,7 @@ main() test<int32_t>([](const int32_t x) { return x > 1000; }); test<uint16_t>([](const uint16_t x) { return x % 5 < 3; }); #if !_PSTL_ICC_18_TEST_EARLY_EXIT_MONOTONIC_RELEASE_BROKEN && !_PSTL_ICC_19_TEST_IS_PARTITIONED_RELEASE_BROKEN - test<LocalWrapper<float64_t>>([](const LocalWrapper<float64_t>& x) { return true; }); + test<LocalWrapper<float64_t>>([](const LocalWrapper<float64_t>&) { return true; }); #endif test_algo_basic_single<int32_t>(run_for_rnd_fw<test_non_const>()); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp index 716f6dd3e32..98b0e516114 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp @@ -55,7 +55,7 @@ is_equal(Iterator first, Iterator last, Iterator d_first) template <typename Iterator> typename std::enable_if<!std::is_trivial<typename std::iterator_traits<Iterator>::value_type>::value, bool>::type -is_equal(Iterator first, Iterator last, Iterator d_first) +is_equal(Iterator, Iterator, Iterator) { return true; } @@ -95,7 +95,7 @@ struct test_one_policy template <typename Policy, typename BiDirIt, typename Size, typename UnaryOp, typename Generator> typename std::enable_if<!is_same_iterator_category<BiDirIt, std::forward_iterator_tag>::value, void>::type - operator()(Policy&& exec, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, Size n, + operator()(Policy&& exec, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, Size, UnaryOp unary_op, Generator generator) { // partition @@ -119,8 +119,8 @@ struct test_one_policy } template <typename Policy, typename BiDirIt, typename Size, typename UnaryOp, typename Generator> typename std::enable_if<is_same_iterator_category<BiDirIt, std::forward_iterator_tag>::value, void>::type - operator()(Policy&& exec, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, Size n, - UnaryOp unary_op, Generator generator) + operator()(Policy&&, BiDirIt, BiDirIt, BiDirIt, BiDirIt, Size, + UnaryOp, Generator) { } }; diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp index dfb76e3321c..6dc993809ea 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp @@ -25,7 +25,7 @@ struct test_partition_copy typename UnaryOp> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator true_first, - OutputIterator true_last, OutputIterator2 false_first, OutputIterator2 false_last, UnaryOp unary_op) + OutputIterator, OutputIterator2 false_first, OutputIterator2, UnaryOp unary_op) { auto actual_ret = std::partition_copy(exec, first, last, true_first, false_first, unary_op); @@ -101,7 +101,7 @@ main() test<int32_t>([](const int32_t value) { return value % 2; }); #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN - test<int32_t>([](const int32_t value) { return true; }); + test<int32_t>([](const int32_t) { return true; }); #endif test<float64_t>([](const float64_t value) { return value > 2 << 6; }); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp index 9d4615c356e..01330196fc7 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp @@ -52,7 +52,7 @@ struct test_one_policy template <typename ExecutionPolicy, typename Iterator1, typename Iterator2> typename std::enable_if<is_same_iterator_category<Iterator1, std::forward_iterator_tag>::value>::type - operator()(ExecutionPolicy&& exec, Iterator1 data_b, Iterator1 data_e, Iterator2 actual_b, Iterator2 actual_e) + operator()(ExecutionPolicy&&, Iterator1, Iterator1, Iterator2, Iterator2) { } }; diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp index 3edd3e87599..cc2bf186862 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp @@ -79,7 +79,6 @@ struct test_one_policy { using namespace std; using T = typename iterator_traits<Iterator1>::value_type; - using DifferenceType = typename iterator_traits<Iterator1>::difference_type; fill(actual_b, actual_e, T(-123)); Iterator1 actual_return = reverse_copy(exec, data_b, data_e, actual_b); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp index 18ba11b1c5d..cf395eba801 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp @@ -44,7 +44,7 @@ struct run_copy typename T> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size size, + OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size size, Size n, T trash) { // Cleaning @@ -96,8 +96,8 @@ struct run_move template <typename Policy, typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size size, - Size n, T trash) + OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size size, + Size, T trash) { // Cleaning std::fill_n(expected_first, size, trash); @@ -139,8 +139,8 @@ struct run_move<Wrapper<T>> template <typename Policy, typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size size, - Size n, Wrapper<T> trash) + OutputIterator out_last, OutputIterator2, OutputIterator2, Size size, + Size, Wrapper<T> trash) { // Cleaning std::fill_n(out_first, size, trash); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp index d54a7defb65..f1ddf5d3095 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp @@ -73,7 +73,7 @@ template <typename T> void test_fill_by_type(std::size_t n) { - Sequence<T> in(n, [](std::size_t v) -> T { return T(0); }); //fill with zeros + Sequence<T> in(n, [](std::size_t) -> T { return T(0); }); //fill with zeros T value = -1; invoke_on_all_policies(test_fill(), in.begin(), in.end(), value); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp index 185e98c86d2..89aa004621f 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp @@ -54,11 +54,11 @@ struct test_generate { Generator_count<T> g; const auto m = n / 2; - auto last = generate_n(exec, first, m, g); - Size count = std::count(first, last, g.default_value()); - EXPECT_TRUE(count == m && last == std::next(first, m), + auto actual_last = generate_n(exec, first, m, g); + Size count = std::count(first, actual_last, g.default_value()); + EXPECT_TRUE(count == m && actual_last == std::next(first, m), "generate_n wrong result for generate_n"); - std::fill(first, last, T(0)); + std::fill(first, actual_last, T(0)); } } }; @@ -69,7 +69,7 @@ test_generate_by_type() { for (size_t n = 0; n <= 100000; n = n < 16 ? n + 1 : size_t(3.1415 * n)) { - Sequence<T> in(n, [](size_t v) -> T { return T(0); }); //fill by zero + Sequence<T> in(n, [](size_t) -> T { return T(0); }); //fill by zero invoke_on_all_policies(test_generate(), in.begin(), in.end(), in.size()); } diff --git a/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp index 010e3c6f616..6c56729d21e 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp @@ -132,7 +132,7 @@ int32_t main() { #if !_PSTL_ICC_18_TEST_EARLY_EXIT_MONOTONIC_RELEASE_BROKEN - test<int32_t>(666, 42, [](int32_t val) { return true; }, [](size_t j) { return j; }); + test<int32_t>(666, 42, [](int32_t) { return true; }, [](size_t j) { return j; }); #endif test<int32_t>(666, 2001, [](const int32_t& val) { return val != 2001; }, diff --git a/pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp index 1dabb811fe9..a21afad742f 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp @@ -22,7 +22,7 @@ struct run_remove_copy typename T> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size n, + OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n, const T& value, T trash) { // Cleaning @@ -30,8 +30,9 @@ struct run_remove_copy std::fill_n(out_first, n, trash); // Run copy_if - auto i = remove_copy(first, last, expected_first, value); - auto k = remove_copy(exec, first, last, out_first, value); + auto i = std::remove_copy(first, last, expected_first, value); + (void)i; + auto k = std::remove_copy(exec, first, last, out_first, value); EXPECT_EQ_N(expected_first, out_first, n, "wrong remove_copy effect"); for (size_t j = 0; j < GuardSize; ++j) { diff --git a/pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp index 9f172a4b97a..fc5f1533e8c 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp @@ -21,9 +21,9 @@ struct copy_int { int32_t value; int32_t copied_times = 0; - explicit copy_int(int32_t val = 0) { value = val; } + constexpr explicit copy_int(int32_t val = 0) : value(val) { } - copy_int& + constexpr copy_int& operator=(const copy_int& other) { if (&other == this) @@ -36,7 +36,7 @@ struct copy_int return *this; } - bool + constexpr bool operator==(const copy_int& other) const { return (value == other.value); @@ -81,7 +81,7 @@ struct test_one_policy template <typename T, typename Iterator1> bool - check(Iterator1 b, Iterator1 e) + check(Iterator1, Iterator1) { return true; } @@ -102,13 +102,13 @@ test(Pred pred) const std::size_t max_len = 100000; - const T1 value = T1(0); - const T1 new_value = T1(666); + static constexpr T1 value = T1(0); + static constexpr T1 new_value = T1(666); Sequence<T2> expected(max_len); Sequence<T2> actual(max_len); - Sequence<T2> data(max_len, [&value](std::size_t i) { + Sequence<T2> data(max_len, [](std::size_t i) { if (i % 3 == 2) { return T1(i); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp index b6700f13e21..da74127765c 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp @@ -24,7 +24,7 @@ struct test_replace_copy typename Predicate, typename T> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size n, + OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n, Predicate pred, const T& old_value, const T& new_value, T trash) { // Cleaning diff --git a/pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp index 4a4d07229ff..b4e68736c42 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp @@ -115,7 +115,7 @@ struct test_one_policy !std::is_same<ExecutionPolicy, std::execution::sequenced_policy>::value && std::is_same<typename std::iterator_traits<Iterator>::value_type, wrapper<float32_t>>::value, bool>::type - check_move(ExecutionPolicy&& exec, Iterator b, Iterator e, Size shift) + check_move(ExecutionPolicy&&, Iterator b, Iterator e, Size shift) { bool result = all_of(b, e, [](wrapper<float32_t>& a) { bool temp = a.move_count > 0; @@ -131,7 +131,7 @@ struct test_one_policy !std::is_same<ExecutionPolicy, std::execution::sequenced_policy>::value && std::is_same<typename std::iterator_traits<Iterator>::value_type, wrapper<float32_t>>::value), bool>::type - check_move(ExecutionPolicy&& exec, Iterator b, Iterator e, Size shift) + check_move(ExecutionPolicy&&, Iterator, Iterator, Size) { return true; } diff --git a/pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp index 1f4031b4f31..87472d6a34c 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp @@ -50,7 +50,7 @@ template <typename T> struct check_swap { bool - operator()(T& a) + operator()(T&) { return true; } diff --git a/pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp index e440d6708c8..ef9e1c28a8b 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp @@ -60,10 +60,11 @@ struct test_one_policy template <typename Policy, typename InputIterator1, typename InputIterator2, typename OutputIterator, typename BinaryOp> void - operator()(Policy&& exec, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, - OutputIterator out_first, OutputIterator out_last, BinaryOp op) + operator()(Policy&& exec, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2, + OutputIterator out_first, OutputIterator, BinaryOp op) { - auto orrr = std::transform(exec, first1, last1, first2, out_first, op); + auto result = std::transform(exec, first1, last1, first2, out_first, op); + (void)result; check_and_reset(first1, last1, first2, out_first); } }; @@ -77,7 +78,7 @@ test(Predicate pred) Sequence<In1> in1(n, [](size_t k) { return k % 5 != 1 ? 3 * k - 7 : 0; }); Sequence<In2> in2(n, [](size_t k) { return k % 7 != 2 ? 5 * k - 5 : 0; }); - Sequence<Out> out(n, [](size_t k) { return -1; }); + Sequence<Out> out(n, [](size_t) { return -1; }); invoke_on_all_policies(test_one_policy(), in1.begin(), in1.end(), in2.begin(), in2.end(), out.begin(), out.end(), pred); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp index a3adb20bfc7..9183e3d863a 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp @@ -43,7 +43,7 @@ struct run_unique_copy typename Predicate, typename T> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size n, + OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n, Predicate pred, T trash) { // Cleaning @@ -114,7 +114,7 @@ struct test_non_const }; int32_t -main(int32_t argc, char* argv[]) +main() { test<Number>(Number(42, OddTag()), std::equal_to<Number>(), [](int32_t j) { return Number(3 * j / 13 ^ (j & 8), OddTag()); }); @@ -122,7 +122,7 @@ main(int32_t argc, char* argv[]) test<float32_t>(float32_t(42), std::equal_to<float32_t>(), [](int32_t j) { return float32_t(5 * j / 23 ^ (j / 7)); }); #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN - test<float32_t>(float32_t(42), [](float32_t x, float32_t y) { return false; }, + test<float32_t>(float32_t(42), [](float32_t, float32_t) { return false; }, [](int32_t j) { return float32_t(j); }, false); #endif |