mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 10:07:41 +08:00
Purge all usages of _LIBCPP_STD_VER under test/std/algorithm
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283643 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -17,11 +17,9 @@
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "test_iterators.h"
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
#define HAS_FOUR_ITERATOR_VERSION
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -31,7 +29,7 @@ int main()
|
||||
assert(std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ia)));
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ia),
|
||||
@@ -44,7 +42,7 @@ int main()
|
||||
assert(!std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ib)));
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(!std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ib),
|
||||
|
@@ -19,12 +19,9 @@
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "test_iterators.h"
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
#define HAS_FOUR_ITERATOR_VERSION
|
||||
#endif
|
||||
|
||||
int comparison_count = 0;
|
||||
template <typename T>
|
||||
bool counting_equals ( const T &a, const T &b ) {
|
||||
@@ -41,7 +38,7 @@ int main()
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ia),
|
||||
std::equal_to<int>()));
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ia),
|
||||
@@ -72,7 +69,7 @@ int main()
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ib),
|
||||
std::equal_to<int>()));
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(!std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ib),
|
||||
|
@@ -19,9 +19,7 @@
|
||||
|
||||
#include "test_iterators.h"
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
#define HAS_FOUR_ITERATOR_VERSION
|
||||
#endif
|
||||
#include "test_macros.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -32,7 +30,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + 0),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + 0),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -41,7 +39,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -59,7 +57,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -74,7 +72,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -92,7 +90,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -106,7 +104,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -120,7 +118,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -134,7 +132,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -148,7 +146,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -166,7 +164,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -180,7 +178,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -194,7 +192,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -208,7 +206,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -222,7 +220,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -236,7 +234,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -250,7 +248,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -264,7 +262,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -278,7 +276,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -292,7 +290,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -307,7 +305,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -321,7 +319,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -335,7 +333,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -349,7 +347,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -363,7 +361,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -377,7 +375,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -391,7 +389,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -405,7 +403,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -419,7 +417,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -433,7 +431,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -451,7 +449,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -465,7 +463,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -483,7 +481,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -501,7 +499,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -519,7 +517,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -537,7 +535,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -551,7 +549,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -573,7 +571,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -595,7 +593,7 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
|
@@ -18,12 +18,9 @@
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "test_iterators.h"
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
#define HAS_FOUR_ITERATOR_VERSION
|
||||
#endif
|
||||
|
||||
int comparison_count = 0;
|
||||
template <typename T>
|
||||
bool counting_equals ( const T &a, const T &b ) {
|
||||
@@ -46,7 +43,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -67,7 +64,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -84,7 +81,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -105,7 +102,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -121,7 +118,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -137,7 +134,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -153,7 +150,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -169,7 +166,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -190,7 +187,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -211,7 +208,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -227,7 +224,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -243,7 +240,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -264,7 +261,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -285,7 +282,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -301,7 +298,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -317,7 +314,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -333,7 +330,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -349,7 +346,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -371,7 +368,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -387,7 +384,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -403,7 +400,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -419,7 +416,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -435,7 +432,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -451,7 +448,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -467,7 +464,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -483,7 +480,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -499,7 +496,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -515,7 +512,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -536,7 +533,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -552,7 +549,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -573,7 +570,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -594,7 +591,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -615,7 +612,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -636,7 +633,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -652,7 +649,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -678,7 +675,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
@@ -718,7 +715,7 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
|
@@ -49,7 +49,7 @@ int main()
|
||||
assert(bcp.count() > 0 && bcp.count() < sa);
|
||||
bcp.reset();
|
||||
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::mismatch(II(ia), II(ia + sa), II(ib), II(ib + sb), EQ())
|
||||
== (std::pair<II, II>(II(ia+3), II(ib+3))));
|
||||
assert(std::mismatch(RAI(ia), RAI(ia + sa), RAI(ib), RAI(ib + sb), EQ())
|
||||
@@ -63,7 +63,7 @@ int main()
|
||||
assert(std::mismatch(ia, ia + sa, ib, EQ()) ==
|
||||
(std::pair<int*,int*>(ia+3,ib+3)));
|
||||
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::mismatch(ia, ia + sa, ib, ib + sb, EQ()) ==
|
||||
(std::pair<int*,int*>(ia+3,ib+3)));
|
||||
assert(std::mismatch(ia, ia + sa, ib, ib + 2, EQ()) ==
|
||||
|
Reference in New Issue
Block a user