]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/cons/parms.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 26_numerics / random / uniform_int_distribution / cons / parms.cc
index 70b40b0ade6468dc73c16e2ff13ad3a38b9f0ed6..7e4ab9a44e6e365adea43f8c45a47cc07af55cf0 100644 (file)
@@ -1,9 +1,9 @@
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
 // { dg-require-cstdint "" }
 //
 // 2008-11-24  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008-2020 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -29,8 +29,6 @@
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   std::uniform_int_distribution<int> u(1, 20);
   VERIFY( u.a() == 1 );
   VERIFY( u.b() == 20 );
@@ -38,8 +36,20 @@ test01()
   VERIFY( u.max() == 20 );
 }
 
+void
+test02()
+{
+  using param_type = std::uniform_int_distribution<int>::param_type;
+  const param_type p(1, 20);
+  std::uniform_int_distribution<int> u(p);
+  VERIFY( u.param() == p );
+  VERIFY( u.param() != param_type{} );
+  VERIFY( u.min() == 1 );
+  VERIFY( u.max() == 20 );
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }