[libcxx] [test] Strip trailing whitespace, NFC.

llvm-svn: 309463
This commit is contained in:
Stephan T. Lavavej 2017-07-29 00:54:49 +00:00
parent e574034f28
commit 8980b8ad9c
5 changed files with 17 additions and 19 deletions

View File

@ -13,7 +13,7 @@
// template<class InputIterator, class OutputIterator, class T>
// OutputIterator inclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result, T init);
//
//
#include <numeric>
#include <vector>
@ -26,7 +26,7 @@ void
test(Iter1 first, Iter1 last, Iter2 rFirst, Iter2 rLast)
{
std::vector<typename std::iterator_traits<Iter1>::value_type> v;
// Not in place
std::inclusive_scan(first, last, std::back_inserter(v));
assert(std::equal(v.begin(), v.end(), rFirst, rLast));
@ -35,7 +35,7 @@ test(Iter1 first, Iter1 last, Iter2 rFirst, Iter2 rLast)
v.clear();
v.assign(first, last);
std::inclusive_scan(v.begin(), v.end(), v.begin());
assert(std::equal(v.begin(), v.end(), rFirst, rLast));
assert(std::equal(v.begin(), v.end(), rFirst, rLast));
}

View File

@ -13,7 +13,7 @@
// template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
// OutputIterator
// inclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result,
// OutputIterator result,
// BinaryOperation binary_op); // C++17
#include <numeric>
@ -37,7 +37,7 @@ test(Iter1 first, Iter1 last, Op op, Iter2 rFirst, Iter2 rLast)
v.clear();
v.assign(first, last);
std::inclusive_scan(v.begin(), v.end(), v.begin(), op);
assert(std::equal(v.begin(), v.end(), rFirst, rLast));
assert(std::equal(v.begin(), v.end(), rFirst, rLast));
}
@ -99,7 +99,7 @@ int main()
{
basic_tests();
// All the iterator categories
// test<input_iterator <const int*> >();
// test<forward_iterator <const int*> >();
@ -109,4 +109,3 @@ int main()
// test< int*>();
}

View File

@ -13,7 +13,7 @@
// template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
// OutputIterator
// inclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result,
// OutputIterator result,
// BinaryOperation binary_op, T init); // C++17
#include <numeric>
@ -36,7 +36,7 @@ test(Iter1 first, Iter1 last, Op op, T init, Iter2 rFirst, Iter2 rLast)
v.clear();
v.assign(first, last);
std::inclusive_scan(v.begin(), v.end(), v.begin(), op, init);
assert(std::equal(v.begin(), v.end(), rFirst, rLast));
assert(std::equal(v.begin(), v.end(), rFirst, rLast));
}
@ -115,7 +115,7 @@ int main()
{
basic_tests();
// All the iterator categories
test<input_iterator <const int*> >();
test<forward_iterator <const int*> >();
@ -125,4 +125,3 @@ int main()
test< int*>();
}

View File

@ -10,7 +10,7 @@
// <numeric>
// UNSUPPORTED: c++98, c++03, c++11, c++14
// template<class InputIterator, class OutputIterator, class T,
// template<class InputIterator, class OutputIterator, class T,
// class BinaryOperation, class UnaryOperation>
// OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result,
@ -64,7 +64,7 @@ test()
{
int ia[] = { 1, 3, 5, 7, 9};
const int pResI0[] = { 1, 4, 9, 16, 25}; // with identity
const int mResI0[] = { 1, 3, 15, 105, 945};
const int mResI0[] = { 1, 3, 15, 105, 945};
const int pResN0[] = { -1, -4, -9, -16, -25}; // with negate
const int mResN0[] = { -1, 3, -15, 105, -945};
const unsigned sa = sizeof(ia) / sizeof(ia[0]);
@ -91,7 +91,7 @@ void basic_tests()
std::fill(v.begin(), v.end(), 3);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>());
std::copy(v.begin(), v.end(), std::ostream_iterator<int>(std::cout, " "));
std::cout << std::endl;
std::cout << std::endl;
for (size_t i = 0; i < v.size(); ++i)
assert(v[i] == (int)(i+1) * 3);
}
@ -122,7 +122,7 @@ void basic_tests()
int main()
{
basic_tests();
// All the iterator categories
test<input_iterator <const int*> >();
test<forward_iterator <const int*> >();

View File

@ -10,7 +10,7 @@
// <numeric>
// UNSUPPORTED: c++98, c++03, c++11, c++14
// template<class InputIterator, class OutputIterator, class T,
// template<class InputIterator, class OutputIterator, class T,
// class BinaryOperation, class UnaryOperation>
// OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result,
@ -64,11 +64,11 @@ test()
{
int ia[] = { 1, 3, 5, 7, 9};
const int pResI0[] = { 1, 4, 9, 16, 25}; // with identity
const int mResI0[] = { 0, 0, 0, 0, 0};
const int mResI0[] = { 0, 0, 0, 0, 0};
const int pResN0[] = { -1, -4, -9, -16, -25}; // with negate
const int mResN0[] = { 0, 0, 0, 0, 0};
const int pResI2[] = { 3, 6, 11, 18, 27}; // with identity
const int mResI2[] = { 2, 6, 30, 210, 1890};
const int mResI2[] = { 2, 6, 30, 210, 1890};
const int pResN2[] = { 1, -2, -7, -14, -23}; // with negate
const int mResN2[] = { -2, 6, -30, 210, -1890};
const unsigned sa = sizeof(ia) / sizeof(ia[0]);
@ -149,7 +149,7 @@ void basic_tests()
int main()
{
basic_tests();
// All the iterator categories
test<input_iterator <const int*> >();
test<forward_iterator <const int*> >();