Changeset View
Changeset View
Standalone View
Standalone View
test/std/algorithms/alg.nonmodifying/count.pass.cpp
- This file was moved from test/test_count.cpp.
// -*- C++ -*- | // -*- C++ -*- | ||||
//===-- test_count.cpp ----------------------------------------------------===// | //===-- test_count.cpp ----------------------------------------------------===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// Tests for count and count_if | // Tests for count and count_if | ||||
#include "pstl_test_config.h" | #include "support/pstl_test_config.h" | ||||
#ifdef PSTL_STANDALONE_TESTS | |||||
#include "pstl/execution" | #include "pstl/execution" | ||||
#include "pstl/algorithm" | #include "pstl/algorithm" | ||||
#include "utils.h" | #else | ||||
#include <execution> | |||||
#include <algorithm> | |||||
#endif // PSTL_STANDALONE_TESTS | |||||
using namespace TestUtils; | #include "support/parallel_utils.h" | ||||
using namespace Parallel_TestUtils; | |||||
struct test_count | struct test_count | ||||
{ | { | ||||
template <typename Policy, typename Iterator, typename T> | template <typename Policy, typename Iterator, typename T> | ||||
void | void | ||||
operator()(Policy&& exec, Iterator first, Iterator last, T needle) | operator()(Policy&& exec, Iterator first, Iterator last, T needle) | ||||
{ | { | ||||
auto expected = std::count(first, last, needle); | auto expected = std::count(first, last, needle); | ||||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |