diff options
Diffstat (limited to 'test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp')
-rw-r--r-- | test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp index 857a478a5579..cd496fdbc5e0 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp +++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp @@ -37,8 +37,27 @@ test1() static_assert((LCE::multiplier == a), ""); static_assert((LCE::increment == c), ""); static_assert((LCE::modulus == m), ""); - /*static_*/assert((LCE::min() == (c == 0u ? 1u: 0u))/*, ""*/); - /*static_*/assert((LCE::max() == result_type(m - 1u))/*, ""*/); +#if TEST_STD_VER >= 11 + static_assert((LCE::min() == (c == 0u ? 1u: 0u)), ""); +#else + assert((LCE::min() == (c == 0u ? 1u: 0u))); +#endif + +#ifdef _MSC_VER + #pragma warning(push) + #pragma warning(disable: 4310) // cast truncates constant value +#endif // _MSC_VER + +#if TEST_STD_VER >= 11 + static_assert((LCE::max() == result_type(m - 1u)), ""); +#else + assert((LCE::max() == result_type(m - 1u))); +#endif + +#ifdef _MSC_VER + #pragma warning(pop) +#endif // _MSC_VER + static_assert((LCE::default_seed == 1), ""); where(LCE::multiplier); where(LCE::increment); @@ -53,7 +72,7 @@ test() test1<T, 0, 0, 0>(); test1<T, 0, 1, 2>(); test1<T, 1, 1, 2>(); - const T M(~0); + const T M(static_cast<T>(-1)); test1<T, 0, 0, M>(); test1<T, 0, M-2, M>(); test1<T, 0, M-1, M>(); |