Changeset View
Changeset View
Standalone View
Standalone View
test/std/algorithms/alg.nonmodifying/any_of.pass.cpp
- This file was moved from test/test_any_of.cpp.
// -*- C++ -*- | // -*- C++ -*- | ||||
//===-- test_any_of.cpp ---------------------------------------------------===// | //===-- any_of.pass.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 | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#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 | |||||
#include "support/parallel_utils.h" | |||||
/* | /* | ||||
TODO: consider implementing the following tests for a better code coverage | TODO: consider implementing the following tests for a better code coverage | ||||
- correctness | - correctness | ||||
- bad input argument (if applicable) | - bad input argument (if applicable) | ||||
- data corruption around/of input and output | - data corruption around/of input and output | ||||
- correctly work with nested parallelism | - correctly work with nested parallelism | ||||
- check that algorithm does not require anything more than is described in its requirements section | - check that algorithm does not require anything more than is described in its requirements section | ||||
*/ | */ | ||||
using namespace TestUtils; | using namespace Parallel_TestUtils; | ||||
struct test_any_of | struct test_any_of | ||||
{ | { | ||||
template <typename ExecutionPolicy, typename Iterator, typename Predicate> | template <typename ExecutionPolicy, typename Iterator, typename Predicate> | ||||
void | void | ||||
operator()(ExecutionPolicy&& exec, Iterator begin, Iterator end, Predicate pred, bool expected) | operator()(ExecutionPolicy&& exec, Iterator begin, Iterator end, Predicate pred, bool expected) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |