summaryrefslogtreecommitdiffstats
path: root/libcxx/test/numerics/rand/rand.dis/rand.dist.bern
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/numerics/rand/rand.dis/rand.dist.bern')
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/nothing_to_do.pass.cpp12
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/assign.pass.cpp33
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/copy.pass.cpp31
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/ctor_double.pass.cpp36
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/ctor_param.pass.cpp28
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eq.pass.cpp36
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval.pass.cpp35
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval_param.pass.cpp37
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/get_param.pass.cpp28
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/io.pass.cpp40
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/max.pass.cpp26
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/min.pass.cpp26
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_assign.pass.cpp30
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_copy.pass.cpp29
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_ctor.pass.cpp34
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_eq.pass.cpp36
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_types.pass.cpp27
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/set_param.pass.cpp29
-rw-r--r--libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/types.pass.cpp26
19 files changed, 579 insertions, 0 deletions
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/nothing_to_do.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/nothing_to_do.pass.cpp
new file mode 100644
index 00000000000..fa4d462f18d
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/assign.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/assign.pass.cpp
new file mode 100644
index 00000000000..263be42519b
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/assign.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+
+// bernoulli_distribution& operator=(const bernoulli_distribution&);
+
+#include <random>
+#include <cassert>
+
+void
+test1()
+{
+ typedef std::bernoulli_distribution D;
+ D d1(0.75);
+ D d2;
+ assert(d1 != d2);
+ d2 = d1;
+ assert(d1 == d2);
+}
+
+int main()
+{
+ test1();
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/copy.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/copy.pass.cpp
new file mode 100644
index 00000000000..085e9d1884a
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/copy.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+
+// bernoulli_distribution(const bernoulli_distribution&);
+
+#include <random>
+#include <cassert>
+
+void
+test1()
+{
+ typedef std::bernoulli_distribution D;
+ D d1(0.75);
+ D d2 = d1;
+ assert(d1 == d2);
+}
+
+int main()
+{
+ test1();
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/ctor_double.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/ctor_double.pass.cpp
new file mode 100644
index 00000000000..46b5bfdba70
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/ctor_double.pass.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+
+// explicit bernoulli_distribution(double p = 0.5);
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ D d;
+ assert(d.p() == 0.5);
+ }
+ {
+ typedef std::bernoulli_distribution D;
+ D d(0);
+ assert(d.p() == 0);
+ }
+ {
+ typedef std::bernoulli_distribution D;
+ D d(0.75);
+ assert(d.p() == 0.75);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/ctor_param.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/ctor_param.pass.cpp
new file mode 100644
index 00000000000..8ac00698427
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/ctor_param.pass.cpp
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+
+// explicit bernoulli_distribution(const param_type& parm);
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ typedef D::param_type P;
+ P p(0.25);
+ D d(p);
+ assert(d.p() == 0.25);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eq.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eq.pass.cpp
new file mode 100644
index 00000000000..e24378c1f08
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eq.pass.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+
+// bool operator=(const bernoulli_distribution& x,
+// const bernoulli_distribution& y);
+// bool operator!(const bernoulli_distribution& x,
+// const bernoulli_distribution& y);
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ D d1(.25);
+ D d2(.25);
+ assert(d1 == d2);
+ }
+ {
+ typedef std::bernoulli_distribution D;
+ D d1(.28);
+ D d2(.25);
+ assert(d1 != d2);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval.pass.cpp
new file mode 100644
index 00000000000..09a18508d2e
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval.pass.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+
+// template<class _URNG> result_type operator()(_URNG& g);
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::uniform_int_distribution<> D;
+ typedef std::minstd_rand0 G;
+ G g;
+ D d(.75);
+ int count = 0;
+ for (int i = 0; i < 10000; ++i)
+ {
+ bool u = d(g);
+ if (u)
+ ++count;
+ }
+ assert(count > 7400);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval_param.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval_param.pass.cpp
new file mode 100644
index 00000000000..c9980019619
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval_param.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+
+// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ typedef D::param_type P;
+ typedef std::minstd_rand0 G;
+ G g;
+ D d(.75);
+ P p(.25);
+ int count = 0;
+ for (int i = 0; i < 10000; ++i)
+ {
+ bool u = d(g, p);
+ if (u)
+ ++count;
+ }
+ assert(count < 2600);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/get_param.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/get_param.pass.cpp
new file mode 100644
index 00000000000..021eb0e188b
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/get_param.pass.cpp
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+
+// param_type param() const;
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ typedef D::param_type P;
+ P p(.125);
+ D d(p);
+ assert(d.param() == p);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/io.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/io.pass.cpp
new file mode 100644
index 00000000000..d40ee7d47fa
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/io.pass.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+
+// template <class charT, class traits>
+// basic_ostream<charT, traits>&
+// operator<<(basic_ostream<charT, traits>& os,
+// const bernoulli_distribution& x);
+//
+// template <class charT, class traits>
+// basic_istream<charT, traits>&
+// operator>>(basic_istream<charT, traits>& is,
+// bernoulli_distribution& x);
+
+#include <random>
+#include <sstream>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ D d1(.25);
+ std::ostringstream os;
+ os << d1;
+ std::istringstream is(os.str());
+ D d2;
+ is >> d2;
+ assert(d1 == d2);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/max.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/max.pass.cpp
new file mode 100644
index 00000000000..a821a114ec2
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/max.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+
+// result_type max() const;
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ D d(.25);
+ assert(d.max() == true);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/min.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/min.pass.cpp
new file mode 100644
index 00000000000..8a1987d3402
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/min.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+
+// result_type min() const;
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ D d(.5);
+ assert(d.min() == false);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_assign.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_assign.pass.cpp
new file mode 100644
index 00000000000..c2accdb1ea7
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_assign.pass.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+// {
+// class param_type;
+
+#include <random>
+#include <limits>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ typedef D::param_type param_type;
+ param_type p0(.7);
+ param_type p;
+ p = p0;
+ assert(p.p() == .7);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_copy.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_copy.pass.cpp
new file mode 100644
index 00000000000..88914e77f5e
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_copy.pass.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+// {
+// class param_type;
+
+#include <random>
+#include <limits>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ typedef D::param_type param_type;
+ param_type p0(.125);
+ param_type p = p0;
+ assert(p.p() == .125);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_ctor.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_ctor.pass.cpp
new file mode 100644
index 00000000000..591b316e55f
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_ctor.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+// {
+// class param_type;
+
+#include <random>
+#include <limits>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ typedef D::param_type param_type;
+ param_type p;
+ assert(p.p() == 0.5);
+ }
+ {
+ typedef std::bernoulli_distribution D;
+ typedef D::param_type param_type;
+ param_type p(0.25);
+ assert(p.p() == 0.25);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_eq.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_eq.pass.cpp
new file mode 100644
index 00000000000..b628820e8b8
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_eq.pass.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+// {
+// class param_type;
+
+#include <random>
+#include <limits>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ typedef D::param_type param_type;
+ param_type p1(0.75);
+ param_type p2(0.75);
+ assert(p1 == p2);
+ }
+ {
+ typedef std::bernoulli_distribution D;
+ typedef D::param_type param_type;
+ param_type p1(0.75);
+ param_type p2(0.5);
+ assert(p1 != p2);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_types.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_types.pass.cpp
new file mode 100644
index 00000000000..53961413548
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/param_types.pass.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+// {
+// class param_type;
+
+#include <random>
+#include <type_traits>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ typedef D::param_type param_type;
+ typedef param_type::distribution_type distribution_type;
+ static_assert((std::is_same<D, distribution_type>::value), "");
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/set_param.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/set_param.pass.cpp
new file mode 100644
index 00000000000..57f20f06820
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/set_param.pass.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+
+// void param(const param_type& parm);
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ typedef D::param_type P;
+ P p(0.25);
+ D d(0.75);
+ d.param(p);
+ assert(d.param() == p);
+ }
+}
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/types.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/types.pass.cpp
new file mode 100644
index 00000000000..27801f17828
--- /dev/null
+++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/types.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// class bernoulli_distribution
+// {
+// typedef bool result_type;
+
+#include <random>
+#include <type_traits>
+
+int main()
+{
+ {
+ typedef std::bernoulli_distribution D;
+ typedef D::result_type result_type;
+ static_assert((std::is_same<result_type, bool>::value), "");
+ }
+}
OpenPOWER on IntegriCloud