]> 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 2aa585463619e2b4dd65c5372a46323a3d00a64d..7e4ab9a44e6e365adea43f8c45a47cc07af55cf0 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-11-24  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008-2016 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();
 }