[libcxx] [test] Replace _LIBCPP_STD_VER with TEST_STD_VER.

This replaces every occurrence of _LIBCPP_STD_VER in the tests with
TEST_STD_VER. Additionally, for every affected
file, #include "test_macros.h" is being added explicitly if it wasn't
already there.

https://reviews.llvm.org/D26294

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286007 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Stephan T. Lavavej
2016-11-04 20:26:59 +00:00
parent f333beee2c
commit e619862dbf
252 changed files with 606 additions and 314 deletions

View File

@@ -32,7 +32,7 @@ void test_const_container( const C & c, typename C::value_type val ) {
assert (*std::begin(c) == val );
assert ( std::begin(c) != c.end());
assert ( std::end(c) == c.end());
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER > 11
assert ( std::cbegin(c) == c.cbegin());
assert ( std::cbegin(c) != c.cend());
assert ( std::cend(c) == c.cend());
@@ -51,7 +51,7 @@ void test_const_container( const std::initializer_list<T> & c, T val ) {
assert (*std::begin(c) == val );
assert ( std::begin(c) != c.end());
assert ( std::end(c) == c.end());
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER > 11
// initializer_list doesn't have cbegin/cend/rbegin/rend
// but std::cbegin(),etc work (b/c they're general fn templates)
// assert ( std::cbegin(c) == c.cbegin());
@@ -72,7 +72,7 @@ void test_container( C & c, typename C::value_type val ) {
assert (*std::begin(c) == val );
assert ( std::begin(c) != c.end());
assert ( std::end(c) == c.end());
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER > 11
assert ( std::cbegin(c) == c.cbegin());
assert ( std::cbegin(c) != c.cend());
assert ( std::cend(c) == c.cend());
@@ -91,7 +91,7 @@ void test_container( std::initializer_list<T> & c, T val ) {
assert (*std::begin(c) == val );
assert ( std::begin(c) != c.end());
assert ( std::end(c) == c.end());
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER > 11
// initializer_list doesn't have cbegin/cend/rbegin/rend
// assert ( std::cbegin(c) == c.cbegin());
// assert ( std::cbegin(c) != c.cend());
@@ -111,7 +111,7 @@ void test_const_array( const T (&array)[Sz] ) {
assert (*std::begin(array) == array[0] );
assert ( std::begin(array) != std::end(array));
assert ( std::end(array) == array + Sz);
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER > 11
assert ( std::cbegin(array) == array );
assert (*std::cbegin(array) == array[0] );
assert ( std::cbegin(array) != std::cend(array));
@@ -137,7 +137,7 @@ int main(){
static constexpr int arrA [] { 1, 2, 3 };
test_const_array ( arrA );
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER > 11
constexpr const int *b = std::cbegin(arrA);
constexpr const int *e = std::cend(arrA);
static_assert(e - b == 3, "");