diff options
Diffstat (limited to 'libcxx/test/std/numerics/rand')
4 files changed, 20 insertions, 12 deletions
diff --git a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp index 1c2b2a80c59..a5893ead732 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp @@ -17,6 +17,8 @@ #include <random> #include <cassert> +#include "test_macros.h" + template <class UIntType, UIntType Min, UIntType Max> class rand1 { @@ -30,14 +32,14 @@ private: static_assert(Min < Max, "rand1 invalid parameters"); public: -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION) // Workaround for lack of constexpr in C++03 static const result_type _Min = Min; static const result_type _Max = Max; #endif - static _LIBCPP_CONSTEXPR result_type min() {return Min;} - static _LIBCPP_CONSTEXPR result_type max() {return Max;} + static TEST_CONSTEXPR result_type min() {return Min;} + static TEST_CONSTEXPR result_type max() {return Max;} explicit rand1(result_type sd = Min) : x_(sd) { diff --git a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp index 78040ad987d..9ae95547801 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp @@ -19,6 +19,8 @@ #include <random> #include <type_traits> +#include "test_macros.h" + template <class UIntType, UIntType Min, UIntType Max> class rand1 { @@ -32,14 +34,14 @@ private: static_assert(Min < Max, "rand1 invalid parameters"); public: -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION) // Workaround for lack of constexpr in C++03 static const result_type _Min = Min; static const result_type _Max = Max; #endif - static _LIBCPP_CONSTEXPR result_type min() {return Min;} - static _LIBCPP_CONSTEXPR result_type max() {return Max;} + static TEST_CONSTEXPR result_type min() {return Min;} + static TEST_CONSTEXPR result_type max() {return Max;} explicit rand1(result_type sd = Min) : x_(sd) { diff --git a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp index c218c17dde6..d2a5292e132 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp @@ -17,6 +17,8 @@ #include <random> #include <cassert> +#include "test_macros.h" + template <class UIntType, UIntType Min, UIntType Max> class rand1 { @@ -30,14 +32,14 @@ private: static_assert(Min < Max, "rand1 invalid parameters"); public: -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION) // Workaround for lack of constexpr in C++03 static const result_type _Min = Min; static const result_type _Max = Max; #endif - static _LIBCPP_CONSTEXPR result_type min() {return Min;} - static _LIBCPP_CONSTEXPR result_type max() {return Max;} + static TEST_CONSTEXPR result_type min() {return Min;} + static TEST_CONSTEXPR result_type max() {return Max;} explicit rand1(result_type sd = Min) : x_(sd) { diff --git a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp index 3271d933cb2..a6f1eadb088 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp @@ -19,6 +19,8 @@ #include <random> #include <type_traits> +#include "test_macros.h" + template <class UIntType, UIntType Min, UIntType Max> class rand1 { @@ -32,14 +34,14 @@ private: static_assert(Min < Max, "rand1 invalid parameters"); public: -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION) // Workaround for lack of constexpr in C++03 static const result_type _Min = Min; static const result_type _Max = Max; #endif - static _LIBCPP_CONSTEXPR result_type min() {return Min;} - static _LIBCPP_CONSTEXPR result_type max() {return Max;} + static TEST_CONSTEXPR result_type min() {return Min;} + static TEST_CONSTEXPR result_type max() {return Max;} explicit rand1(result_type sd = Min) : x_(sd) { |

