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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309463 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Stephan T. Lavavej
2017-07-29 00:54:49 +00:00
parent 6e76840323
commit 62e519c2f9
5 changed files with 17 additions and 19 deletions

View File

@@ -13,7 +13,7 @@
// template<class InputIterator, class OutputIterator, class T> // template<class InputIterator, class OutputIterator, class T>
// OutputIterator inclusive_scan(InputIterator first, InputIterator last, // OutputIterator inclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result, T init); // OutputIterator result, T init);
// //
#include <numeric> #include <numeric>
#include <vector> #include <vector>
@@ -26,7 +26,7 @@ void
test(Iter1 first, Iter1 last, Iter2 rFirst, Iter2 rLast) test(Iter1 first, Iter1 last, Iter2 rFirst, Iter2 rLast)
{ {
std::vector<typename std::iterator_traits<Iter1>::value_type> v; std::vector<typename std::iterator_traits<Iter1>::value_type> v;
// Not in place // Not in place
std::inclusive_scan(first, last, std::back_inserter(v)); std::inclusive_scan(first, last, std::back_inserter(v));
assert(std::equal(v.begin(), v.end(), rFirst, rLast)); 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.clear();
v.assign(first, last); v.assign(first, last);
std::inclusive_scan(v.begin(), v.end(), v.begin()); 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> // template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
// OutputIterator // OutputIterator
// inclusive_scan(InputIterator first, InputIterator last, // inclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result, // OutputIterator result,
// BinaryOperation binary_op); // C++17 // BinaryOperation binary_op); // C++17
#include <numeric> #include <numeric>
@@ -37,7 +37,7 @@ test(Iter1 first, Iter1 last, Op op, Iter2 rFirst, Iter2 rLast)
v.clear(); v.clear();
v.assign(first, last); v.assign(first, last);
std::inclusive_scan(v.begin(), v.end(), v.begin(), op); 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(); basic_tests();
// All the iterator categories // All the iterator categories
// test<input_iterator <const int*> >(); // test<input_iterator <const int*> >();
// test<forward_iterator <const int*> >(); // test<forward_iterator <const int*> >();
@@ -109,4 +109,3 @@ int main()
// test< int*>(); // test< int*>();
} }

View File

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

View File

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

View File

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