diff options
Diffstat (limited to 'pstl/test/std/algorithms')
34 files changed, 79 insertions, 80 deletions
diff --git a/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp b/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp index 7a8d065f0de..9efe8f8d803 100644 --- a/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp +++ b/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp @@ -42,8 +42,6 @@ struct test_one_policy operator()(Policy&& exec, BiDirIt1 first1, BiDirIt1 last1, BiDirIt1 first2, BiDirIt1 last2, Size n, Size m, Generator1 generator1, Generator2 generator2, Compare comp) { - - using T = typename std::iterator_traits<BiDirIt1>::value_type; const BiDirIt1 mid1 = std::next(first1, m); fill_data(first1, mid1, generator1); fill_data(mid1, last1, generator2); @@ -60,8 +58,8 @@ struct test_one_policy template <typename Policy, typename BiDirIt1, typename Size, typename Generator1, typename Generator2, typename Compare> typename std::enable_if<is_same_iterator_category<BiDirIt1, std::forward_iterator_tag>::value, void>::type - operator()(Policy&& exec, BiDirIt1 first1, BiDirIt1 last1, BiDirIt1 first2, BiDirIt1 last2, Size n, Size m, - Generator1 generator1, Generator2 generator2, Compare comp) + operator()(Policy&&, BiDirIt1, BiDirIt1, BiDirIt1, BiDirIt1, Size, Size, + Generator1, Generator2, Compare) { } }; diff --git a/pstl/test/std/algorithms/alg.merge/merge.pass.cpp b/pstl/test/std/algorithms/alg.merge/merge.pass.cpp index b215beb10af..5912775f9e3 100644 --- a/pstl/test/std/algorithms/alg.merge/merge.pass.cpp +++ b/pstl/test/std/algorithms/alg.merge/merge.pass.cpp @@ -47,7 +47,7 @@ struct test_merge operator()(Policy&& exec, std::reverse_iterator<InputIterator1> first1, std::reverse_iterator<InputIterator1> last1, std::reverse_iterator<InputIterator2> first2, std::reverse_iterator<InputIterator2> last2, std::reverse_iterator<OutputIterator> out_first, std::reverse_iterator<OutputIterator> out_last, - Compare comp) + Compare) { using namespace std; typedef typename std::iterator_traits<std::reverse_iterator<InputIterator1>>::value_type T; 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 diff --git a/pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp index 2ad0c579755..2e7bdc6942c 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp @@ -59,7 +59,7 @@ test(size_t bits) { // Sequence of odd values - Sequence<T> in(n, [n, bits](size_t k) { return T(2 * HashBits(n, bits - 1) ^ 1); }); + Sequence<T> in(n, [n, bits](size_t) { return T(2 * HashBits(n, bits - 1) ^ 1); }); // Even value, or false when T is bool. T spike(2 * HashBits(n, bits - 1)); diff --git a/pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp index 9e8cbe56e87..0afab012bf7 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp @@ -45,7 +45,7 @@ test(size_t bits) { // Sequence of odd values - Sequence<T> in(n, [n, bits](size_t k) { return T(2 * HashBits(n, bits - 1) ^ 1); }); + Sequence<T> in(n, [n, bits](size_t) { return T(2 * HashBits(n, bits - 1) ^ 1); }); // Even value, or false when T is bool. T spike(2 * HashBits(n, bits - 1)); diff --git a/pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp index e1c649dacbe..952b145997c 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp @@ -93,7 +93,7 @@ main() { test<int32_t>(42, IsEqual<int32_t>(50, OddTag()), [](int32_t j) { return j; }); #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN - test<int32_t>(42, [](const int32_t& x) { return true; }, [](int32_t j) { return j; }); + test<int32_t>(42, [](const int32_t&) { return true; }, [](int32_t j) { return j; }); #endif test<float64_t>(42, IsEqual<float64_t>(50, OddTag()), [](int32_t j) { return float64_t(j); }); test<Number>(Number(42, OddTag()), IsEqual<Number>(Number(50, OddTag()), OddTag()), diff --git a/pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp index a5d5b8567de..35844095ab1 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp @@ -82,7 +82,7 @@ int32_t main() { // Note that the "hit" and "miss" functions here avoid overflow issues. - test<Number>(Weird(42, OddTag()), [](int32_t j) { return Number(42, OddTag()); }, // hit + test<Number>(Weird(42, OddTag()), [](int32_t) { return Number(42, OddTag()); }, // hit [](int32_t j) { return Number(j == 42 ? 0 : j, OddTag()); }); // miss // Test with value that is equal to two different bit patterns (-0.0 and 0.0) diff --git a/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp index 466314e643d..8d0d542cc06 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp @@ -68,8 +68,8 @@ test(const std::size_t bits) const std::size_t max_n1 = 1000; const std::size_t max_n2 = (max_n1 * 10) / 8; - Sequence<T> in(max_n1, [bits](std::size_t k) { return T(2 * HashBits(max_n1, bits - 1) ^ 1); }); - Sequence<T> sub(max_n2, [bits](std::size_t k) { return T(2 * HashBits(max_n1, bits - 1)); }); + Sequence<T> in(max_n1, [bits](std::size_t) { return T(2 * HashBits(max_n1, bits - 1) ^ 1); }); + Sequence<T> sub(max_n2, [bits](std::size_t) { return T(2 * HashBits(max_n1, bits - 1)); }); for (std::size_t n1 = 0; n1 <= max_n1; n1 = n1 <= 16 ? n1 + 1 : size_t(3.1415 * n1)) { std::size_t sub_n[] = {0, 1, 3, n1, (n1 * 10) / 8}; diff --git a/pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp index f0903313f0f..291cf256045 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp @@ -56,8 +56,8 @@ test(Predicate pred) const std::size_t max_n1 = 1000; const std::size_t max_n2 = (max_n1 * 10) / 8; - Sequence<T> in1(max_n1, [](std::size_t k) { return T(1); }); - Sequence<T> in2(max_n2, [](std::size_t k) { return T(0); }); + Sequence<T> in1(max_n1, [](std::size_t) { return T(1); }); + Sequence<T> in2(max_n2, [](std::size_t) { return T(0); }); for (std::size_t n1 = 0; n1 <= max_n1; n1 = n1 <= 16 ? n1 + 1 : size_t(3.1415 * n1)) { std::size_t sub_n[] = {0, 1, n1 / 3, n1, (n1 * 10) / 8}; diff --git a/pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp index 3abf7e3bd92..9ee5936e1d3 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp @@ -45,7 +45,7 @@ test(size_t bits) { // Sequence of odd values - Sequence<T> in(n, [n, bits](size_t k) { return T(2 * HashBits(n, bits - 1) ^ 1); }); + Sequence<T> in(n, [n, bits](size_t) { return T(2 * HashBits(n, bits - 1) ^ 1); }); // Even value, or false when T is bool. T spike(2 * HashBits(n, bits - 1)); diff --git a/pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp index 61fe8d7049d..0619338fbfd 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp @@ -111,8 +111,8 @@ struct test_one_policy template <typename Policy, typename Iterator1, typename Size, typename Generator1, typename Generator2, typename Compare> typename std::enable_if<!is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type - operator()(Policy&& exec, Iterator1 first1, Iterator1 last1, Iterator1 first2, Iterator1 last2, Size n, Size m, - Generator1 generator1, Generator2 generator2, Compare comp) + operator()(Policy&&, Iterator1, Iterator1, Iterator1, Iterator1, Size, Size, + Generator1, Generator2, Compare) { } }; diff --git a/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp index ac8a422698c..d5f090260a4 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp @@ -67,7 +67,7 @@ test() } for (auto r : res) { - Sequence<T> in(n1, [](std::size_t k) { return T(0); }); + Sequence<T> in(n1, [](std::size_t) { return T(0); }); std::size_t i = r, isub = 0; for (; i < n1 & isub < n2; ++i, ++isub) in[i] = value; diff --git a/pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp index bfee4bdffda..28827be9d0a 100644 --- a/pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp @@ -77,13 +77,14 @@ struct test_is_heap const Iterator actual = is_heap_until(exec, first, last, pred); const auto x = std::distance(first, actual); EXPECT_TRUE(expected == actual, "wrong return value from is_heap_until with predicate"); + EXPECT_EQ(x, y, "both iterators should be the same distance away from 'first'"); } } // is_heap, is_heap_until works only with random access iterators template <typename Policy, typename Iterator, typename Predicate> typename std::enable_if<!is_same_iterator_category<Iterator, std::random_access_iterator_tag>::value, void>::type - operator()(Policy&& exec, Iterator first, Iterator last, Predicate pred) + operator()(Policy&&, Iterator, Iterator, Predicate) { } }; @@ -111,7 +112,7 @@ test_is_heap_by_type(Comp comp) invoke_on_all_policies(test_is_heap(), in.cbegin(), in.cend(), comp); } - Sequence<T> in(max_size / 10, [](size_t v) -> T { return T(1); }); + Sequence<T> in(max_size / 10, [](size_t) -> T { return T(1); }); invoke_on_all_policies(test_is_heap(), in.begin(), in.end(), comp); } diff --git a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp index 431ce0d11cd..cc9b82453c3 100644 --- a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp @@ -55,8 +55,8 @@ struct test_one_policy template <typename Policy, typename InputIterator1, typename InputIterator2, typename Compare> typename std::enable_if<TestUtils::isReverse<InputIterator1>::value, void>::type - operator()(Policy&& exec, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, - Compare comp) + operator()(Policy&&, InputIterator1, InputIterator1, InputIterator2, InputIterator2, + Compare) { } }; diff --git a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp index 27e83a1129b..8ecb0b15bac 100644 --- a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp @@ -95,8 +95,8 @@ struct test_one_policy template <typename Policy, typename InputIterator1, typename InputIterator2, typename Compare> typename std::enable_if<TestUtils::isReverse<InputIterator1>::value, void>::type - operator()(Policy&& exec, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, - Compare comp) + operator()(Policy&&, InputIterator1, InputIterator1, InputIterator2, InputIterator2, + Compare) { } }; diff --git a/pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp b/pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp index e7d84f1441a..19de214270b 100644 --- a/pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp @@ -65,7 +65,7 @@ test_is_sorted_by_type() invoke_on_all_policies(test_is_sorted(), in0.cbegin(), in0.cend(), std::is_sorted(in0.begin(), in0.end())); //non-descending order - Sequence<T> in1(9, [](size_t v) -> T { return T(0); }); + Sequence<T> in1(9, [](size_t) -> T { return T(0); }); invoke_on_all_policies(test_is_sorted(), in1.begin(), in1.end(), std::is_sorted(in1.begin(), in1.end())); invoke_on_all_policies(test_is_sorted(), in1.cbegin(), in1.cend(), std::is_sorted(in1.begin(), in1.end())); } diff --git a/pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp b/pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp index 701fee2e867..827290d614e 100644 --- a/pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp @@ -78,19 +78,18 @@ struct test_brick_partial_sort //checking upper bound number of comparisons; O(p*(last-first)log(middle-first)); where p - number of threads; if (m1 - first > 1) { - auto complex = std::ceil(n * std::log(float32_t(m1 - first))); -#if defined(_PSTL_PAR_BACKEND_TBB) +#ifdef _DEBUG +# if defined(_PSTL_PAR_BACKEND_TBB) auto p = tbb::this_task_arena::max_concurrency(); -#else +# else auto p = 1; -#endif - -#ifdef _DEBUG +# endif + auto complex = std::ceil(n * std::log(float32_t(m1 - first))); if (count_comp > complex * p) { std::cout << "complexity exceeded" << std::endl; } -#endif +#endif // _DEBUG } } } @@ -98,8 +97,8 @@ struct test_brick_partial_sort template <typename Policy, typename InputIterator, typename Compare> typename std::enable_if<!is_same_iterator_category<InputIterator, std::random_access_iterator_tag>::value, void>::type - operator()(Policy&& exec, InputIterator first, InputIterator last, InputIterator exp_first, InputIterator exp_last, - Compare compare) + operator()(Policy&&, InputIterator, InputIterator, InputIterator, InputIterator, + Compare) { } }; diff --git a/pstl/test/std/algorithms/alg.sorting/sort.pass.cpp b/pstl/test/std/algorithms/alg.sorting/sort.pass.cpp index 2cdb24fbcaa..cccc92ec9ff 100644 --- a/pstl/test/std/algorithms/alg.sorting/sort.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/sort.pass.cpp @@ -160,7 +160,7 @@ struct test_sort_with_compare typename std::enable_if<is_same_iterator_category<InputIterator, std::random_access_iterator_tag>::value, void>::type operator()(Policy&& exec, OutputIterator tmp_first, OutputIterator tmp_last, OutputIterator2 expected_first, - OutputIterator2 expected_last, InputIterator first, InputIterator last, Size n, Compare compare) + OutputIterator2 expected_last, InputIterator first, InputIterator, Size n, Compare compare) { using namespace std; copy_n(first, n, expected_first); @@ -187,8 +187,8 @@ struct test_sort_with_compare typename Compare> typename std::enable_if<!is_same_iterator_category<InputIterator, std::random_access_iterator_tag>::value, void>::type - operator()(Policy&& exec, OutputIterator tmp_first, OutputIterator tmp_last, OutputIterator2 expected_first, - OutputIterator2 expected_last, InputIterator first, InputIterator last, Size n, Compare compare) + operator()(Policy&&, OutputIterator, OutputIterator, OutputIterator2, + OutputIterator2, InputIterator, InputIterator, Size, Compare) { } }; |