Move test into test/std subdirectory.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224658 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2014-12-20 01:40:03 +00:00
parent 669a8a5a19
commit a90c6dd460
4817 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <algorithm>
// template<InputIterator Iter, class T>
// requires HasEqualTo<Iter::value_type, T>
// Iter
// find(Iter first, Iter last, const T& value);
#include <algorithm>
#include <cassert>
#include "test_iterators.h"
int main()
{
int ia[] = {0, 1, 2, 3, 4, 5};
const unsigned s = sizeof(ia)/sizeof(ia[0]);
input_iterator<const int*> r = std::find(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s), 3);
assert(*r == 3);
r = std::find(input_iterator<const int*>(ia), input_iterator<const int*>(ia+s), 10);
assert(r == input_iterator<const int*>(ia+s));
}

View File

@@ -0,0 +1,35 @@
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <algorithm>
// template<InputIterator Iter, Predicate<auto, Iter::value_type> Pred>
// requires CopyConstructible<Pred>
// Iter
// find_if(Iter first, Iter last, Pred pred);
#include <algorithm>
#include <functional>
#include <cassert>
#include "test_iterators.h"
int main()
{
int ia[] = {0, 1, 2, 3, 4, 5};
const unsigned s = sizeof(ia)/sizeof(ia[0]);
input_iterator<const int*> r = std::find_if(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
std::bind2nd(std::equal_to<int>(), 3));
assert(*r == 3);
r = std::find_if(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
std::bind2nd(std::equal_to<int>(), 10));
assert(r == input_iterator<const int*>(ia+s));
}

View File

@@ -0,0 +1,35 @@
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <algorithm>
// template<InputIterator Iter, Predicate<auto, Iter::value_type> Pred>
// requires CopyConstructible<Pred>
// Iter
// find_if_not(Iter first, Iter last, Pred pred);
#include <algorithm>
#include <functional>
#include <cassert>
#include "test_iterators.h"
int main()
{
int ia[] = {0, 1, 2, 3, 4, 5};
const unsigned s = sizeof(ia)/sizeof(ia[0]);
input_iterator<const int*> r = std::find_if_not(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
std::bind2nd(std::not_equal_to<int>(), 3));
assert(*r == 3);
r = std::find_if_not(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
std::bind2nd(std::not_equal_to<int>(), 10));
assert(r == input_iterator<const int*>(ia+s));
}