From 5a83710e371fe68a06e6e3876c6a2c8b820a8976 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sat, 20 Dec 2014 01:40:03 +0000 Subject: Move test into test/std subdirectory. llvm-svn: 224658 --- .../rand.dist.samp.pconst/io.pass.cpp | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp (limited to 'libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp') diff --git a/libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp b/libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp new file mode 100644 index 00000000000..9af776d549a --- /dev/null +++ b/libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp @@ -0,0 +1,44 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// class piecewise_constant_distribution + +// template +// basic_ostream& +// operator<<(basic_ostream& os, +// const piecewise_constant_distribution& x); +// +// template +// basic_istream& +// operator>>(basic_istream& is, +// piecewise_constant_distribution& x); + +#include +#include +#include + +int main() +{ + { + typedef std::piecewise_constant_distribution<> D; + double b[] = {10, 14, 16, 17}; + double p[] = {25, 62.5, 12.5}; + const size_t Np = sizeof(p) / sizeof(p[0]); + D d1(b, b+Np+1, p); + std::ostringstream os; + os << d1; + std::istringstream is(os.str()); + D d2; + is >> d2; + assert(d1 == d2); + } +} -- cgit v1.2.3