]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/ext/random/triangular_distribution/cons/parms.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / ext / random / triangular_distribution / cons / parms.cc
index 8380965df4658c8376001cd074db035c92433eef..0b313e4655ed26746492ecfbf4d50e24716a6eeb 100644 (file)
@@ -1,10 +1,10 @@
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
 // { dg-require-cstdint "" }
 //
 // 2008-11-24  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 // 2013-03-02  Ulrich Drepper <drepper@gmail.com>
 //
-// Copyright (C) 2013 Free Software Foundation, Inc.
+// Copyright (C) 2013-2024 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
@@ -27,8 +27,6 @@
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   __gnu_cxx::triangular_distribution<> u(1.5, 3.0, 3.5);
   VERIFY( u.a() == 1.5 );
   VERIFY( u.b() == 3.0 );
@@ -37,8 +35,20 @@ test01()
   VERIFY( u.max() == 3.5 );
 }
 
+void
+test02()
+{
+  using param_type = __gnu_cxx::triangular_distribution<>::param_type;
+  const param_type p(1.5, 3.0, 3.5);
+  __gnu_cxx::triangular_distribution<> u(p);
+  VERIFY( u.param() == p );
+  VERIFY( u.param() != param_type{} );
+  VERIFY( u.min() == 1.5 );
+  VERIFY( u.max() == 3.5 );
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }